Skip to content

Preserve nullable matrix types#96

Merged
luisleo526 merged 1 commit into
mainfrom
codex/matrix-na-codegen-20260721
Jul 21, 2026
Merged

Preserve nullable matrix types#96
luisleo526 merged 1 commit into
mainfrom
codex/matrix-na-codegen-20260721

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

What changed

  • preserve the exact matrix element type when Pine assigns bare na to a matrix destination
  • carry matrix target typing through declarations, := reassignments, ternary/if/switch selections, and persistent first-reach storage
  • preserve typed matrix arguments and UDT fields, including positional, keyword, and omitted arguments
  • keep established matrix-returning builtins typed in functional and method form
  • add focused lifecycle coverage for top-level and callable matrix state

Why

Pine permits matrix IDs to be na. Codegen previously lowered bare na as scalar na<double>(), even when the destination was a typed matrix. That lost the matrix element type and could also turn persistent selection initializers into /* unknown */ or silently drop them.

This change is the codegen half of the nullable-matrix lifecycle fix. It targets the nullable runtime state merged in pineforge-engine PR #127 and was revalidated against merged engine 7b765aa702cc.

Impact

Generated strategies now retain matrix identity and element typing across nullable lifecycle operations. Incompatible element-type reassignment remains rejected.

This PR deliberately does not add nullable arrays, matrix assignment alias semantics, matrix-returning UDF or method inference, general untyped var x = na inference, or broader UDT identity behavior.

Validation

  • codegen full suite: 2,461 passed / 2 expected skips against merged engine 7b765aa702cc
  • clean merged-engine rebuild and CTest: 115/115 passed
  • exhaustive cross-repository N=3 matrix: 8/8, early stop disabled, publication gate passed
  • engine corpus: 252/252 executed; 247 Excellent / 4 Strong / 1 documented anomaly
  • forced-no-cache scraper gate: 416/416 accounted, zero compile/driver/unresolved timeout, 0 DOWN
  • independent final review: no in-scope blocker
  • production diff SHA-256: 5cab0779b4b4661ace209972656c17e9fd734588d0eb4b560b875dc36b15c33b

@luisleo526
luisleo526 merged commit 9cfc763 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