Repository navigation
Use physical engine token capacity for footprint measurements - #5218
Merged
Merged
Conversation
joelteply
force-pushed
the
codex/engine-context-geometry
branch
from
October 20, 2026 08:39
5b8e591 to
05c612a
Compare
Contributor
Author
|
Independent review found and blocked two defects in05c612 despite green CI. Corrected in3f0be60b8:
Independent helper delta source review APPROVE, contingent on execution/exact CI. Windows dev-fast footprint12/12 PASS0.02s, parser2/2 PASS0.00s, hygiene39/39 PASS5.09s. Receipts geometry-review-{footprint,parser,hygiene}.log and geometry-review-delta-verdict.txt in the handoff directory. Fresh committed-head CI pending; no deployment or speed/learning claim. Physical receipt consumption is currently the discrete-GPU EngineContext sampling branch; process-anonymous sampling retains its existing divided-cache contract. |
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.
A unified KV cache can give each sequence the full context limit while sharing one physical token allocation. Multiplying sequence count by that limit understates measured bytes per token. The discrete-GPU EngineContext sampling path now uses the engine's allocated_tokens receipt for the denominator and prediction, preserving sequence count and window separately. Fixed-cost reconstruction converts the measured excess back to physical bytes per lane using the same allocation.
Depends on CambrianTech/llama.cpp#67 and pins producer29eaf83aa. A shared parser rejects present malformed geometry even when memory_breakdown is absent. Older engines without the field retain the managed divided-cache interpretation; no unified-cache flag is enabled. Process-anonymous sampling retains its existing divided-cache contract.
Sampling moves into serving_daemon/footprint.rs, reducing monolith excess by281 lines. Existing fixtures cover unified versus legacy reconstruction, invalid geometry, old persisted JSON without allocation, and malformed geometry without a breakdown. Invalid reconstruction propagates unavailable footprint rather than invented zero cost.
Validation at3f0be60b8 on Windows: dev-fast footprint12/12 passed0.02s, parser2/2 passed0.00s, hygiene39/39 passed5.09s. Receipts geometry-review-footprint.log, geometry-review-parser.log, geometry-review-hygiene.log in team-proof-20260921. Independent review approves producer contract and corrected consumer source; exact-head CI remains pending. Full-debug native PDB linking previously failed; dev-fast passed without another cache purge.
Not deployed. Codex owns post-deployment verification of actual /props allocation against persisted measurement, fixed-cost reconstruction and consumer probe before closing this work. No turn-speed or learning improvement is claimed.