Skip to content

Release consumed inline teardown state from disabled tokens #653

Open

Description

Current status - 2026-11-08

MANAGED FIX MERGED; NATIVE RECLAMATION UNRESOLVED. The success-only consumed inline-state clearing correction and 96-case managed regression fixture are merged. The retained native research failures remain unqualified/unresolved; ordinary CI excludes MemoryReclaim. Keep the native disabled-token/map-reuse lifetime contract open.

Implementation baseline: master a2f096f1068f7951d193b95a03e76b480b7ef8a8, merged through #693 (same tree as qualified source 03f08cbecb156b7958dfc3e570d92d3deac04b4b). Shared release-wide review, cost and evidence gates remain in #575/#503. Historical observations and stopped studies below retain their original scope and verdict.

Current status, 2026-10-30

Public PR693 remains open and unmerged at 30ada1ff2524d4d8fd3f5497dec222888853af16. All six current-source native scopes now qualify on original Unity run 41027897125 and performance run 41027897218, attempt 1. The four supported Editors each retain 1,034 PASS / 15 identical skips, including all seven optional/nullable cases. Mono/IL2CPP retain 27,813/27,809 PASS on the first three versions and 27,812/27,808 on Unity 6.5, including all eight floating cases per scope. Old inventories and frozen classifiers remain qualified.

Internal correctness has 207 PASS. Comparisons retain 470 PASS / 66 identical skips plus five separate allocation-honesty passes. The aggregate binds 14 GitHub archives, 145 raw members, 15 worker inventories and 10 logs, with source/profile/process/build-input/replay/binary identity and every cleanup chain qualified. Final receipt SHA-256: adbcd5e20c66cba97803bdee017b9e05a9ec45f0e7a73440cdd640a75ab0314a. Source/run bindings precede target raw; all original rules remain unchanged.

The formatter failure and absent wallstop code/copy acceptance keep the PR unmerged. Timing CSV allocation fields remain -1/unmeasured. Ordinary correctness does not qualify historical failure causes, manual reclamation, calibration, native cost or final consumer/shipping acceptance. Those gates and stopped studies remain unchanged.

The correction was merged through PR619. Historical PR693 source was dae52d34af14dd4ce1e10f836ac8760e092a9797. All four default Unity versions and both performance correctness scopes qualified, including retained raw/source/process evidence and all six license/lock cleanup chains. Default correctness excludes the separate manual reclamation scope. These passes do not repair or explain its retained native failures.

This issue stays open for reclamation/root attribution, lifecycle/retained/native cost and final wallstop code/copy acceptance. The formatter failure also prevents a fully green PR. Original assertions, collection windows, unfavorable observations and stopped-study verdicts remain unchanged. No collector workaround, identical retry, shipping acceptance or readiness claim follows.

The historical development record below remains retained; its draft PR heads and pending checks describe those earlier observations.

Historical integration status, 2026-10-27

The correction is integrated into draft PR619, currently f213317a410b58d1cd2190e082df045e72557fbe. Successful inline deregistration clears the consumed typed teardown state; a thrown teardown retains its retryable state and token staging remains available. Runtime/Core is byte-identical to qualified parent2e7/68fe; the new f213Runtime change is confined to component configuration.

Parent68fe has qualified all four default Unity versions and both native performance scopes. Current f213whole-head qualification remains incomplete: three default-version jobs report passing tests but time out before artifact upload, and6.5continues. Historical results and source equivalence do not substitute for missing current artifacts. Full reclamation still has retained native failures; root attribution, native lifecycle/retained cost and final release gates remain open. Wallstop authorizes PR619 and future commits; this issue remains open without a readiness or shipping-revision claim.

The original private-candidate observations and local qualification below are a historical development record, not the current integration state.

A retained token can pin an unrelated later bus and receiver after Disable() succeeds and ordinary trimming recycles its typed context map.

Registration.Deregister marks _hasInlineDeregistration false but retains _typedDeregistration, including the old pooled _handlersByContext dictionary. A different handler/bus can rent that map. The disabled token still needs its staged callback for Enable(), but no longer owns that consumed teardown value.

Actual unchanged public Fbdd and private bfb5da0 sources each produce 2 FAIL/4 PASS with exact vectors across targeted/broadcast. Retain disabled token plus proven map reuse: all four unrelated graph references survive. Clear only the token root, or flush empty pools before reuse: all four collect. Old bus remains strongly reachable in all modes. Callback, zero-registration and exact map-reuse checks pass. Both public failures reproduce 50/50 fresh processes each (100 expected failures, 0 unexpected); all frozen source hashes remain exact.

Prospective protocol. Evidence: .artifacts/perf-lab/502-disabled-token-retention-s472. This is independent of #652's raw bus-handle capture: private bfb already removes that alias and still reproduces this typed-state root. No attribution to historical #502 or #640.

Acceptance: shared production-source regression RED before Runtime changes; release consumed inline state only after successful teardown while preserving throw/retry/reentrancy and Disable/Enable staging; exact full/repeated/collection controls; docs and source compatibility; native Unity allocation/reclamation and supported Unity/IL2CPP qualification; human code/copy review. Keep any correction local with the held batch until publication/native/review gates resolve.

Current local qualification

  • Actual public/held defect and collection/map-reuse controls; 100 fresh failing-case observations.
  • Identical shared fixture: unchanged Runtime 32 FAIL / 64 PASS -> candidate 96 PASS.
  • Original staged callback replay after re-enable, second disable and valid cleanup.
  • Ten fresh focused processes: 960 PASS; full 5636 PASS, exact prior 5540 plus 96.
  • Docs 699 exact PASS; 16 copied-reference semantic scopes PASS; state-clear counterfault.
  • Minimal success-only correction/docs, format/spelling/meta/validation and normal commit hooks.
  • Exact 46-file review packet, separate-index restoration and native source-only preparation.
  • Native correctness/allocation/reclamation and supported Unity/IL2CPP qualification.
  • Native teardown cost and wallstop code/copy review.
  • Authorized publication/integration with the held correctness batch.

Private commit 01f8dd5. Canonical partial verdict. At this original private milestone nothing had been pushed or adopted. Current integration status is recorded above; the issue remains open.

Activity

  1. wallstop commented on Oct 20, 2026

    @wallstop
    CollaboratorAuthor

    Prospective shared regression/candidate for #653, after actual unchanged-source RED.

    Public and held probes each reproduce 2 FAIL/4 PASS with exact vectors, and both public failures reproduce 50/50 fresh processes each. No Runtime edits yet. The source root is the consumed typed inline state retained by a staged disabled token, distinct from #652's bus-handle capture.

    Add a shared MemoryReclaim fixture: exactly 96 cases from MessageScenarios.AllKinds filtered to targeted/broadcast, old handler/post route, foreign handler/post route, same/different message type, old Action/Fast callback, and retained-token/clear-token/force-flush controls. Use existing internal bus construction with a constant test clock, idle age30, idle sweeping disabled and Trim enabled; age by64 actual quiet emits then ordinary Trim(false). Public probe retains public constructor coverage. Observe map identity through existing cold MessageBusInspection of the real staged state. No new production observer. NoInlining factories, heap token root, old bus kept alive in all modes, foreign receiver owns token, exactly three fixed full collection rounds, exact callback/live/cleanup counts. After collection, retained disabled tokens must Enable(), deliver the old callback once, Disable() again and cleanly trim; cleared-root controls must deliver no old callback. No staged callback is discarded.

    Freeze and run the complete identical final fixture on unchanged bfb Runtime in a separate RED worktree BEFORE any Runtime edit. Expected 32 FAIL/64 PASS (only retain-token+reuse). Keep all IDs/assertions.

    Candidate: one added default assignment to _typedDeregistration only after Registration.Deregister successfully returns and clears its existing inline flag. Do not clear before a throwing teardown; preserve existing exception/retry and overlapping registration wrapper ownership. Other interceptor/global state implementations are outside this observed pooled-map defect. Also correct the now-stale internal capturedSecondary XML comment from #652 to describe its reserved/null role; no field/layout/equality/hash changes. Add real lifecycle guide/changelog copy.

    GREEN: all96 cases; ten fresh focused processes; full portable suite preserving all5540 prior outcomes; docs699 prior outcomes; unchanged public six-case probe; copied-reference C#9 semantic compilation; formatting/spelling/meta/validation; exact-source critical review. Restore only the missing default assignment in a separately prefrozen source counterfault and require the same32 failing/64 passing identities. Existing full custom-bus throw/retry/reentrancy tests remain mandatory and unchanged. Retain every adverse setup/compiler/test outcome; no relaxed case, predicate, timeout, budget or collection control.

    Keep separate local child of bfb. Native correctness/allocation/reclamation, supported Unity/IL2CPP, teardown cost and human code/copy review remain open; no push/integration/adoption or historical #502/#640 attribution. Evidence .artifacts/perf-lab/502-disabled-token-retention-s472.

  2. wallstop commented on Oct 20, 2026

    @wallstop
    CollaboratorAuthor

    Actual shared RED is complete before Runtime edits: exactly 32 FAIL / 64 PASS / 0 SKIP across all 96 final cases on unchanged bfb Runtime. Every failure is the declared retained-disabled-token plus proven reuse case. All 241 prefrozen owned inputs and 2 external analyzer hashes remain exact; git confirms no Runtime changes. The passing controls already verify staged callback replay and valid cleanup. Proceeding with the declared single success-only state-clear assignment and the separate reserved-field XML correction.

  3. wallstop commented on Oct 20, 2026

    @wallstop
    CollaboratorAuthor

    PARTIAL: corrected and locally qualified in private commit 01f8dd5, tree f35f44738bcc069d35064ad2e6b4b3edc1b40578, parent bfb5da0. CLEAN worktree .artifacts/worktrees/472-disabled-token-retention; seven files, normal hooks PASS, NOT PUSHED.

    The only behavior change clears the existing typed inline teardown value after successful teardown. A throwing teardown keeps retry state. Staged callbacks still replay on Enable. A second Runtime edit corrects #652's stale reserved-field XML comment. All other 80 Runtime C# files are byte-identical to the parent. No field, handle layout, equality/hash, API, dependency, observer, clock or dispatch change. Clearing the existing struct adds teardown writes; native cost is unmeasured.

    Evidence at .artifacts/perf-lab/502-disabled-token-retention-s472/REPORT.md:

    • Actual unchanged public Fbdd and Release recycled context maps from consumed registration handles #652-fixed bfb each 2 FAIL / 4 PASS, exact vectors. Both public failures reproduce 50/50 fresh processes each: 100 expected failures, 0 unexpected. All input hashes remain exact.
    • Old bus stays strongly reachable in every mode. Exact map reuse, clear-token and force-flush controls isolate the consumed typed-state root. Foreign receiver owns its token. No historical perf: reduce subscription churn and retained registration storage #502/Investigate native multi-priority dispatch allocation failure #640 attribution.
    • Identical final shared 96 cases: unchanged-bfb RED 32 FAIL / 64 PASS / 0 SKIP -> candidate 96 PASS. Targeted/broadcast, old/new handler/post routes, same/different types, old Action/Fast callbacks and three collection controls. Retained disabled staging re-enables, invokes its original callback exactly once, disables again and cleans up.
    • Ten fresh focused processes: 960 PASS, exact 96 IDs each.
    • Full portable: 5636 PASS / 0 FAIL / 0 SKIP, exactly all prior 5540 outcomes plus 96 additions. Every prior custom-bus failure/retry/reentrancy outcome is preserved. Docs: 699 PASS, exact prior outcomes.
    • Sixteen copied Unity6000.4.6f1 C#9 semantic compilations PASS/current 378 source occurrences. NOT native execution.
    • Separately prefrozen counterfault removes only the state-clear assignment: exact same 32 failing / 64 passing identities. Candidate and counterfault 241 owned + 2 external analyzer hashes exact after execution; candidate exact after normal commit.
    • Relevant formatting/spelling/both actual Markdown linters/meta/validate:all/CRLF/ASCII/diff/hooks PASS. Unchanged JS/generator suites not rerun. Exact unchanged public harness: all 6 candidate cases PASS; all 4 old passing vectors exact.
    • No test case, predicate, expectation, collection round, timeout or budget changed. No adverse setup/compiler correction was needed in this experiment; Release recycled context maps from consumed registration handles #652's separate adverse history remains retained.

    46-file human packet: .artifacts/perf-lab/session472-disabled-token-retention-review/REVIEW.md. Complete public-Fbdd patch SHA256 0ca9278f811c2037044a4065e690c836bfbde5e715bfe758af3ca22ec322ed1d; separate-index replay restores exact f35f tree. Nine correctness corrections plus existing docs/ownership tests, excluding separate research c72.

    Native PREPARATION ONLY: 168 changed paths / 800 original / 876 candidate / 246 payload blobs, 16 current semantic-source receipts. Manifest SHA256 2dc37560cba9f64be1f58851ecce78a3ea9853d0edc72d198c232e034db73917. All originals match earlier held preparation, all blobs verify. No host operation or install script generated/run. Fresh supported probe still JSONRPC -32002/no Unity tools. Fresh scene/framework/SDK/module/source/675-pin admission and exact byte/timestamp restoration precede native use.

    Native correctness/allocation/reclamation, supported Unity/IL2CPP, teardown cost and human code/copy review remain OPEN. PR619 stays public Fbdd/open/draft/unmerged with four COMMENTED reviews and none APPROVED. Publication question unanswered. No native owned job, push/new PR/merge/approval/adoption/closure. Main index empty, all ten inherited dirty hashes exact. GOAL remains active.

  4. wallstop commented on Oct 26, 2026

    @wallstop
    CollaboratorAuthor

    Explicit native MemoryReclaim qualification is RED at PR619 ba7a249 (production unchanged by later683 correction). UnityBenchmarks40381878662, Unity2021 PlayMode coverage job121780065687:28053cases,27726PASS/326FAIL/1existing skip,196.09seconds. This is completed NUnit failure, not a watchdog/missing-results failure. The separate cardinality partition passes54/54 in273.37seconds.

    DisabledTokenRetentionTests: 96 failures in the retained full-scope inventory. All96 disabled-token rows report the unrelated bus/handler/token/receiver alive. Preserve mode/isolation controls and find the actual native retention path before modifying teardown.

    Full raw ZIP/XML/everylog/category and failure inventory are retained under session479/681-partition/native/2021.3.45f1/playmode-coverage. Artifact12683735222 SHA2564cc19c602950ad969e947af1f38c5d01e93c2369876ad80c15c4c7d5a2bb3ddf, exact ba7a249 head; job log retained. All return/classification/lock-release/confirmed-cleanup steps must be verified before follow-up. Other supported partitions continue unchanged; no cancellation/retry, fixture skip, budget change or root attribution is admitted. Earlier portable passes do not establish native collection. PR619 remains draft; this outstanding acceptance gate is not closed.

  5. wallstop commented on Oct 27, 2026

    @wallstop
    CollaboratorAuthor

    Additional unchanged-source native observation from the separately admitted allocation-capability run40482078771 at a314362a (parent4fe): both DisabledTokenRetention_Broadcast_OldPostTrue_NewPostTrue_SameTypeTrue_FastTrue_Mode1 and ...Mode2 change from parent PASS to FAIL. The complete original523 AOT inventory remains exact; all prior AOT failures remain, making9 original failures plus the new capability PASS. These cases execute before the new allocation observer is installed (new case is last); no Runtime or original test assertion/window changed. This does not attribute the cause to the observer or identify a native root. Full outcomes/controls retained in .artifacts/session481/native-allocation-capability/old-case-reconciliation.json, qualified parent/candidate binaries/PDB and final receipt 4ee3a26bcd876d809f4c8e9dd8da7336d1f51f4a379ea6f096edd57d19965555. Keep653/native reclamation and release readiness open; no rerun or fix is inferred from outcome exchanges.

  6. wallstop commented on Oct 27, 2026

    @wallstop
    CollaboratorAuthor

    Further unchanged-source observation from the separately admitted one-shot dispatch-allocation screen 40494108954, head b87dc105… (parenta314). AOT now retains all three DisabledTokenRetention_Broadcast_OldPostTrue_NewPostTrue_SameTypeTrue_FastTrue_Mode{0,1,2} failures. Mode0 is an additional failure relative to a314; modes1/2 were already observed there. Each reports the unrelated bus/handler/token/receiver alive [True,True,True,True]. All other previous AOT failures remain; original523 inventory is exact,10 old failures plus the separate last observer PASS (AOT514P/10F overall).

    All old cases finish before observer installation; no Runtime/original-test/cap/GC changes. No cause or fix is assigned to the observer. All3 archives/19 members and actual native DLL/PDB identities are qualified, and all cleanup steps pass. Reconciliation plus exact failure messages retained under .artifacts/session481/native-dispatch-allocation/; final receipt SHA256 03b635e37dac6080dcad3e262acc72e760b4b81c6b4d6f9ace4b2b0f97ef7d35. The allocation screen's ten zero-event windows do not establish collection or resolve this issue. One-run stop reached; no retry.

  7. wallstop commented on Nov 8, 2026

    @wallstop
    CollaboratorAuthor

    Current-source native qualification protocol, following the maintainer's request to broaden this session: assess the existing MemoryReclaim contracts on the live Unity 6000.4.6f1 ARM64 Mono editor against the merged runtime plus current worktree input manifest. Preserve all historical failures, frozen-study verdicts, test assertions, controls and collection windows. This is fresh current-source qualification, not an identical restart of an old stopped experiment or attribution of its cause. Run the existing Runtime MemoryReclaim category once, retain every leaf/output and framework cleanup evidence, then stop and classify failures before choosing a new mechanism. GREEN requires all selected contracts plus cleanup; a pass qualifies only this source/backend. Evidence: ignored .artifacts/s497-native/source-inputs.json and .artifacts/unity-mcp/s497-reclamation.json with runner GUID/status/cleanup sidecars. No historical cause or native-cost conclusion is inferred from a pass.

  8. wallstop commented on Nov 8, 2026

    @wallstop
    CollaboratorAuthor

    The fresh declared current-source local screen completed with all 96 disabled-token cases PASS, within 6,892 total reclamation passes and no failures/skips. Exact host, source/binary hashes, GUID, complete cleanup qualification, retained local raw and limits: #650 (comment) . This Unity 6000.4.6 ARM64 Mono result does not explain historical Windows/IL2CPP observations or qualify their native cost. Original assertions/windows and stopped-study verdicts remain unchanged; no identical retry or closure follows.

  9. wallstop commented on Nov 23, 2026

    @wallstop
    CollaboratorAuthor

    Prospective archived SGen contrast for the unresolved disabled-token lifetime evidence. Use bfb5da06 before the inline-teardown correction, 01f8dd5b after it, and release draft #821 20ca2b37. Preserve the 96 cases, collection rounds, old token and bus liveness, map identity, real callback, staged replay and cleanup. Apply the already qualified #652 diagnostic delta by running only the foreign-graph factory on a worker that has joined before the original collection. Three fresh processes per arm should yield exactly 32 original retained-token lifetimes failing and 64 controls passing before the fix, and 96 passes after it and on the draft. Stop on other failures, incomplete inventory, or changed predicates. Preserve a same-thread comparator on one full matrix per arm. Prior collector controls

    If the contrast qualifies, capture one historically affected Broadcast post/post same-type fast case per mode in both historical arms with the existing SGen profiler. Compare it with the unprofiled case, and test for a path from the fixture-kept token root through the consumed inline state to the unrelated receiver only in old mode 0. Expect no historical Windows Mono or IL2CPP cause claim from this archived Linux --interp study. Evidence in .artifacts/session-goal-sgen-disabled-token/.

  10. wallstop commented on Nov 23, 2026

    @wallstop
    CollaboratorAuthor

    The declared archived SGen contrast matched all 864 joined-worker case outcomes across nine fresh processes. Each historical bfb5da06 run had exactly 32 original retained-token failures with [True, True, True, True] and 64 passing cleared-token/isolation controls. Each 01f8dd5b and draft #821 20ca2b37 run passed all 96 cases. Every passing run preserved the map identity, callback, staged replay and cleanup checks. The three original same-thread comparators each reached the lifetime assertion and failed all 96 cases, on both old arms and the draft. The diagnostic delta was confined to starting and joining a worker around the existing foreign-graph factory.

    For the Broadcast post/post same-type fast cell, all six profiled and all six paired unprofiled same-thread runs preserved the original weak flags. Only historical mode 0 showed the concrete managed path from the fixture-kept TokenRoot through the token's registration slot and BroadcastRegistration<T>, the reused dictionaries and handler action cache, to the unrelated receiver. Clearing the token, preventing reuse, or clearing the inline teardown state removes that path. No root delivered by the callback reached any sampled receiver, so the remaining same-thread survival has no identified root. The archived interpreter result leaves historical Windows Mono/IL2CPP attribution and native teardown cost open.

    Raw XML, heap records, compiler and build outputs, fixture diffs, assembly identities and qualification are retained in .artifacts/session-goal-sgen-disabled-token/. qualification.json SHA-256 c0c5e3a5eb94ccec61483451010e73658159c725c7ae0d989e5583e3e676c1a0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions