Repository navigation
Test Lua's targeted generic specialisation against Jass, bounded-exhaustively - #1505
Conversation
…ustively GenericSpecialisationMatrixTests generates a self-checking program per combination of what depends on T (per-instantiation static, fixed-argument store, type-class bound, wurstNewInstance, instanceof Box<T>, T-typed field), where it sits (method, constructor, ondestroy, closure, inherited, module), how concrete code writes and reads it (direct, non-generic base, non-generic interface, generic interface, closure, super, destroy, erased generic function), the instantiation types (int, string, class, tuple; one or two) and the optimiser flags. Each program runs translated to Jass in the Jass interpreter, the oracle, and translated to Lua in Lua. Pull requests run a 384-case covering subset (all pairs, plus every dependency x writer x reader), about a minute. WURST_GENERIC_MATRIX=full runs the 36,864-case product, in shards for master or nightly runs. The 179 subset cases that fail on master are listed with their defect class in genericSpecialisationMatrix-knownFailures.txt and reported as skipped; any other failure fails the test. Jass passes every case.
With #1498 on master the fixed-store cases pass, so the known-failure list now holds the 165 tier cases that still fail. Each is tagged with the defect it shows, and each tag has a BACKLOG.md entry with a minimal repro: per-instantiation statics read through erased code, instanceof across non-tuple instantiations, bound requirements and wurstNewInstance behind erased dispatch, closures in bounded classes, fields written through another instance, subclasses of tuple-instantiated generics and an EliminateTuples crash. The Jass instanceof-on-a-field defect the generator steps around has an entry too. The full product fails in no other class, and Jass passes every case.
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. |
…ion-matrix # Conflicts: # BACKLOG.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27a6236b88
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…s with luac A case in the known-failure list was skipped on any failure, so a Jass (oracle) regression or a new Lua symptom in a listed case left the run green. defectOf now classifies a failure by its symptom, and a listed case is skipped only while it fails on Lua, with Jass passing, with the listed defect; otherwise it fails and says how it was listed. All 165 listed cases classify as listed. The matrix's own Lua runner skipped the luac syntax check that every executing Lua test makes. It now checks each script before running it: a missing luac fails, a missing interpreter skips the run only.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c88bd80c68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
A listed STATIC or NEW_INSTANCE case, or a BOUND or FIELD case in a constructor or ondestroy, was skipped for any Lua run-time failure, since the defect follows from what the case depends on. Each entry now also holds the symptom: the wrong value the program reports, or the compiler's message without the numbers of generated names. For an error Lua raises it holds only that Lua raised, because those messages differ between Lua versions and the test hosts do not pin one. A listed case is skipped only when its defect and its symptom match.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a01410eba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
…he list On a host without a Lua interpreter the Lua side skipped the case after the Jass result was known, so a Jass failure was reported as skipped. A case now fails when Jass fails and skips only its Lua run when Jass passes. The list a run writes for updating the known failures held only the cases that run decided, so a shard or a filtered run dropped every other entry. It now starts from the existing list and replaces the cases that ran.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a35e278224
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
On Lua a new generic stays erased except where code needs the concrete type; Jass specialises everything. #1498 came from such a seam (a write through one dispatch path, a read through another), and the existing generators only checked that programs compile. This adds an executing, bounded-exhaustive differential test over that feature space, with Jass as the oracle.
What it does
GenericSpecialisationMatrixTestsgenerates one self-checking program per combination of:T: a per-instantiation static, a fixed-argument store inside the generic (the Fix concrete generic stores behind erased Lua dispatch #1498 shape), a type-class bound requirement,wurstNewInstance<T>(),instanceof Box<T>, aT-typed (tuple whenTis) field;-inline -localOptimizations.Each program runs translated to Jass in the Jass interpreter and translated to Lua in Lua. Combinations that are not programs are skipped with a named reason (
wurstNewInstanceneeds a class; a module member cannot override a superclass method). A rejection no rule predicts fails.WURST_GENERIC_MATRIX=fullruns all 36,864 cases (about an hour locally), sharded withWURST_GENERIC_MATRIX_SHARD=i/nto fit the test task's limit.WURST_GENERIC_MATRIX_KEEP_GOINGandWURST_GENERIC_MATRIX_FILTERsupport campaigns and repros.What it found
Jass passes every case. On master (with #1498), 165 of the 384 tier cases fail on Lua. They are listed in
genericSpecialisationMatrix-knownFailures.txtunder nine defect tags and skipped with the tag and the failure, so CI stays green and any other failure fails the test. Each tag has a BACKLOG.md entry with a minimal repro:lua-static-erasedlua-instanceof-erasedBox<string>isinstanceof Box<int>(no generic code needed)lua-bound-unresolvedlua-closure-receiverlua-new-instance-unresolvedwurstNewInstance<T>()in a constructor, an ondestroy or behind superlua-new-instance-erasedwurstNewInstance<T>()via an interface: translation crash, or null with optimisationslua-field-splitTfield written through another instance is not the one read backlua-tuple-subclassConcurrentModificationException, dangling dispatchlua-tuple-elimination-crashEliminateTuplesthrows on tuple-typed generic code (one shape on both targets)There is also a Jass defect:
this.field instanceof Box<T>in a generic class fails translation. The matrix reads a local copy instead, and the defect has its own BACKLOG entry.Proof
Tested on Windows with the bundled Lua 5.3. The Linux CI uses
lua5.3; macOS (master CI) installs Homebrew's Lua, whose version is not pinned. The list is keyed by case name, and a listed case that passes there only produces a summary note.