RuntimeSingleton safety, WProto shapes, IntMap, JSON allocs - #581
Conversation
Emit SHA-256 return-log digests from both evidence producers in the return-unity-license composite and pass them to both classifier call sites, then move every build-lock pin to v1.13.0 together. Closes #498.
Both oracle majors write a char as a plain varint and a Uri as the OriginalString bytes, so both now serialize without a surrogate. The remaining standard-library shapes stay refused on recorded evidence. Closes part of #399.
Array growth rents pooled buffers instead of leaving a discarded List backing array behind at each doubling, and collection property names compare against the raw token without allocating. Closes #504.
Linear probing with raw-int comparison and a power-of-two table beats Dictionary on hit-heavy lookups, measured under the settled-heap protocol. Closes #578.
The folk advice costs eleven percent on Unity's Mono, where a specialized enum comparer already ships. Closes #577.
|
Heads-up for triage: the Copilot Code Review run fails with |
Clear now restores empty markers instead of zeroing keys into live slots; the array accumulator copies before the pooled buffer goes back; char closes through the runtime scalar registry with oracle- pinned goldens; a huge capacity hint throws instead of spinning. IntMap is an IReadOnlyDictionary and Reset honors the version guard. The cleanup classifier pins return to the tolerant commit until the truncation strictness in #356 has an upstream answer.
|
All four Bugbot findings are fixed, and the red Unity legs were a separate root cause, now addressed: Bugbot fixes (commit 99c1a3c):
Owner feedback:
Why every Unity leg failed while tests mostly passed: the pin bump onto the v1.13.0 cleanup classifier activated #356's known strictness — Unity 2021–2022 legs crash after writing valid results, truncating the return log, and the newer classifier refuses that evidence ( |
char opts out of packed runs through a package-internal marker the runtime packability check honors, and the Keys and Values views return struct enumerators that fail fast on version changes -- typed foreach over either view allocates nothing, verified to zero bytes.
|
Second Bugbot round addressed (commit d29b9ce):
Both fixes are regression-tested in |
The licensed matrix is being refused at the license-return layer by runner capacity quarantine, not by anything this branch encodes, so the pins go back to main exactly. Issue #584 carries the evidence.
Reset RuntimeSingleton caches before scene load without invoking the destructive cleanup sweep. Keep explicit registry teardown intact for test isolation and cover authored NeverCreate state recovery in Play Mode.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c0239f7. Configure here.
|
Correction to the earlier Unity-failure attribution: failed-job rerun 33050443415 disproved the claim that every remaining red leg was cleanup-only. The pre-Unity-6 standalone players deterministically crashed in |

Why: A pass over the open-issue backlog: preserve scene-authored runtime singleton state, finish the measured WallstopProto standard-library sweep, add the int-keyed map the benchmarks asked for, and fix the named JSON allocation class.
What:
RuntimeSingletoncaches before scene load without destroying live scene-authored components; retain explicit destructive teardown for test isolation (fixes RuntimeSingleton: entering Play Mode destroys scene-authored instances #582)charandUriin WallstopProto against both protobuf-net oracles; refuseIntPtr/UIntPtr/Typewith recorded reasons (finishes the WallstopProto: Arbitrary-Dimension Arrays, Jagged Arrays, all stdlib types, all wallstop + Ambiguous-Interactive Types #399 stdlib-shape sweep)IntMap<TValue>, an int-keyed open-addressing map with raw-int comparison, oracle-tested (part of [Feature]: an int-keyed open-addressing map, measured at 1.26x-2.19x over Dictionary #578)Fixes #504, fixes #577, fixes #582
Note
Medium Risk
Play-mode singleton behavior and JSON/protobuf deserialization paths change in production-facing code; CI cache invalidation logic affects build reliability but not game runtime.
Overview
This PR bundles backlog fixes across singleton lifecycle, protobuf BCL types, JSON deserialization, a new int map, and Unity CI warm-cache rules.
Runtime singletons no longer destroy scene-authored
RuntimeSingletoncomponents when entering Play Mode:BeforeSceneLoadonly resets static caches viaResetAllRegisteredCaches, whileClearInstance/ClearAllRegisteredInstancesstill tear down live objects for tests.WallstopProto adds
char(varint code unit, repeated elements never packed) andUri(UTF-8 ofOriginalString, strict decode). GeneratorShapegainsNeverPacked; runtime mirrors that withIWProtoNeverPacked.IntPtr,UIntPtr, andTypestay WPROTO003 refusals with documented reasons. Differential tests and docs are updated.JSON array reads use
JsonArrayAccumulator<T>with pooled growth so steady state avoids list backing-array churn plusToArray; dictionary/set converters match property names withValueTextEqualsinstead of allocating strings.IntMap<TValue>is a new open-addressing int-key map (raw int keys, power-of-two table, tombstones) aimed at hit-heavy lookups vsDictionary<int,int>.Unity CI invalidates Bee/ScriptAssemblies caches when the repo root or package source path inventory changes (content-only edits keep the warm cache); the source inventory marker is written only after passing NUnit results.
Reviewed by Cursor Bugbot for commit 40379b4. Bugbot is set up for automated code reviews on this repo. Configure here.