Expose coherent allocator accounting and correct quantized bias sums - #15
Merged
Conversation
Signed publication snapshot of validated source 560f57c. The committed tree is identical; original milestone history remains preserved locally.
This was referenced Sep 6, 2026
Append-only signed publication of reviewed source fab0f39f69140393b454c32d6f4bf7a9b32f9dcc. Preserves the existing publication parent and original milestone history. Implementation tree is identical to reviewed source.
Gajesh2007
marked this pull request as ready for review
September 6, 2026 20:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Admission accounting currently combines independent allocator counter reads and logical buffer sizes. Concurrent allocator activity can produce an incoherent snapshot, while alignment and cached-buffer reuse can make the real backing larger than the requested payload.
This change adds a coherent native memory snapshot, checked per-allocation footprint bounds, and a detached immutable sizing policy. Metal, CPU and CUDA expose the corresponding interfaces; the allocator's existing allocation/reuse behavior remains the authority. These APIs describe allocator accounting, not process RSS or a promise of immediately available physical memory.
The quantized-vector correction promotes every bias-sum operand to the accumulator type in
load_vectorandload_vector_safe. Its companion Swift update regenerates both embedded shader sources; replacing only the metallib is insufficient.Before
After
Reviewed source and signed publication
fab0f39f69140393b454c32d6f4bf7a9b32f9dcc.f8eec2476cdb5263fb6e2a19dd71f2c8b7c0a7d3onrelease/0.9.0-validation.Validation and its scope
560f57ccc1e42cb451651976363764a5033c8c95: four CPU and four Metal policy cases, 20,000 coherent snapshot transfers, and a negative control that reproduced inconsistent independent reads. The older combined 83-function/100-case lane and metallib47357f1b...remain baseline evidence, not a test of this corrected kernel.Frozen Gemma controls and their limits
53f3c3d0/ nativede30ef98/ Swiftc06149b4/ corefab0f39fruntime, cache-off B1 Gemma QAT4 is now exact across contiguous and paged backends in ordinary, automatic and serial-target modes. Serial-target also matches ordinary.Remaining gates — keep draft
release/0.9.0-validation. No production budget, equality criterion or tolerance is relaxed.Companion review stack
f8eec2476cdb5263fb6e2a19dd71f2c8b7c0a7d3fab0f39f69140393b454c32d6f4bf7a9b32f9dcc8bdeb0f3c5793c54139e86c5437b09abc9ab9b42d4328f2d8d54d711d5419e07ab9fa2f07b512a48c3ac44766c3e0be2066bbd87a3e26aaa6f410ab09561227d55a07db29f70a78aadc5d6b5aaeb10bf67ac8607b5846e8acfbbdd8f36c0d252d69d0d01ba5c03ea0ef495aca02c99c7a2dd2b7a32bc7668e1d68db84cb1a1e4a6dd10306383bd64bc5d6062d01b82078e157ae1e66511d2d8db1f2ecf95e857Evidence navigation
Reports retain their original source, artifact and result identities. Current links are pinned to this signed parent publication.