Repository navigation
Description
#4360 runs the ci/tests suite on pull requests for the first time. Three tests fail on the GitHub runner that pass locally. Filing them together because they share a cause — they were written where nothing ever ran them on another machine — but only the first is substantive.
Evidence: #4360, test / build, job 103157380196.
1. The golden corpus does not revalidate on another machine
FAILED ci/tests/test_color_reference_corpus.py::TestColorReferenceCorpus::test_serialized_golden_validation_reports_stage_and_delta_e_budgets
- ValueError: stage physical_drive differs from reference
validate_color_reference_corpus recomputes every vector from ci/color_reference.py and requires each stage to match the checked-in artifact to 1e-12.
Locally that comparison is not merely inside the budget — it is exact:
max_stage_abs_error = 0.0 (budget 1e-12)
max_delta_e2000 = 0.0 (budget 1e-9)
So the budget has never been exercised. What the test actually enforces on the machine that generated the corpus is bit-identity, and the 1e-12 tolerance is untested slack. On the runner the same recomputation exceeds it.
Why this matters beyond CI. The corpus is what every later phase is measured against (#4034, P5 → P6/P7/P8). If it can only be revalidated on the machine that produced it, then "the embedded implementation is within ΔE 0.5 of the reference" is a statement about one machine's libm, and anyone regenerating or checking the corpus elsewhere gets a failure they cannot distinguish from a real regression.
Mechanism — hypothesis, not measured. physical_drive is
(light * brightness) ** (1.0 / exponent)a pow(), and the reference makes 17 libm calls (pow, cbrt via ** (1/3), atan2, sin, cos, hypot, log, sqrt). Last-ulp libm differences are expected across platforms, but a bare ulp on a drive in [0, 1] is ~1e-17 and cannot by itself exceed 1e-12. That suggests amplification — most plausibly a comparison in the gamut mapper or the allocation taking a different branch when an input differs in its last bit, which would make the reference's output discontinuous in floating-point noise rather than merely imprecise. That needs measuring before it is believed; the runner only reports which stage failed, not by how much.
Worth instrumenting the failure to print the actual deviation before choosing between "widen the budget", "make the reference branch-stable", and "regenerate per platform".
2. test_fbuild_qemu.py::test_fbuild_test_emu_esp32dev
AssertionError: fbuild test-emu exited with rc=1.
The file already carries @pytest.mark.skipif guards; this case either lacks one or its condition does not cover the runner. It needs a toolchain that is not there, so it should skip rather than fail.
3. test_wasm_warm_path_perf.py::TestSrcFileListHashMemoization::test_second_call_hits_memo_cache
AssertionError: 0 != 1 : Memo missed: warm call made 0 scandir calls (expected exactly 1 for the top_count probe)
Note the direction: fewer scandir calls than expected, not more. The assertion is assertEqual(warm_calls, 1) on the premise that the warm path always performs a one-scandir iterdir() top-count probe. Getting 0 means the probe was skipped entirely — a different warm path than the one the test describes, not a memo miss. The message would be misleading to whoever hits this.
Suggested order
(1) is the one that matters and should be measured rather than tuned. (2) and (3) are guard/premise fixes and can land independently — #4360 is blocked behind all three, so the CI gate stays off until they are resolved.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(ci): stop PLATFORMIO_SRC_DIR leaking between tests, and two test …