Skip to content

Harden deregistration attribution evidence - #422

Merged
Eli Pinkerton (wallstop) merged 8 commits into
masterfrom
perf/session-218-deregistration-evidence
Aug 15, 2026
Merged

Harden deregistration attribution evidence#422
Eli Pinkerton (wallstop) merged 8 commits into
masterfrom
perf/session-218-deregistration-evidence

Conversation

@wallstop

@wallstop Eli Pinkerton (wallstop) commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a handler/bus/bus/handler deregistration palindrome with symmetric 3% interpretability gates
  • preserve round-trip raw values and explicit gate decisions in one structured diagnostic record
  • capture the exact IL2CPP deregistration call chain, including inline/shared/specialized bodies and hypothesis-negative evidence
  • document why independent minimized windows are diagnostic prerequisites, not acceptance evidence

Why

Session 217 rejected the typed-cache deregistration specialization after byte-identical repeats reduced its apparent handler-layer improvement to 1.99%. Its broad generated-C++ capture also did not prove the exact typed call shape.

This PR deliberately leaves production deregistration unchanged. It hardens the evidence needed to decide whether a future exact-MessageBus specialization has a real interface-dispatch mechanism before another licensed A/B bracket.

Evidence contract

The new palindrome runs four independent existing benchmark windows in handler A, bus A, bus B, handler B order. It rejects non-finite or non-positive raw values/excesses, is arm-swap invariant, treats exact 3% boundaries as inclusive, and records diagnosticOnly=true acceptanceEvidence=false candidateCompared=false.

The Performance Numbers workflow structurally extracts complete generated method bodies, ignores forward declarations, follows concrete wrappers to shared bodies, accepts specialized bodies, rejects prefix collisions, and records interface/direct/unrecognized dispatch evidence before any hypothesis verdict. An embedded StrictMode self-test covers the extractor's zero/one/many and body-boundary behavior.

Validation

  • Unity focused contract fixture: 40 passed, 0 failed, 0 skipped
  • two live palindrome runs were interpretable
  • npm test: 421 passed
  • npm run validate:all
  • Prettier, markdownlint, cspell, CSharpier, actionlint, and git diff --check
  • final Unity editor state: main stage, clean scenes, no prefab stage, idle

Advances #414.

Exact-head verdict

  • Performance Numbers run 31900934703 passed at 8678a2ca.
  • Artifact perf-6000.5.2f1-standalone-internal (9251194997) records one typed interface-dispatch evidence line, zero direct-bus lines, and typedBusDispatchRecognized=true.
  • The exact typed wrapper appears byte-identically at three generated locations and delegates to one shared body containing GenericInterfaceActionInvoker1 on the stored message bus.
  • The final palindrome failed handler drift (10.38%), bus drift (5.37%), and handler-excess spread (14.66%) against the inclusive 3% gates, so interpretable=false.
  • Static, devcontainer, performance, and all four Unity-version all-mode legs passed.
  • The final Cursor review finding was fixed with independent case-distinct and Unicode-distinct body fixtures; its thread is resolved, and the adversarial re-audit found zero material or minor issues.

The interface-dispatch mechanism is proven, but repeated stable attribution is not. This PR therefore retains the diagnostic/evidence prerequisites and leaves the production exact-MessageBus specialization deferred.


Note

Low Risk
Changes are confined to perf benchmarks, contract tests, CI evidence scripts, and documentation; production deregistration/runtime code is untouched.

Overview
Hardens deregistration attribution evidence without changing production messaging behavior. The PR adds diagnostic-only benchmarking and CI codegen capture so future specialization decisions rest on exact IL2CPP call chains and noise-gated timing, not broad string matches.

A new deregistration palindrome runs direct handler → direct bus → direct bus → direct handler after the published attribution rows. AnalyzePalindrome and DeregistrationAttributionPalindromeDiagnostic apply symmetric 3% gates on same-path drift and handler-minus-bus excess spread, emit DXM_DEREGISTRATION_ATTRIBUTION_PALINDROME, and always record diagnosticOnly=true, acceptanceEvidence=false, and candidateCompared=false so interpretable=true is only a prerequisite, not proof of improvement. Contract tests cover boundary classifications, arm-swap invariance, and log shape; benchmark order shifts the new diagnostic to 3 and the dispatch twin to 4.

The Performance Numbers standalone step replaces bounded Select-String markers with Get-GeneratedMethodDefinition (brace-balanced full bodies, ordinal dedupe, embedded self-tests), then walks DeregistrationAttributionState.Execute → typed TypedHandlerDeregistrationState.Deregister (including shared/_gshared bodies) → MessageBus_Deregister, recording interface vs direct dispatch counts in typed-deregistration-codegen.txt. The perf methodology doc and unity-perf.test.js workflow assertion are updated to match.

Reviewed by Cursor Bugbot for commit 8678a2c. Bugbot is set up for automated code reviews on this repo. Configure here.

@wallstop
Eli Pinkerton (wallstop) marked this pull request as ready for review August 15, 2026 17:00
Copilot AI lite review requested due to automatic review settings August 15, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Performance Numbers

Measured commit: 8678a2c
Trusted reporting code (PR base): 3a5fa60
Workflow run: 31900934703 attempt 1

Benchmark or harness paths changed, so historical deltas are non-comparable:

  • Tests/Runtime/Benchmarks/DispatchThroughputBenchmarks.cs
  • Tests/Runtime/Benchmarks/RegistrationLifecycleBenchmarkContractTests.cs
  • Tests/Runtime/Benchmarks/RegistrationLifecycleBenchmarks.cs

Historical Standalone delta

Delta direction: + is better; - is worse.

Historical delta omitted because benchmark or harness code changed in this pull request.

Current TargetMap evidence

These raw rows are current-run diagnostics. Use fresh bracketed controls before accepting a micro-optimization.

[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_16_Churn keyCount=16 operation=Churn totalOperations=1940000 operationsPerSecond=387978.405 wallClockMs=5000.278 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=16 targetMapCapacity=32 observedInvocations=1960000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_16_Hit keyCount=16 operation=Hit totalOperations=54000000 operationsPerSecond=10799537.348 wallClockMs=5000.214 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=16 targetMapCapacity=32 observedInvocations=54020000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_16_Miss keyCount=16 operation=Miss totalOperations=61640000 operationsPerSecond=12327326.928 wallClockMs=5000.273 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=16 targetMapCapacity=32 observedInvocations=0
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_1_Churn keyCount=1 operation=Churn totalOperations=2140000 operationsPerSecond=427881.083 wallClockMs=5001.390 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=1 targetMapCapacity=4 observedInvocations=2160000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_1_Hit keyCount=1 operation=Hit totalOperations=54170000 operationsPerSecond=10833621.040 wallClockMs=5000.175 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=1 targetMapCapacity=4 observedInvocations=54190000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_1_Miss keyCount=1 operation=Miss totalOperations=59970000 operationsPerSecond=11992947.499 wallClockMs=5000.439 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=1 targetMapCapacity=4 observedInvocations=0
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_256_Churn keyCount=256 operation=Churn totalOperations=1830000 operationsPerSecond=364401.952 wallClockMs=5021.927 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=256 targetMapCapacity=512 observedInvocations=1850000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_256_Hit keyCount=256 operation=Hit totalOperations=42840000 operationsPerSecond=8563891.559 wallClockMs=5002.399 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=256 targetMapCapacity=512 observedInvocations=42860000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_256_Miss keyCount=256 operation=Miss totalOperations=56620000 operationsPerSecond=11323204.205 wallClockMs=5000.351 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=256 targetMapCapacity=512 observedInvocations=0
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4096_Churn keyCount=4096 operation=Churn totalOperations=1390000 operationsPerSecond=276033.356 wallClockMs=5035.623 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4096 targetMapCapacity=8192 observedInvocations=1410000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4096_Hit keyCount=4096 operation=Hit totalOperations=39370000 operationsPerSecond=7871769.298 wallClockMs=5001.417 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4096 targetMapCapacity=8192 observedInvocations=39390000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4096_Miss keyCount=4096 operation=Miss totalOperations=59020000 operationsPerSecond=11802535.777 wallClockMs=5000.620 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4096 targetMapCapacity=8192 observedInvocations=0
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4_Churn keyCount=4 operation=Churn totalOperations=2150000 operationsPerSecond=428300.231 wallClockMs=5019.843 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4 targetMapCapacity=8 observedInvocations=2170000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4_Hit keyCount=4 operation=Hit totalOperations=50440000 operationsPerSecond=10087909.814 wallClockMs=5000.045 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4 targetMapCapacity=8 observedInvocations=50460000
[Standalone] DXM_TARGET_MAP_BENCHMARK scenario=TargetMap_4_Miss keyCount=4 operation=Miss totalOperations=57510000 operationsPerSecond=11500129.389 wallClockMs=5000.813 gcAllocations=-1 gcAllocatedBytes=-1 targetMapEntries=4 targetMapCapacity=8 observedInvocations=0
[Standalone] DXM_TARGET_MAP_CONSTRUCTION keyCount=1 wallClockMs=0.000100 operationsPerSecond=10000000.000 gcAllocations=-1 gcAllocatedBytes=-1 targetMapCapacity=4
[Standalone] DXM_TARGET_MAP_CONSTRUCTION keyCount=16 wallClockMs=0.000603 operationsPerSecond=1658031.088 gcAllocations=-1 gcAllocatedBytes=-1 targetMapCapacity=32
[Standalone] DXM_TARGET_MAP_CONSTRUCTION keyCount=256 wallClockMs=0.007750 operationsPerSecond=129032.258 gcAllocations=-1 gcAllocatedBytes=-1 targetMapCapacity=512
[Standalone] DXM_TARGET_MAP_CONSTRUCTION keyCount=4 wallClockMs=0.000214 operationsPerSecond=4664179.104 gcAllocations=-1 gcAllocatedBytes=-1 targetMapCapacity=8
[Standalone] DXM_TARGET_MAP_CONSTRUCTION keyCount=4096 wallClockMs=0.125400 operationsPerSecond=7974.482 gcAllocations=-1 gcAllocatedBytes=-1 targetMapCapacity=8192

Copilot AI review requested due to automatic review settings August 15, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 15, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f40358b. Configure here.

Comment thread .github/workflows/perf-numbers.yml
Copilot AI review requested due to automatic review settings August 15, 2026 18:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wallstop
Eli Pinkerton (wallstop) merged commit d82e5cc into master Aug 15, 2026
46 of 47 checks passed
@wallstop
Eli Pinkerton (wallstop) deleted the perf/session-218-deregistration-evidence branch August 15, 2026 19:22
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.

2 participants