Merge pull request 'test(formats): invert the primitives tripwire to pin the fix (#38, option A)' (#40) from fix/38-invert-primitives-tripwire into main
Some checks failed
CI / Native — linux (push) Has been cancelled
CI / WASM — Web (push) Has been cancelled
CI / Formatting (push) Has been cancelled

Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
2026-09-16 17:02:31 +00:00

View File

@@ -172,8 +172,29 @@ fn the_title_fade_quad_rests_transparent() {
///
/// This test measures the damage rather than asserting the feature works, so the
/// number stays honest and moves when the ordering is solved.
/// With primitives drawn, no build comes out wiped.
///
/// 🔴 THIS USED TO ASSERT THE OPPOSITE. Until issue #38 it was a tripwire named
/// `the_derived_order_puts_primitives_last_and_that_wipes_screens`, asserting
/// `wiped_on > 0` — that switching primitives on still flattened at least one
/// screen — with the instruction to turn `include_primitives` on by default the
/// day it stopped. `53f8345` made that day arrive: a keyless primitive that
/// would hide the screen is now forced to paint first (`forced_backdrop`,
/// `docs/re/structures/ui-forced-backdrop.md`), and the 36 one-colour builds
/// were "wiped by our own sort". The wire tripped on 2026-08-29 and sat red for
/// 15 days, because CI has no corpus and the suite self-skips there.
///
/// #38 chose to keep the default **off** and pin the fix instead. The flatness
/// proxy stood in for "paint order is solved", and the fix's own record says
/// it is only partly solved: *"This does **not** make `include_primitives` safe
/// by default"* (`docs/re/structures/ui-prm-primitives.md`). An unlisted
/// primitive that does not hide the screen still sorts last.
///
/// So this is now the one end-to-end check of the rule: the four tests in
/// `ui_forced_backdrop_disc.rs` pin its mechanics, and none composes with
/// primitives on.
#[test]
fn the_derived_order_puts_primitives_last_and_that_wipes_screens() {
fn no_build_is_wiped_with_primitives_on() {
let Some(root) = disc_root() else {
eprintln!("SKIP: extracted disc not found (set SYLPHEED_DISC to enable)");
return;
@@ -221,13 +242,17 @@ fn the_derived_order_puts_primitives_last_and_that_wipes_screens() {
"the DEFAULT composite wipes {wiped_off} builds — primitives are supposed \
to be off unless asked for"
);
assert!(
wiped_on > 0,
"no build is wiped with primitives on — the ordering problem this flag \
exists for may be solved, in which case turn it on by default"
assert_eq!(
wiped_on, 0,
"{wiped_on} of {with_prm} builds come out >99% one colour with primitives on — \
a primitive that hides the screen is painting on top again. That is \
`forced_backdrop` failing to force it first; see \
docs/re/structures/ui-forced-backdrop.md and issue #38. Do NOT resolve \
this by turning `include_primitives` off in the test: the default is \
already off, and this test is the only end-to-end check of the rule."
);
eprintln!(
"{with_prm} builds draw a visible primitive; with the derived order \
{wiped_on} of them come out >99% one colour, {wiped_off} by default"
"{with_prm} builds draw a visible primitive; with primitives on \
{wiped_on} come out >99% one colour, {wiped_off} by default"
);
}