Repository navigation
Stop the slot re-fit tests encoding the fit floor as a literal - #9845
Merged
Merged
Conversation
These three files pin placement outcomes that are arithmetic against _FIT_MIN_CTX, so moving the floor re-edits the tests and the re-edit is indistinguishable from noticing that placement changed. #9492 already moved it once; test_weights_that_fit_nowhere_still_offload reads _AUTO_OFFLOAD_CTX for exactly this reason, and this extends that treatment. - test_the_reduction_still_pins_without_a_native_context read the floor as 4096 and pinned the surviving slot count. Read the constant, and assert a reduction happened rather than which number it landed on. - The _AUTO_OFFLOAD_CTX sweeps were literals including values below a raised floor, so they drove the planner through a state the product never reaches (_AUTO_OFFLOAD_CTX is documented to sit at or above _FIT_MIN_CTX). Expressed as multiples of the floor: identical values today, still intended after a move. - The checkpoint reserve test asserted the reserve is paid in context. There are three ways to pay -- context, a slot, or residency -- and at 16 and 32 checkpoints this fixture already offloads, where the old assertion held only because the offload fallback happens to be shorter. Name all three so 'nothing was charged' stays distinguishable from 'a different axis paid'. - The platform matrix shares one fixture across nine cells, and whether it reaches the re-fit at all depends on the floor. A floor change turned all nine red with 'assert 0 > 0', which reads like the re-fit was deleted when the block is untouched. Added an anti-vacuity test that names the fixture, the floor and the plan the planner actually returned, and pointed the cells at it. No production change: these pass at the current floor and report the cause rather than the symptom at any other.
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.
Why
These three files pin placement outcomes that are arithmetic against
_FIT_MIN_CTX, so moving the floor re-edits the tests - and the re-edit is indistinguishable from noticing that placement changed. #9492 already moved it once.test_weights_that_fit_nowhere_still_offloadreads_AUTO_OFFLOAD_CTXfor exactly this reason; this extends that treatment to its neighbours.This is not a fix for a red test on
main- all 91 pass today. It is groundwork so the next floor change reports its cause instead of its symptom. #9822 is the live example: it raises_FIT_MIN_CTX4096 -> 8192 and turns 51 of these red, most of them opaquely.No production code changes.
What
test_the_reduction_still_pins_without_a_native_contextspelled the floor as4096and pinned the surviving slot count. Now reads the constant, and asserts that a reduction happened rather than which number it landed on._AUTO_OFFLOAD_CTXsweeps were literals including values below a raised floor, so they drove the planner through a state the product never reaches -_AUTO_OFFLOAD_CTXis documented to sit at or above_FIT_MIN_CTX. Now multiples of the floor: identical values today (4096 x [1,2,4,8]), still the intended sweep after a move.assert 0 > 0, which reads like the re-fit was deleted when the block is untouched and only the fixture went stale. Added an anti-vacuity test that names the fixture, the floor and the plan the planner actually returned:What this deliberately does not do
Simulating #9822's bump locally, the
RESCUEDband still fails after these changes:That is correct and I have left it. Those rows are the
--fit offbands #9492/#6718 exist to protect, and the failure is the ~3x decode collapse being reported, not a stale expectation. Robustifying a test must not mean sanding off the part that objects. Raised separately on #9822.Verification
pytest studio/backend/tests/test_slot_reduction_context_refit.py test_slot_refit_platform_matrix.py test_slot_refit_ctx_checkpoints.py test_auto_offload_ctx_fit_floor_coupling.py-> 91 passed (90 before, +1 anti-vacuity test).Also re-ran with
_FIT_MIN_CTXlocally forced to 8192 to confirm the new diagnostics fire and read correctly, then restored it.llama_cpp.pyis untouched in this PR.