Repository navigation
fix(compiler): honor disabled optimizations for array indexing - #677
Conversation
Lower index expressions through valueInArray and let the existing value optimizer choose firstOf only when optimizations are enabled. Add a pinned-oracle differential fixture covering integer and decimal zero indices, nonzero indices, and default/disabled/re-enabled optimization states. Fixes #672
|
Ready for independent review of commit Issue #672 is implemented and pushed. Before editing, the pinned OverPy 9.7.17 canonical comparison reproduced All applicable local gates completed in the foreground: formatting, stable and Rust 1.88.0 Clippy, full workspace tests, differential corpus, 52 Python tests, native corpus comparison (145 matches / 15 recorded gaps / zero unexpected divergences), and 6,114 builtin probes (zero unexplained findings). Ablation removed the duplicate lowering rewrite and reused the existing optimizer. A single-pass simplify review found no additional changes needed. Hosted CI and independent review remain pending. Please verify the issue acceptance criteria and optimization-state controls against the pinned oracle; no merge has been performed. |
|
Fixed finding 1 from the review ( Strict empty-array indexing now reaches the existing zero-index optimizer rewrite, emitting canonical Verification completed in the foreground on the final implementation:
All findings in the review file are fixed; none were deferred or contradicted the approved issue/architecture. There are no GitHub review threads to resolve. PR #677 is ready for follow-up review of |
|
Fixed round-2 finding 1 ( Strict empty-array indexing now selects Verification completed in the foreground on the final code:
The sole requested round-2 finding is fixed; none was deferred or contradicted the approved issue or architecture. No GitHub review threads exist to resolve. PR #677 is ready for follow-up review of |
Under
#!disableOptimizations,arr[0]andarr[0.0]emittedFirst Ofwhile pinned OverPy 9.7.17 emitsValue In Array. Index expressions now lower throughvalueInArray, leaving the existing value optimizer to selectfirstOfwhen enabled.Adds a canonical differential fixture for integer/decimal zero and nonzero indexing, including default, disabled, and re-enabled optimization states. The ablation pass removed the redundant lowering rewrite instead of adding a separate optimization-state branch. No new mechanism or dependency is needed.
Fixes #672
Verification
All commands completed in the foreground:
pnpm install --dir tools/overpy/oracle— installed pinned OverPy 9.7.17.cargo build --locked -p opy-cli --features compatibility --bins— passed (CARGO_INCREMENTAL=0).target/debug/opy-compat project-compare --source <scratch>/source.opy --root <scratch> --reference <scratch>/reference.workshop— before editing, canonical mismatchfirstOfversusvalueInArray; after the final change,equivalent: true, zero differences. Scratch files are under/Users/teakowa/Repos/wrightkit/.task-scratch/orch/scratch-672.python3 tools/overpy/run_oracle.py --fixture synthetic/structural-index-optimization --update, then the same command without--update— snapshot generated and independently rechecked against the pinned oracle; passed.cargo test -p opy-rs --test differential— passed, including the new fixture.cargo fmt --all -- --check— passed.cargo clippy --workspace --all-targets --all-features -- -D warnings— passed.cargo +1.88.0 clippy --workspace --all-targets --all-features -- -D warnings— passed.cargo test --workspace --all-targets --all-features— passed; one existing ignored test.python3 -m unittest discover -s tools/overpy/tests— 52 passed.python3 tools/overpy/run_native.py --binary target/debug/opy-cli --semantic-binary target/debug/opy-compat— 145 matches, 15 recorded gaps, zero unexpected divergences; new fixture canonically matches.python3 tools/overpy/probe_builtins.py --binary target/debug/opy-compat --jobs 4— 6,114 probes, zero unexplained findings.git diff --checkandgit diff --cached --check— passed.Unverified
Hosted CI and independent PR review have not completed. Existing recorded corpus/probe gaps remain; this PR makes no broader compatibility claim. UI gates do not apply because no UI files changed.