Skip to content

feat(opy): complete bounded canonical lowering - #150

Open
e54-bot wants to merge 2 commits into
mainfrom
codex/issue-145-lowering
Open

feat(opy): complete bounded canonical lowering#150
e54-bot wants to merge 2 commits into
mainfrom
codex/issue-145-lowering

Conversation

@e54-bot

@e54-bot e54-bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • complete bounded OPY-to-canonical-WIR lowering for literal strings, f/w/b/c modifiers, literal dictionary lookup, contextual chaseAtRate, and null defaults
  • preserve canonical text contexts for debug, print, and HUD helpers, including constant folding for literal format arguments
  • add oracle-backed Complete OPY-to-canonical-WIR lowering for the supported source language #145 lowering tests and refresh compiler/support evidence; retain nested indexed writes and unrelated builtin/parser gaps as explicit owner boundaries

Verification

  • cargo fmt --all -- --check
  • python3 -m unittest discover -s compatibility/tests
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets --all-features
  • full 61-fixture corpus: 61/61 compile-status matches, 40 matches, 19 declared known gaps, and 2 declared unsupported boundaries

Scope note

The remaining chase fixture semantic gap is tracked by opy-rs#144; the broad issue-28 oracle snapshot remains a declared #88 corpus boundary because the released Workshop parser cannot currently reparse its uppercase hexadecimal spelling. No unowned OPY lowering gap is introduced by this PR.

Fixes #145

@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 — crates/opy-rs/src/compiler/mod.rs:3364

The new literal-dict fast path only handles a matching key. A valid literal miss (for example {"a": 1}["b"]) falls through to generic Expr::Dict lowering and is rejected. The pinned OverPy implementation instead lowers dict access through key/value arrays; for an all-literal miss .index folds to -1, then __valueInArray__ folds the negative index to null. Handle the missing-key case and add oracle-backed coverage before claiming compilation/opy-literal-dict-lookup end-to-end supported.

Major — compatibility/support-matrix.json / Fixes #145

#145 explicitly subsumed #60, and #60 was closed as “superseded by #145”, but this PR still leaves deeper indexed writes “tracked by #60” while closing #145. The current compiler expectations also retain synthetic/issue-31-positive as a known-gap owned by opy-rs#145. Merging this as Fixes #145 therefore leaves declared lowering gaps without a live follow-up owner and does not satisfy #145’s category-level completion contract. Either complete/reclassify those #145-owned boundaries here, or keep #145 open (within its two-PR budget) and give the remaining gap an active owner.

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.

Complete OPY-to-canonical-WIR lowering for the supported source language

2 participants