Skip to content

Fix matrix void method return lowering#98

Merged
luisleo526 merged 1 commit into
mainfrom
codex/matrix-void-method-return-20260721
Jul 21, 2026
Merged

Fix matrix void method return lowering#98
luisleo526 merged 1 commit into
mainfrom
codex/matrix-void-method-return-20260721

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

What changed

  • centralize the matrix mutators whose established C++ lowering returns void
  • recognize terminal matrix mutators in namespace and member forms, emitting the mutation as a statement followed by the wrapper's default return
  • preserve exact typed user-method precedence and namespace-shadowing behavior instead of classifying calls by method name alone
  • add parser, analyzer, transpilation, native-compilation, mutator-form, and dispatch-collision regression coverage

Root cause

The terminal-expression classifier handled void drawing, array, and map calls, but not matrix mutators. A single-expression method ending in matrix.set(self, ...) or self.set(...) could therefore generate invalid C++ such as return self.set(...);, even though the runtime call returns void.

Matrix detection must also resolve the exact receiver type. Same-named authored typed methods take precedence over builtins and must remain returnable, including when a parameter named matrix shadows the builtin namespace.

Validation

  • focused matrix void-method file: 25 passed; rerun after commit at the tested head
  • focused receiver combination: 38 passed
  • broader matrix/map/terminal regression suite: 282 passed
  • full pytest: 2,500 passed, 1 skipped
  • 685-source differential: 680 successes plus the same 5 established failures on baseline and candidate; zero status, diagnostic, or generated-C++ changes
  • engine corpus: 252/252, fail=0; board 247 Excellent / 4 Strong / 1 documented anomaly; report regeneration and lock-step self-test passed
  • 416-row scraper sweep: 409 OK, 1 no-trades, the same 5 transpile errors, 0 compile errors, the same 1 run error, 0 driver errors, and 0 unresolved timeouts
  • final scraper board: 355 Excellent / 46 Strong / 4 Moderate / 2 Weak, plus 7 excluded; one patch-independent Strong-to-Excellent movement and zero DOWN
  • tested head: 8f7dc924ed02696f2b799ec194c76187e3480bf6

The long gates ran against the exact three candidate file contents committed at the tested head. Their SHA-256 hashes were frozen before commit and verified unchanged after commit; the 25-case focused suite was then rerun from the clean committed head.

Scope boundary

This changes only terminal-call classification for matrix mutators whose existing C++ lowering returns void. It does not change the parser, analyzer, or matrix runtime implementations. remove_row and remove_col retain their existing numeric-sentinel lowering, and matrix-returning transforms remain on their established return path.

@luisleo526
luisleo526 merged commit 9872401 into main Jul 21, 2026
9 checks passed
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.

1 participant