Repository navigation
Description
DISCLOSURE: LLM-GENERATED TEXT
Follow-up to #926. 3.7.0 fixed both of #926's defects; thank you. DoxReloaded re-measured 3.7.1 (Ambiguous-Interactive/DoxReloaded#973): hits and misses now beat Dictionary<int, TValue> for every key shape, and churn stays at 64 slots. Iteration is the one cost left, and 3.7.0 made it worse at 64 keys or more.
Measurement
Same sources built for .NET 10.0.403 (PGO on) and net48 on Mono 6.14.1. Arms: Dictionary<int, int>, IntMap<int> 3.6.2 and 3.7.1. Three processes per runtime, 21 alternating rounds each after one warm-up. Keys are dense 0..n-1, sparse (seeded Random.Next()), or i * 1024. The table shows the median of the process medians; the minima agree.
foreach over the map, ns per element:
| keys | n | .NET 10: Dictionary · 3.6.2 · 3.7.1 | Mono: Dictionary · 3.6.2 · 3.7.1 |
|---|---|---|---|
| dense | 8 | 0.53 · 2.98 · 2.46 | 3.84 · 14.09 · 13.78 |
| dense | 1,024 | 0.49 · 0.78 · 1.41 | 2.52 · 4.21 · 8.07 |
| sparse | 1,024 | 0.51 · 0.80 · 1.33 | 2.44 · 6.24 · 11.12 |
i * 1024 |
1,024 | 0.49 · 0.69 · 1.57 | 2.46 · 4.69 · 7.29 |
Across 3 key shapes × sizes 8, 64 and 1,024, 3.7.1 takes 2.5–7.4× Dictionary's time on .NET 10 and 2.6–4.6× on Mono.
Cause
Enumerator.MoveNext (and the key and value enumerators) walk every slot of _keys and test each against MinimumAllowedKey. LoadFactorDivisor = 4 keeps at least four slots per live entry, so one pass reads at least 4× Count slots. 3.6.2 ran a higher load, so it walked fewer.
Ask
Make iteration O(Count), not O(Capacity), without slowing lookups. Options, cheapest first:
- Stop once
Countentries have been yielded. This skips the empty tail; it is not enough alone. - Keep the entries packed: dense
int[] _entryKeysandTValue[] _entryValuesof lengthCount, and store an entry index in the hash slot. Removal moves the last entry into the hole, asSparseSetdoes. Iteration then reads only live entries. Iteration order changes, butIntMappromises no order. - Keep slots as they are, with an occupancy bitmap; skip 64 empty slots per
ulongwithBitOps' trailing-zero count.
Acceptance
- On the harness above,
foreachtakes at most 1.5×Dictionary's time at n = 64 and 1,024 on .NET 10 and Mono. - Hit, miss and insert costs stay within 10 % of 3.7.1's.
- Enumeration during mutation still throws, and
Removeduring the churn case keeps capacity bounded. - The perf doc gives iteration numbers next to the lookup numbers.
The harness is a single Program.cs plus both IntMap.cs versions; DoxReloaded can attach it if useful.
Activity
wallstop commentedon Nov 6, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1139 implements O(Count) pair/key/value iteration with dense occupied-slot indices. It preserves raw-key lookup arrays, mutation failures, and bounded removal churn.
Independent comparison with the exact 3.7.1 source, using 64 and 1,024 entries and dense, seeded sparse, and shared-low-bit keys:
Each runtime used three completed processes, 64 warm-up passes across all cells, calibrated intervals of at least 25 ms, and 21 rotating-order rounds. These are ratios of median process medians. Windows hosted .NET; Linux hosted Mono. No cross-runtime speed claim.
All 3,780 raw samples, exact input hashes, and the replay program are retained. The guide states the memory and construction tradeoffs.
Keep this issue open. Mono's 1,024-entry low-bit miss case is about 12% slower. Fresh construction/fill at 1,024 entries is 24–31% slower. The original consumer Program.cs was not available, so this is an independent harness, not qualification against that exact harness. Large-table cache behavior and other value sizes also remain unqualified.
Correctness evidence: an independent oracle passed 8M operations and 7,876 snapshots; four fixed-window churn controls allocated zero measured bytes and retained bounded capacity. Native Unity tests passed width-transition, zero-key, mutation, removal/refill, and profiler-allocation controls. The runtime fixture run had 235 cases: 220 passed, zero failed, and 15 byte-counter tests skipped because their positive control was inert. The separate profiler allocation witness passed.
Rejected layouts and the final local-mask experiment are retained locally as negative results. The mask experiment regressed .NET hit costs, so it is excluded from the PR and accepted measurements.
wallstop commentedon Nov 6, 2026
DISCLOSURE: LLM-GENERATED TEXT
Additional remaining qualification from PR #1139 review: allocation-failure recovery.
Rebuild, lines 483–504 publishes replacement key/value arrays before allocating the index storage. If a later allocation throws and a caller catches it and reuses the instance, the old count and lookup metadata can disagree with storage. Non-atomic replacement already existed in 3.7.1; the added index allocation creates another failure point. This is source-based analysis, not a reproduced forced-OOM result. No caller recovery guarantee or affected consumer was established. An instance should be discarded after failed construction/growth until recovery is qualified.
Fix shape: allocate all replacement storage into locals before publishing any fields, then complete reinsertion without further allocations. Preserve the original instance when allocation fails. Do not add production test hooks.
Acceptance for that hardening:
This remains part of the open IntMap qualification work rather than a recovery guarantee claimed by #1139. The current PR's runtime is unchanged by its CI-only profiler-test guard.
Speed up integer map iteration (#1139)
wallstop commentedon Nov 7, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1140 completes the allocation-failure hardening requested above. All replacement arrays are allocated before publishing fields; reinsertion allocates no further storage. The bounded child-process regressions force real growth OOMs for zero/nonzero insertion with 64-byte values and for index storage with byte values. Positive allocation controls, capacity/count, every original lookup, pair/key/value views, existing iterator validity, replacement, removal and subsequent insertion are checked. The original implementation reproduced corruption; the candidate passes. Host suite: 98/98. Native Unity correctness and profiler controls also pass; 15 separate inert-byte-counter cases remain explicit skips.
The new durable capture retains six healthy processes, 3,780 raw rounds, replay code and source/runtime identities. Its canonical LF digest matches the committed IntMap source. These are independent int-valued workloads at 64/1,024 entries, not the unavailable original consumer harness.
Keep this issue open: Mono's shared-low-bit miss is 10.3% above baseline and fresh 1,024-entry construction is 24–29% slower. Original-harness, larger-value/table and backend qualification remain outstanding. The earlier capture remains unchanged.
Preserve integer maps after failed growth (#1140)
wallstop commentedon Nov 7, 2026
DISCLOSURE: LLM-GENERATED TEXT
Two lookup experiments were rejected in this session; production
IntMapremains unchanged.The first removed empty/reserved-key guards and handled key zero at the empty-slot exit. Although some lookups improved, zero-key lookup could then traverse a collision chain instead of retaining its direct path. That correctness/performance tradeoff is unsuitable.
The second retained the direct zero-key path and removed only the reserved/empty guards. Three healthy .NET 10.0.14 x64 processes measured current main (
6ac0438b) against the experimental copy andDictionary<int,int>. Median candidate/baseline ratios regressed by 23.84% for 64-entry low-bit hits, 22.41% for 1,024-entry sparse hits, and 16.80% for 64-entry dense misses. These exceed the 10% margin. No production optimization was accepted. The first experiment also has one healthy Mono 6.14.1 host process; that single process is not Unity-native qualification or a complete backend campaign.Replay sources, build logs, process identities and raw per-process rows are retained under
progress/.artifacts/session-20261107-evening/(experiment-*,zero-experiment-*). These are int-valued lookup experiments against current main, not a full 3.7.1 comparison or the original consumer workload. Construction, large value types, supported backend qualification and the unavailable original consumer harness remain open.wallstop commentedon Nov 8, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1145, head
7acbfe35, adds reference-value regressions across moved dense indices and subsequent growth at 64 and 16,384 entries. Every lookup and pair/key/value view is checked. Final source-linked host suite: 100/100, including bounded allocation-failure controls. Focused native runtime cohort: 102 passed and 15 allocation-counter capability skips. Production IntMap is unchanged from current main.Two performance candidates were rejected:
i * 1024hit cost rose to 1.193x and 1.588x current main respectively. This candidate stayed in ignored probes and was rejected. The smaller table increases mean probe count for that panel from 1.0 to about 1.714; no size-specific workaround was retained.Raw rounds, replay sources and source/runtime hashes are retained in
progress/.artifacts/session-20261108/(growth-*,compact-*,intmap-growth/,intmap-compact/). Compact candidate source SHA256:54652610ed5db35f50de367b8fae182654d5c443a1136ec9a9107f83dd955503. Mono executable/runtime inputs were stable across captures and return codes checked. The Windows .NET controller checked child return codes, but independent final process receipts were not sealed; treat these as rejection evidence, not acceptance captures.These comparisons use current main, not the original consumer Program.cs and 3.7.1 oracle. They do not satisfy the requested iteration/lookup thresholds. The original harness is still needed for final qualification, and the previously recorded miss/construction margins remain unresolved. Keep this issue open.
Improve collection binding and authored asset checks
wallstop commentedon Nov 8, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1145 now includes e5ab70a: sparse Clear clears occupied key/value slots when Count is below Capacity / 64; denser maps keep bulk clearing. Zero-key, version and capacity behavior are preserved. New state-boundary and reference-release controls pass. The source-linked host suite passes 120/120; native IntMap passes 99 with 15 existing allocation-counter capability skips and zero failures.
Three-process paired Mono and Release IL2CPP measurements cover sparse, threshold and dense clears. Dense controls are within 2.6% of baseline in Mono and take 0.975–0.989 of baseline time in IL2CPP. Sparse clears improve substantially. The guide and raw evidence include the final samples and rejected-candidate scope.
The original consumer iteration harness and its ≤1.5× Dictionary and lookup/insert budgets remain unqualified. Clear gains do not satisfy those iteration criteria, so this issue stays open. New-head CI is running.
Fix extraction error paths and sample checks
Improve collection binding and asset validation (#1145)
wallstop commentedon Nov 9, 2026
DISCLOSURE: LLM-GENERATED TEXT
A cached-value-array enumerator candidate was rejected in this session. Production
IntMapremains unchanged fromef48a1a9.The candidate copies
map._valuesinto the pair/value enumerators and reads that pointer duringMoveNext. The measured workload covers int-valued pair iteration only. Three fresh, healthy Release .NET 9.0.10 x64 processes used 64 warm-up passes, intervals calibrated to at least 25 ms, 21 rotating arm-order rounds, and dense, seeded sparse, and shared-low-bit keys at 64, 1,024 and 16,384 entries. An independent Dictionary-derived sum is checked after every measured arm. Input and binary hashes remain identical before/after; all processes exit zero with both output streams captured.Candidate/current-main ratios, median of process medians and median of process minima:
The other cells also provide no useful saving. No production optimization was accepted. This is rejection evidence on .NET 9, not the requested original .NET 10/Mono 6.14.1 harness, a 3.7.1 comparison, or player qualification. The original harness and all existing acceptance margins remain open.
Replay sources, 567 raw round rows, summaries and process/source receipts are retained under
progress/.artifacts/session-20261109/intmap-enumerator/. Candidate source SHA256:4b6c5536647f262fdcbf10de96d771f2d65fc8acfeb3e3b9a90af1016e507800; program:25893b54d17c5c946d7a55ddb79b2bb1f9d008e2fd3fe19f41db704292664b36; compiled payload:8e519a58e946a8d7b7440019706fc23767581bf9aab59112ab81aaf2f144959f. Failed temporary compile preparations remain separate from the three successful captures.wallstop commentedon Nov 9, 2026
DISCLOSURE: LLM-GENERATED TEXT
Recovered the original
intmap-absource and six historical outputs from the sibling DoxReloaded devcontainer. PR #1151 preserves the source/result archive, 666 replay summaries and receipts, and guide.The replay changes only arm/method labels, substitutes original 3.7.1 for the old source with its namespace renamed, and uses current main unchanged. Original Program SHA256:
1cee6c46c3ba3e451b97447067beb5725d02302dc2a9b84998a9d9c7c54194eb; current IntMap:2dfa3cc0204bdc29f19fb4938a83a44d6e689b30342cc62010114ec333a5b3ae.Same one warm-up, 21 rotating rounds, dense/sparse/shared-low-bit keys, sizes 8/64/1024, hit/miss/insert/iterate and million-step churn. SDK 10.0.403 and Mono 6.14.1, Linux x64, default runtime settings. Three fresh processes each exit zero, reach both stream ends, retain unchanged inputs/payloads and produce all 111 distinct cells. All sinks equal
228327948816.Ratios of median process medians at 64 and 1,024 keys; lower is faster:
Iteration meets 1.5x in all those cells; process minima agree on that bound. Several lookup/insert cells exceed 10%. Confirmed adverse comparisons include .NET dense eight-key misses at 1.996x median/2.000x minimum and Mono 1,024 shared-low-bit inserts at 1.272x/1.241x. Current churn stays at 64 slots in every process.
Keep this issue open. No production IntMap change is included. The original harness retains only process minima/medians, has one warm-up and short intervals, and does not provide an independent correctness oracle. Historical original outputs lack parent exit/EOF receipts. This comparison does not qualify Unity/player performance or arbitrary value types.
Keep sprite curves within their sheet regions (#1151)
wallstop commentedon Nov 9, 2026
DISCLOSURE: LLM-GENERATED TEXT
#1153 retains a smaller insertion/rebuild change: combine the dense-slot and reverse-position writes. Raw keys, separate zero-key storage, lookup and iteration paths stay intact. Host correctness passes 126/126, including failed-allocation recovery; the native IntMap/attributes cohort has zero failures.
A paired integer-value host protocol compares main 99e54b1 and the candidate with 64 warm calls, >=20 ms batches, 21 rotating-order rounds, and three fresh processes per .NET 10/Mono runtime. Insert ratios versus main span 0.918-1.004 on .NET and 0.936-1.041 on Mono; repeated-zero controls remain near main. An earlier encoded-key experiment is rejected after two complete calibrated .NET processes expose lookup/iteration regressions and 1.47-1.81x repeated-zero costs. Its third process was deliberately stopped after rejection; partial rows are preserved and excluded.
The unchanged recovered consumer Program.cs is also replayed in six healthy processes against a baseline verified byte-for-byte against tag 3.7.1 after namespace/newline normalization. Its original labels are mapped explicitly: IntMap362 means the substituted 3.7.1 baseline and IntMap371 means current. A first 3.6.2 control is retained separately and is not used for acceptance.
At 64/1,024/16,384 keys, current/3.7.1 hit-miss-insert ranges are 0.987-1.093 / 1.031-1.314 / 1.014-1.195 on .NET and 0.999-1.256 / 1.018-1.169 / 1.044-1.219 on Mono. Iteration/Dictionary is 0.822-0.977 and 1.056-1.091. Iteration meets the target; lookup/insertion still fail the 10% budget in some cells. Keep this issue open.
Evidence, raw rounds, sources, receipts and rejected controls remain in ignored local storage. Accepted source SHA256: 5913fe429dc86bef53d200cbbb4d365d4c8ad424eeb336a7db66ae341bc2d819. Host observations do not establish native-player or arbitrary-value performance.
11 remaining items
Add sampling, test support and RGB24 region reads (#1192)
wallstop commentedon Nov 13, 2026
DISCLOSURE: LLM-GENERATED TEXT
Merged PR #1192 with the rejected inlining qualification and original-budget replay. The candidate is not shipped; IntMap implementation remains unchanged. The original-budget shortfall recorded above remains, so this issue stays open.
wallstop commentedon Nov 13, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1196 retains a rejected experiment and makes no production IntMap change. The candidate keeps the first TryGet probe inline and moves collision continuation into a non-inlined helper. Three fresh processes on each runtime produce all 195 cells with stable source/payload hashes, raw exit zero and both stream ends.
Candidate/current-main hit/miss geometric means are 1.2123 on .NET 10 and 0.8370 on Mono. Twenty-three .NET cells exceed 1.10. Dense eight-key misses have paired ratios 1.589, 1.582 and 1.565, so the .NET regression alone rejects the candidate. One Mono iteration aggregate also exceeds the limit, but its paired variation does not establish a repeatable iteration defect.
Analysis and complete raw replay. This compares with current main, not the original 3.7.1 acceptance baseline. The original consumer budgets remain unmet; keep #1131 open.
Add pools with explicit returns (#1196)
wallstop commentedon Nov 13, 2026
DISCLOSURE: LLM-GENERATED TEXT
PR #1201 preserves a new rejected experiment while leaving production IntMap unchanged. Removing the nonzero TryGet empty-count guard fails the preregistered two-process early-rejection rule: empty-map misses cost 1.4523× and 1.4891× main. Several 16,384-key hit cells also regress in both captures. Lookup geometric-mean ratios are 0.9697 and 0.9834, below the required 5% benefit.
Both fresh .NET 10 processes retain 198 calibrated cells, 21 rotated rounds, 64 full warmups, timed checksums and the dictionary oracle. Raw exits are zero, both stream ends arrive, and source/payload hashes stay stable. No Mono qualification is claimed. Every cell and observation is retained.
The original consumer lookup/insertion/iteration acceptance remains required and this issue stays open.
Speed shared buffer rentals (#1201)
wallstop commentedon Nov 14, 2026
DISCLOSURE: LLM-GENERATED TEXT
The dense-index rebuild experiment in PR #1202 is rejected; production IntMap is unchanged. Three fresh .NET 10 processes and three Mono processes each retained all 198 distinct cells, completed with raw zero, drained both streams and kept source/payload hashes stable.
Median paired insertion geometric ratios were 0.9878 (.NET) and 0.9923 (Mono), missing the 0.95 threshold. Mono's 16,384-entry shifted-key iteration cell regressed by 12.4%. The complete summaries, ratios, identities and rejected diff retain all controls. No owned build, test or timing capture overlapped these measurements.
This current-main comparison does not replace the original consumer baseline. The remaining lookup/insertion budgets are unresolved; keep this issue open.
Validate nested authored asset values (#1202)
wallstop commentedon Nov 14, 2026
DISCLOSURE: LLM-GENERATED TEXT
A new isolated key-array caching experiment misses its preregistered performance threshold, so production IntMap remains unchanged. Three fresh processes per runtime cover 198 cells each, with 21 rounds, Dictionary controls and checksums. Median paired insertion-cell geometric ratios are 0.99505 on .NET 10 and 0.99401 on Mono, above the required 0.95. No non-insertion median paired cell exceeds 1.10. All six processes return raw zero, reach both stream ends and preserve source/payload hashes.
The session PR will retain the full cell summary and qualification record, including the rejected diff. This experiment does not replace the original 3.7.1 consumer budgets or qualify other backends; this issue remains open.
wallstop commentedon Nov 14, 2026
DISCLOSURE: LLM-GENERATED TEXT
The previously reported rejected key-array caching experiment is now retained in PR #1205, with its complete qualification record and rejected diff. Production IntMap is unchanged. Neither the 0.95 experiment threshold nor the original consumer acceptance is satisfied, so this issue remains open.
wallstop commentedon Nov 17, 2026
DISCLOSURE: LLM-GENERATED TEXT
The nonzero guard-layout candidate is rejected. Production IntMap is unchanged.
The candidate keeps nonzero TryGet probing together and moves the direct zero-key fallback after it. It preserves the empty-count guard, hash/probe operations, values and all mutation/indexing code. Two serial fresh .NET10 processes each retain 198 distinct cells, 64 warm calls, >=20ms calibration, 21 rotating rounds, Dictionary controls and timed checksums. Both have raw zero, both stream ends and stable source/payload seals.
Hit/miss candidate/main geometric ratios are 1.00398 and 1.00491. Both trigger the preregistered early-rejection rule (>=1 in both); no further unchanged candidate runs were made. No non-insertion cell exceeds 1.10 in both processes. These small differences near 1 do not establish a causal slowdown. All 136 existing isolated host correctness/recovery cases pass for the candidate.
The qualification record retains every paired cell ratio, process receipts, source/payload hashes and the rejected diff. All source files, complete raw cell sets and 21-round stderr captures remain in ignored session storage. The copied test project's first framework override and the fresh SDK image's missing net48 reference setup are retained preparation failures. Explicit net10 correctness and timing builds pass; no Mono or Unity/player qualification is claimed.
This is a current-main comparison. It does not replace the recovered original consumer replay: its iteration target passes, but 13 of54 lookup/insertion cells still exceed the original budget. Keep #1131 open.
Retain rejected IntMap guard layout (#1233)
Document original IntMap consumer replay (#1260)
Document independent IntMap performance replays (#1263)
Record fresh IntMap consumer replays (#1269)