Repository navigation
test(planning): byte-equal .wind→.gcode golden harness + regenerator - #277
Merged
Merged
Conversation
Prework slice P1 for the Motion IR epic (#136): gate the goldens frozen in #270 so the IR refactor (#274) can prove an empty diff at every step. A parametrized test plans each example .wind and compares the result, byte for byte, against its committed .gcode — serialized exactly as write_gcode writes the file (`"\n".join(commands) + "\n"`). Until serialize() exists (#274) the harness exercises the current emit path (plan_wind().commands); #274 swaps the producer and the empty diff is its acceptance. - Exact-text compare catches trailing-newline / length drift, not just per-line. - On mismatch it reports the first differing line (not a multi-MB pytest diff). - FIBERPATH_UPDATE_GOLDENS=1 pytest regenerates the goldens deliberately, so baselines are never hand-edited (verified idempotent against #270's freeze). The four strategy-level fixtures in tests/planning/fixtures/ stay on their own path (test_layer_strategies.py covers the layer-only path; this covers the full-program path). Part of #136. Closes #271.
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.
Part of #136 (Motion IR epic). Closes #271. Prework slice P1 — turn the goldens frozen in #270 into the regression gate the IR refactor (#274) runs against.
What it does
tests/planning/test_example_goldens.pyparametrizes over the 7 example.wind → .gcodepairs, plans each, and compares the result byte-for-byte against its committed golden — serialized exactly aswrite_gcodewrites the file ("\n".join(commands) + "\n").Until
serialize()exists (#274) the harness exercises the current emit path (plan_wind().commands); #274 swaps the producer and the empty diff is its acceptance.Design notes
splitlines()), so trailing-newline / length drift is caught, not just per-line content.pytrace=False) instead of letting pytest diff multi-MB strings.FIBERPATH_UPDATE_GOLDENS=1 pytest tests/planning/test_example_goldens.pyrewrites the goldens (and skips), so baselines are never hand-edited. Verified idempotent against build(planning): freeze byte-exact G-code goldens before the Motion IR refactor #270's freeze (0 files changed).tests/planning/fixtures/stay on their own path (test_layer_strategies.pycovers the layer-only path; this covers the full-program path).Verification
ruff+ruff format+mypyclean.No marker needed — the large parts plan fast enough (~6s total) to stay in the default suite, where they belong as the gate.