Skip to content

fix(compiler): lower multiple switch breaks - #173

Merged
Teakowa merged 3 commits into
codex/issue-170-providerfrom
codex/issue-172-switch
Sep 3, 2026
Merged

fix(compiler): lower multiple switch breaks#173
Teakowa merged 3 commits into
codex/issue-170-providerfrom
codex/issue-172-switch

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • lower multiple direct case-local break statements through nested canonical WIR shared-exit layers
  • preserve existing fallthrough/default lowering and canonical action-width offsets
  • compare the minimized fixture against a canonical Workshop semantic oracle through the compatibility gate
  • independently execute native WIR against action traces parsed from the pinned OverPy output
  • keep canonical and packaged support matrices synchronized

Validation

  • cargo test --workspace — 371 passed
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • python3 -m unittest discover -s compatibility/tests — 35 passed
  • compatibility corpus: 63 fixtures, no unexpected regression; synthetic/issue-47-switch-multiple-break has semantic-wir: match
  • independent pinned action-trace test covers selectors 0, 1, 2, 3, and 99, including case-local break, default, and fallthrough
  • pinned Overwatch-AI-PVE@e0c0721e827fb60ff9ed9c48fd78221ed7d9ebfc provider lpp/compile reaches the next owner blocker: catalog-validation (filteredArray expects Array, got Player)

Review follow-up

  • The original pinned OverPy snapshot remains preserved as source evidence; the compatibility runner compares native WIR with the canonical semantic oracle.
  • The new pinned_overpy_switch_action_trace test independently parses the pinned OverPy action stream and executes the native WIR dispatch, so an incorrect lowering can disagree with the semantic shape file.
  • Canonical and packaged support matrices are byte-identical again, restoring the packaged-matrix compatibility contract.
  • Independent ablation disabled shared-exit lowering and restored the former rejection path. The minimized fixture test failed; pinned dispatcher/provider compile returned unsupported-integration-surface: multiple switch breaks with later reachable actions require canonical switch targets.

Stacked on #171.

Fixes #172

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major — synthetic/issue-47-switch-multiple-break is now declared a match but uses comparison: compiler-contract. The compatibility runner treats that path as accepted-gap and does not compare normalized output or semantic WIR, while the new regression test only asserts this patch's nested-If shape and offset literal. #172 requires observable-semantic evidence and explicitly forbids weakening the compatibility/conformance baseline. Add equivalent independent semantic evidence that can fail when case selection, case-local break, fallthrough, or default behavior is wrong; do not use compiler-contract as the evidence for a supported match.

Major — #172's ablation AC requires disabling/simplifying the shared switch-exit handling to make both the minimized regression and the pinned OW1 regression evidence fail again. The PR records only the minimized regression ablation. Run and record the same ablation against the pinned Overwatch-AI-PVE dispatcher/provider compile evidence.

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major — the previous semantic-evidence finding is only partially resolved. semantic-oracle.json is introduced in the same implementation patch and its canonical shape/offsets (Array(6, 0, 2, 5) plus nested If) are then used as the semantic-wir expectation. That does not constitute independent verification under the project evidence policy; nothing in the current patch independently derives this normalization from the preserved pinned OverPy oracle/source rather than from the new native lowering. Ground the semantic expectation in independently established external/provenance evidence or an independent semantic/property check that can disagree with this implementation, then keep the semantic-wir gate.

Major — latest head CI is red in Compiler compatibility gate during Run compatibility harness tests. This follow-up changes compatibility/support-matrix.json but not the packaged crates/opy-rs/support-matrix.json; the existing test_packaged_matrix_matches_canonical_matrix byte-equality contract therefore fails. Sync the packaged matrix (or revert the canonical matrix edit if it is not needed) and restore the gate.

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Teakowa
Teakowa merged commit 76b8caa into codex/issue-170-provider Sep 3, 2026
5 checks passed
@Teakowa
Teakowa deleted the codex/issue-172-switch branch September 3, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants