Repository navigation
test(provider): re-slice floor scenarios keep their idle engines from republishing capacity - #2718
Merged
Merged
Conversation
… republishing capacity ResliceFloorScenario.makeBridge builds real EngineV2 residents that sit idle. An idle engine's loop republishes its capacity snapshot every 1 ms (CBv2EngineLoopConfig.idleRecheckInterval), reading the admission ledger on the engine queue, while a re-slice point-updates the same gauge from the bridge. A publish that read before the update and writes after it restores the old capacity until the next publish. EngineV2Bridge.minimumServiceableGrantBytes combines that gauge capacity with the ledger's admissible bytes, so a floor read in that window comes out too high; the orchestration suite then saw a resident's grant below its floor (once on a composition run, once on a wave-2 run). The fixture's residents now wait an hour between idle rechecks, so the re-slice's point update stands for the whole test. Test-only; this covers EngineV2ResliceFloorWiringTests, EngineV2ResliceFloorTests and the Nemotron Super managed-slot capacity tests, which share the fixture.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 24, 2026
This branch was successfully deployed
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.
Summary
This fixes a flake in the KV re-slice floor tests. The change is test-only; production code is unchanged.
The failure:
EngineV2ResliceFloorWiringTests("KV re-slice keeps every slot's floor (orchestration)") failed twice today, then passed on re-run::89 expectResidentsServiceable("nvidia-nemotron-3.5-lightning grant 2024526182" below its floor);Cause: a per-engine race on the capacity gauge, where a stale write overwrites a newer one. No state carries over between tests.
ResliceFloorScenario.makeBridgebuilds realEngineV2residents that sit idle.EngineLoopV2.publishGauges,CBv2EngineLoopConfig.idleRecheckInterval = 0.001). It readskvBytesCapacityfrom the admission ledger.EngineV2.updateKVBytesCapacity).EngineV2Bridge.minimumServiceableGrantBytescombines that gauge capacity with the ledger's admissible bytes. A floor read in that window therefore comes out larger by about the size of the shrink. Lightning is the slot the floor-aware re-slice shrinks most, so its floor read lands above its real grant.What was ruled out:
Change: the fixture's residents use
CBv2EngineLoopConfig(idleRecheckInterval: 3_600). An idle resident publishes its capacity once when it starts and not again during the test, so the re-slice's point update stands. This one fixture line covers all three suites that share the fixture:EngineV2ResliceFloorWiringTests;EngineV2ResliceFloorTests;Why there's no red control: the failure needs a 1 ms engine-queue publish to land between two reads, so it can't be forced red deterministically. The change is test-only and leaves every assertion as it was.
Production: the same race can, for about 1 ms after a resize, show an idle engine's old capacity and inflate a floor read made in that window. The worst case is a spurious "would leave a model without its fixed request workspace" refusal right after a resize. It's fail-safe and never a wrong output. It's tracked separately; the proper fix is a generation counter in the SDK's capacity gauges, or reading the floor's capacity from the ledger.
2fdfabed75ResliceFloorScenario.makeBridge: idle recheck every hour for the resident enginesLinked issue
None.
Test plan
2fdfabed75: run 45450759303, green.Components touched
Protocol / interface changes
Documentation impact
Changelog
Notes for reviewers
Based on
939db0b3d5, which is indev(D886ac4a774e); the PR targetsdevand shows only its one commit.Before And After
Refactor Pass
Refactor pass: no change justified.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.