Skip to content

fix: preserve UDT object identity and lifecycle#100

Merged
luisleo526 merged 1 commit into
mainfrom
codex/udt-object-identity-20260722
Jul 22, 2026
Merged

fix: preserve UDT object identity and lifecycle#100
luisleo526 merged 1 commit into
mainfrom
codex/udt-object-identity-20260722

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

Summary

  • lower Pine v6 UDT objects through stable arena handles so assignment preserves reference identity while copy() detaches the outer object
  • coordinate lazy rollback across UDT, map, and matrix mutations in reverse touch order
  • use one strict typed-method binder across analysis, parsing, and emission, including forward sibling return refresh and collision-safe generated names

Root cause

UDT values were emitted as inline C++ structs, so ordinary assignment accidentally copied object state instead of preserving Pine reference identity. Several adjacent mechanisms then masked one another: typed user methods could collide with built-ins, forward declaration order could hide the authored return type, and collection rollback did not share one mutation order.

Scope boundary

This PR handles UDT identity, typed method dispatch, lifecycle rollback, NA/deletion behavior, and the required map/matrix integration. Direct array fields inside UDTs remain rejected and require a separate design and gate. No strategy data, TradingView tapes, graders, thresholds, or tier files change here.

Validation

  • full native suite, serial: passed
  • full native suite, 12-way xdist: passed
  • focused UDT identity/lifecycle: 38 passed
  • typed method lifecycle: 19 passed
  • map ordering/regressions: 12 passed
  • matrix checkpoint: 3 passed
  • request.security lifecycle/offset: 3 passed
  • git diff --check: clean
  • independent scraper N=4 gate: 16/16 cells, 80/80 probe executions, adjudicator GO (pineforge-4pass/pinescript-scrapper#119)

Depends on the already-merged engine matrix identity milestone (#129).

@luisleo526
luisleo526 merged commit bc97151 into main Jul 22, 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