perf: make transformation validation and hashing linear - #22
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change replaces list scans with casefolded dictionary lookups during plan binding. In-place application now computes canonical plan bytes and its SHA-256 hash once, then reuses both values for auditing and returned results. Tests cover performance, binding behavior, Unicode serialization, and hash call counts. ChangesTransformation pipeline
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change makes transformation binding and plan hashing linear while preserving transformation semantics and audit outputs. Current coverage supports merge readiness with no actionable risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Phase 6a of the approved performance plan: reduce repeated transformation-plan validation and canonical serialization work without changing public behavior. Dataset-label query work remains a separate deferred Phase 6b.
RED/GREEN and checks
1cdcc18: five intentional failures on base: 10k EXECUTE suffix bookkeeping, 10k label case-fold lookup, generic object/mapping apply encoding/hash counts, and SPSS apply encoding/hash counts.ebe4637: production only; tests immutable after RED.Measured evidence
Immutable base
66566529e86019b815f0bd3bae241b37930316dfversusebe4637a7faef5c3d9a3bab1f785695cd6b7c33a, same Python 3.13.2/SQLAlchemy/RFC8785 environment. Five fresh timed processes per revision/workload, alternating revision order; one warmup excluded.Exact counters: binder suffix entries 49,995,000→0;
casefoldon label workload 200,010,000→30,000; canonical plan encodings/hashes generic 4/3→1/1, SPSS 3/2→1/1. Actual SQL statements, fetched rows, affected rows, audit JSON, hashes, metadata, identity and provenance were byte/semantic-equivalent in isolated SQLite applies; no SQL reduction is claimed.Full evidence, raw profiles, checksums and exact commands:
../python-query-planning-evidence.mdand/tmp/python-query-planning-phase6a-zX3o6a(outside repository). Measurements include shared-host noise and a bounded 1k cProfile series; no timing assertions were added.Known limits
reject-descending-rangealready returnsinvalid_transformation_planwhile the manifest expectsinvalid_numeric_rangeon both base and after; this PR does not touch that code and does not claim to fix it.Next phase
After user merge: Phase 6b, separately characterize and optimize dataset-filtered label reads only if returned-row/query measurements justify it. Overall phases 0–9 remain unfinished. Do not auto-merge.