Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compatibility/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ compatibility/fixtures/<category>/<name>/

Imported fixtures should also record an immutable `sourceCommit`, a direct
`sourceUrl`, a `licenseUrl`, and whether the source was modified. The corpus
contains 41 fixtures: 27 WrightKit-authored synthetic cases, one census boundary
contains 42 fixtures: 28 WrightKit-authored synthetic cases, one census boundary
fixture, and 13
real-world projects (11 derived from the pinned OverPy `examples/` tree,
GPL-3.0-only, provenance-recorded evidence, plus the independent BSD-2-Clause
Expand Down
1 change: 1 addition & 0 deletions compatibility/differential-expectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
{"fixture": "real-world/ow1-emulator", "nativeStatus": "failure", "classification": "match", "ruleNames": false, "evidence": ["oracle:real-world/ow1-emulator/oracle.json", "provenance:real-world/ow1-emulator/fixture.json"], "note": "The full project remains preserved as a failure corpus case with recorded provenance."},
{"fixture": "real-world/6v6-adjustments", "nativeStatus": "failure", "classification": "match", "ruleNames": false, "evidence": ["oracle:real-world/6v6-adjustments/oracle.json", "provenance:real-world/6v6-adjustments/fixture.json"], "note": "The full project remains preserved as a failure corpus case with recorded provenance."},
{"fixture": "synthetic/issue-35-integration", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:synthetic/issue-35-integration/oracle.json", "implementation-invariant:opy-compiler-vertical-slice"], "note": "The OPY frontend resolves the source fixture; the dedicated opy-compiler test independently lowers it through canonical WIR validation and deterministic workshop-rs emission."},
{"fixture": "synthetic/issue-40-structural", "nativeStatus": "success", "classification": "match", "ruleNames": false, "evidence": ["oracle:synthetic/issue-40-structural/oracle.json", "implementation-invariant:opy-compiler-structural-lowering"], "note": "The pinned oracle records subroutine source identity, deterministic explicit/implicit variable allocation, and player event filters; the dedicated opy-compiler test independently asserts those structures in canonical WIR."},
{"fixture": "census/workshop-feature-census", "nativeStatus": "success", "classification": "match", "ruleNames": true, "evidence": ["oracle:census/workshop-feature-census/oracle.json", "contract:workshop-rs#10-feature-census"], "note": "OPy source records opaque Workshop feature identities for the future workshop-rs lowering boundary."}
]
}
4 changes: 2 additions & 2 deletions compatibility/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This directory is the opy-rs compatibility corpus: OPY sources with their
pinned-oracle snapshots (`oracle.json`), ported from the WrightKit project's
evidence base (wright `compatibility/fixtures/`) and re-verified against the
pinned OverPy 9.7.10 oracle on 2026-08-17 (all 41 snapshots match).
pinned OverPy 9.7.10 oracle on 2026-08-17 (all 42 snapshots match).

Corpus policy: every fixture records provenance in its `fixture.json`
(`kind`, `origin`, `license`, `redistributable`, and — for imported
Expand Down Expand Up @@ -121,7 +121,7 @@ reference diagnostics, exactly like the pinned oracle behaves.

## Not ported / dropped

* **No fixture was dropped for provenance reasons**: all 41 fixtures in the
* **No fixture was dropped for provenance reasons**: all 42 fixtures in the
WrightKit corpus carried complete, reviewed provenance and are ported.
* Upstream `examples/` not ported (candidates for later expansion once a
demonstrated need exists): `lucioball_all_heroes.opy`, `skirmish_elim.opy`,
Expand Down
14 changes: 14 additions & 0 deletions compatibility/fixtures/synthetic/issue-40-structural/fixture.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"schemaVersion": 1,
"id": "synthetic/issue-40-structural",
"category": "synthetic",
"features": ["compilation/opy-structural-lowering"],
"source": "source.opy",
"expectedStatus": "success",
"provenance": {
"kind": "original",
"origin": "opy-rs Issue #40 minimized structural lowering probe",
"license": "AGPL-3.0-or-later",
"redistributable": true
}
}
27 changes: 27 additions & 0 deletions compatibility/fixtures/synthetic/issue-40-structural/oracle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compile": {
"diagnostics": [],
"exitCode": 0,
"status": "success",
"stdout": "",
"workshop": "variables {\n global:\n 0: reserved\n 1: first\n 2: explicit\n 3: next\n}\n\nsubroutines {\n 0: helper\n}\n\nrule (\"[Source] renamed helper\") {\n event {\n Subroutine;\n helper;\n }\n actions {\n Set Global Variable(first, 1);\n }\n}\n\nrule (\"[Source] joined\") {\n event {\n Player Joined Match;\n Team 1;\n Slot 2;\n }\n actions {\n Call Subroutine(helper);\n }\n}\n",
"workshopExact": "variables {\n global:\n 0: reserved\n 1: first\n 2: explicit\n 3: next\n}\n\nsubroutines {\n 0: helper\n}\n\nrule (\"[Source] renamed helper\") {\n event {\n Subroutine;\n helper;\n }\n actions {\n Set Global Variable(first, 1);\n }\n}\n\nrule (\"[Source] joined\") {\n event {\n Player Joined Match;\n Team 1;\n Slot 2;\n }\n actions {\n Call Subroutine(helper);\n }\n}\n\n",
"workshopSha256": "9cadaf38b68d2b864c2f7bb822c649ab5d0fff5eaf17712d02eb3ccbef75df34"
},
"fixture": "synthetic/issue-40-structural",
"input": {
"sha256": "c3a1daee735d48e670cf98fed74872b02480d9a7064a3340eadae3278d4eb7b8",
"source": "source.opy"
},
"oracle": {
"gitHead": "1e2688954302a402d076944b46db07efb14d7b61",
"integrity": "sha512-oX17nauJcPTaKIrRFY/rD0Rl8atqFUVv9Hg2TKH+A68/fC8+ZO344Mkd1A/Y0oOVp1hr5tktMBjzMEDDnMEYUw==",
"language": "en-US",
"license": "GPL-3.0-only",
"name": "overpy",
"registryTarball": "https://registry.npmjs.org/overpy/-/overpy-9.7.10.tgz",
"repository": "https://github.com/Zezombye/overpy",
"version": "9.7.10"
},
"schemaVersion": 1
}
18 changes: 18 additions & 0 deletions compatibility/fixtures/synthetic/issue-40-structural/source.opy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!rulePrefixTemplate
globalvar reserved 0
globalvar first
globalvar explicit 2
globalvar next
subroutine helper

def helper():
@Name "renamed helper"
@SuppressWarnings unusedVariable
first = 1

rule "joined":
@Event playerJoined
@Team 1
@Slot 2
@SuppressWarnings unusedVariable
helper()
23 changes: 18 additions & 5 deletions compatibility/support-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"snapshot": {
"date": "2026-08-18",
"note": "Readiness baseline for #7 through the #28/#29/#30/#33 Draft PR series plus the bounded #35 integration slice. Frontend-supported rows include the pinned OPY syntax, directives, preprocessing, macro statements, rule directives/model, JavaScript macros, and runtime hooks. Semantic-supported rows include declaration resolution, for-loop binders, modules, keyword arguments, the declared alias surface, and the OPY-owned manifest overlay for builtin/member/enum semantics. Canonical Workshop builtin/member/enum breadth and emission remain separate lowering-dependent rows; no Workshop catalog data is copied into opy-rs. The 41-fixture differential corpus currently reports 34 matches, 7 explicit known gaps, 0 unexpected divergences, and 0 inconclusive results. #!postCompileHook is parsed/validated/recorded by the frontend; execution against final Workshop text is lowering-dependent (#8).",
"note": "Readiness baseline for #7 through the #28/#29/#30/#33 Draft PR series plus the bounded #35 and #40 integration slices. Frontend-supported rows include the pinned OPY syntax, directives, preprocessing, macro statements, rule directives/model, JavaScript macros, and runtime hooks. Semantic-supported rows include declaration resolution, for-loop binders, modules, keyword arguments, the declared alias surface, and the OPY-owned manifest overlay for builtin/member/enum semantics. Canonical Workshop builtin/member/enum breadth and emission remain separate lowering-dependent rows; no Workshop catalog data is copied into opy-rs. The 42-fixture differential corpus currently reports 35 matches, 7 explicit known gaps, 0 unexpected divergences, and 0 inconclusive results. #!postCompileHook is parsed/validated/recorded by the frontend; execution against final Workshop text is lowering-dependent (#8).",
"asOfCommit": "4d88daf4e3445af37ce06774d789a94c5bcbe355"
},
"states": {
Expand Down Expand Up @@ -599,7 +599,7 @@
"docs:docs/hir/opy-hir-v1.md",
"test:opy-frontend-differential"
],
"notes": "Issues #3-#7, #25, and the #28/#29/#30/#33 readiness tracks. Fully Workshop-independent; the 41-fixture corpus is the acceptance corpus. Differential harness runs every fixture through the native pipeline in cargo test with structural self-checks (HIR validation, wire round-trip, deterministic dump), status/rule-name parity against recorded oracle.json snapshots, explicit native evidence expectations, and a machine-readable report (target/opy-differential-report.json). The current report has 34 matches, 7 reference-success/native-failure cases classified as known gaps, and no unexpected divergence or inconclusive result."
"notes": "Issues #3-#7, #25, and the #28/#29/#30/#33 readiness tracks. Fully Workshop-independent; the 42-fixture corpus is the acceptance corpus. Differential harness runs every fixture through the native pipeline in cargo test with structural self-checks (HIR validation, wire round-trip, deterministic dump), status/rule-name parity against recorded oracle.json snapshots, explicit native evidence expectations, and a machine-readable report (target/opy-differential-report.json). The current report has 35 matches, 7 reference-success/native-failure cases classified as known gaps, and no unexpected divergence or inconclusive result."
},
{
"id": "compilation/opy-integration-vertical-slice",
Expand All @@ -613,6 +613,19 @@
],
"notes": "Issue #35. The dedicated opy-compiler crate consumes resolved OPY HIR, preserves source files/spans in workshop-rs WIR, cross-checks manifest catalogId/domain links against Catalog, validates canonical WIR, and emits deterministic en-US Workshop through the published workshop-rs v0.1.1 contract. This is a bounded first slice; broader OPY lowering remains lowering-dependent and is not reclassified by this fixture."
},
{
"id": "compilation/opy-structural-lowering",
"name": "OPY structural HIR -> canonical WIR lowering: declarations, subroutines, rules, events, and provenance",
"category": "compilation",
"state": "end-to-end-supported",
"evidence": [
"fixtures:synthetic/issue-35-integration",
"fixtures:synthetic/issue-40-structural",
"test:opy-compiler-structural-lowering",
"contract:workshop-rs-v0.1.1"
],
"notes": "Issue #40. Global/player variables and subroutines use deterministic canonical indices with source/name spans; subroutine definitions and calls, rule disabled state, conditions, supported event/filter identities, and source-file provenance lower directly into workshop-rs WIR. Unsupported settings, declarations, annotations, events, filters, and statement forms remain explicit source-attributed integration diagnostics. This does not claim full statement/expression, catalog/member/enum, settings, locale, optimizer, hook, or decompilation coverage."
},
{
"id": "compilation/workshop-lowering",
"name": "HIR -> Workshop lowering and emission through workshop-rs",
Expand All @@ -622,7 +635,7 @@
"fixtures:synthetic",
"fixtures:real-world"
],
"notes": "Issue #8 remains the broader lowering track. The released workshop-rs v0.1.1 public contract now supports the bounded #35 adapter; full OPY surface lowering, settings/content, locales, optimizer effects, and hooks remain Workshop-owned follow-up work. Oracle snapshots (fixtures/**/oracle.json) remain preserved reference evidence; no temporary Workshop IR is introduced here."
"notes": "Issue #8 remains the broader lowering track. The released workshop-rs v0.1.1 public contract now supports the bounded #35 adapter and the #40 structural skeleton; full OPY statement/expression lowering, catalog/member/enum breadth, settings/content, locales, optimizer effects, and hooks remain lowering-dependent follow-up work. Oracle snapshots (fixtures/**/oracle.json) remain preserved reference evidence; no temporary Workshop IR is introduced here."
},
{
"id": "compilation/end-to-end",
Expand Down Expand Up @@ -664,7 +677,7 @@
"frontend-supported": 23,
"semantic-supported": 13,
"lowering-dependent": 13,
"end-to-end-supported": 1
"end-to-end-supported": 2
},
"byCategory": {
"syntax": 14,
Expand All @@ -675,7 +688,7 @@
"translations": 2,
"optimization": 3,
"runtime": 1,
"compilation": 4,
"compilation": 5,
"decompilation": 2
}
}
Expand Down
1 change: 0 additions & 1 deletion compatibility/tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def test_repository_fixture_metadata_and_snapshots_are_valid(self):
fixtures = run_oracle.discover_fixtures(
COMPATIBILITY_DIR / "fixtures"
)
self.assertEqual(len(fixtures), 41)
for fixture_path, fixture in fixtures:
snapshot = fixture_path.parent / "oracle.json"
self.assertTrue(snapshot.is_file(), fixture["id"])
Expand Down
3 changes: 3 additions & 0 deletions crates/opy-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ workspace = true
[dependencies]
opy-frontend = { path = "../opy-frontend" }
workshop-rs = "=0.1.1"

[dev-dependencies]
serde_json = "1"
Loading