Repository navigation
test: only_what_differs_goes_up knows about LEONIDA_TAKE_BLOCKS - #2820
Conversation
The test branches on LEONIDA_SEND_CHANGED and asserts the pre-TAKE_BLOCKS answer in its else arm, so it fails on main since TAKE_BLOCKS went on by default in d920d85: take_dirty after a landing answers [] for the page the landing took, because that page went up as the 4 KiB pieces that differed. A third arm covers the default and the two switches no longer collide. Measured on main d920d85, the same test: default ok, TAKE_BLOCKS=0 ok, SEND_CHANGED=1 ok, and the crate 583 passed 0 failed 53 ignored.
|
Verified by OreoFR on macOS 27.2.1, Apple M5, head MEASURED
READ IN CODE
This is the failure OreoFR had the maintainers ignore temporarily ("until the test is fixed"), so merging this lifts that exception. AI-assisted: Claude Code |
|
Verified on Windows (not the author). AI-assisted (Claude Code agent Head
Test-only change, so no in-game run is needed. Still missing for a merge: the claim link asked above, and the |
|
Merging. Head |
maind920d850dhas a failing test, and this is the five-line test change that makes it pass again:only_what_differs_goes_upnever learned aboutLEONIDA_TAKE_BLOCKS.The red, on
mainwith nothing applied:It arrived with
6d0ba44f0/d920d850d("pages written since they were taken go up by the 4 KiB that changed", off, then on by default). Bisected: passes onb7a1be296, fails ond920d850d, and only the flag moves it:Why: the test branches on a different switch (
LEONIDA_SEND_CHANGED,host.rs:14446, off by default), so with nothing set it takes theelsearm and asserts the answertake_dirtygave beforeTAKE_BLOCKSexisted. WithTAKE_BLOCKSon, the page the landing took went up as its 4 KiB pieces and is not reported whole again -againis[]- which is the new behaviour working as its own commit describes.The change: a third arm, in the same shape as the existing two.
crate::toggled!is the crate's own reader (switch.rs:24, on unless the variable is0), so the arm fires on the default and steps aside for=0.Measured, all three modes and then the crate:
The value in the new arm is measured, not inferred: I instrumented
take_dirty's two answers and readagain=[],written=[(131072, 135168)]-(2 * PAGE, 2 * PAGE + 4096)- on the default path. My first attempt asserted(2 * PAGE, 3 * PAGE)by copying the neighbouring arm and it failed; the probe was right and I was wrong.Why the test needs a third arm rather than a tweak to the else: the two switches interact. With
TAKE_BLOCKSoff andSEND_CHANGEDon,againis[]andwrittenis the two 4 KiB interior ranges; withTAKE_BLOCKSon,againis[]andwrittenis one 4 KiB at the page's start; with both off,againis the whole first page. Three answers, three arms.What would stop the next one: nothing runs
cargo testond3d12/, so this reachedmainand stayed - #2816 is the workflow that runs it, and it is a draft waiting on #2815 for exactly this reason.AI-assisted: yes - DeepSeek v4.1 (flash), by bisect, by flag, and by instrumenting the two answers.
Written with an AI assistant.