Repository navigation
perf(kv-unified): pack labels and selectively rescore terminal cuts - #112
Merged
antra-tess merged 2 commits intoSep 21, 2026
Merged
Conversation
… cuts Preserve exact floors, selection, ties, and hysteresis while reusing bucket storage and avoiding unnecessary terminal leaf scans. Keep the object backend and exhaustive scoring as diagnostic references. Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Contributor
Author
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.
Problem
After #110, general solves still spend substantial time allocating/grouping labels and rescanning every leaf of every retained terminal cut. This implements the two follow-up leads: reusable packed propagation storage and selective exact terminal rescoring.
Changes
storage: 'objects'andterminalEvaluation: 'full'as differential-reference modes.Policy weights, grids, hard walls, label ceilings, and adoption thresholds are unchanged. No solve deadline is introduced. All performance measurements disable the certificate.
Tests
npm run build: pass.npm run typecheck: pass.All selected frontier hashes, scores, floors, and existing propagation/envelope statistics match exactly. Only 3 exact evaluations are needed in each case, versus 6,538–6,719 retained cuts (the count includes the feasibility-witness check). A separate diagnostic checked every pinned-case estimate against exact evaluation.
Controlled 500-message replay at
028b065: 500 successes / 0 failures, certificate disabled.420/500 solves are below 2 seconds, 495/500 below 5 seconds. All 23 exact-reference checks pass (warm-up, every 25th message, and every layout movement), including all four transitions. Checks compare frontier hashes, all selected loss terms, score, and both floors; reference time is outside the solve timer. Every row's tokens, movements, terminal labels, and maximum labels per state also match the old replay. The old rows lack hashes/scores, so this is not a claim of full decision comparison on all 500 historical rows.
The previous replay is the archived pre-rebase
5c55a26run; a fresh complete #110-parent replay was not repeated. The paired large-fixture comparisons above use the current object backend. Replay timing includes forest/solver construction, solve, and selected frontier materialization; one warm-up is excluded. It models accepted layouts and fresh atomic cache markers using a frozen summary catalogue, not historical provider calls or cache TTLs. Observed high-water RSS was 3.285 GB including the in-process reference solves.CI passes on macOS and Ubuntu with Node 20 and 24. Full design, reproduction steps, and validation details are in
docs/kv-unified-packed-selective.md.Not verified / out of scope
Companion PRs
All changes are now incorporated into #110 without rewriting published history. This PR no longer needs separate review or merging.
🤖 Generated with Codex (GPT-6).