-
Notifications
You must be signed in to change notification settings - Fork 0
compass(spec): hold the probe tables, the reimport helper and the transfer stanzas against their defects #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -565,6 +565,7 @@ def test_a_transfer_keeps_the_source_stack_out_of_this_machines_pin(): | |
| checked = validate(combination) | ||
| assert not checked.ok | ||
| assert checked.refusals[0].rule is Rule.PINNED_STACK | ||
| assert checked.refusals[0].what.startswith("'tier2' (machine ") | ||
| assert checked.refusals[0].what.endswith( | ||
| "carried constants over from 'mi300x-8gpu', measured against rocm " | ||
| "'7.0.2', into a spec pinned to rocm '7.2.4'" | ||
|
|
@@ -597,6 +598,7 @@ def test_a_saved_transfer_merged_again_names_the_merge_that_dropped_its_pin(): | |
| rest = fragments()[:2] + [fragment("links", LINKS)] | ||
| (refused,) = validate(merge([saved] + rest)).refusals | ||
| assert refused.rule is Rule.PINNED_STACK | ||
| assert refused.what.startswith("'t.yaml' (machine ") | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking, R1-1: the needle stops just before the part of the stanza that differs between fragments. Principle 6: "A declined answer with a named reason is a result. A guessed one is a defect." The rule: "A check counts only once someone has seen it fire."
Mutant CA2L. The saved arm keeps It says a Result: A fix of the same shape as your assert refused.what.startswith(
"'t.yaml' (machine 'mi355x-8gpu-2node', transferred-from:mi300x-8gpu, "
"by a person on 2026-09-18) carried constants over from "
)The needle you have does what the brief asked, and it reddens the #346 reviewer's CA2 (0 F at the tip, 1 F at the head). So this finding is non-blocking. If it is not taken here, it needs a follow-up issue. The same gap is in the mismatch arm (R1-2). |
||
| assert "over from 'mi300x-8gpu', and its provenance names the" in refused.what | ||
| assert "fragments an earlier merge built it from" in refused.what | ||
| bare = fragment("tier2", TIER2, method="transferred-from:mi300x-8gpu") | ||
|
|
@@ -1987,6 +1989,10 @@ def test_the_probe_question_reads_only_the_tables_a_probe_can_fall_short_on(): | |
| } | ||
|
|
||
|
|
||
| #: The one width table a probe falls short on, the retained bytes at width 1. | ||
| THE_HOLE = "device.runtime_constants.allocator_retained_after_load_bytes" | ||
|
|
||
|
|
||
| def reimported_validate(name): | ||
| """`validate` imported again, the way a session imports it the first time. | ||
|
|
||
|
|
@@ -2002,6 +2008,7 @@ def reimported_validate(name): | |
| ) | ||
| module = importlib.util.module_from_spec(loaded) | ||
| loaded.loader.exec_module(module) | ||
| assert importlib.import_module("atom.compass.spec.validate") is not module | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking, R1-3: the new assertion holds half of the docstring's sentence. Principle 8: "Every claim carries its measurement." The docstring (L2002) says the helper "does not register it". The assertion holds a narrower claim: that the helper does not register the module under the canonical name. Mutant REGown. It changes Result: head The consequence clause is held. "the instance the rest of the suite is holding is the one it started with" is exactly what It cannot pass for the wrong reason in this file. The canonical module is imported at collection, by L57–68. I probed that Two one-line fixes: narrow the sentence to "does not register it under the package's name", or add |
||
| return module | ||
|
|
||
|
|
||
|
|
@@ -2019,8 +2026,9 @@ def test_a_width_table_no_probe_is_named_for_is_refused_and_not_an_import_error( | |
| monkeypatch.setattr(schema_module, "SCHEMA", schema_module.SCHEMA + (added,)) | ||
| under_test = reimported_validate("validate_with_a_table_no_probe_is_named_for") | ||
| assert added.path in under_test.WIDTH_TABLES | ||
| # A table with no entry has no hole to report, so it is not a probe table. | ||
| assert added.path not in under_test.PROBE_TABLES | ||
| # A table with no entry has no hole to report, so it is not a probe table, | ||
| # and the table that has one still is. | ||
| assert under_test.PROBE_TABLES == (THE_HOLE,) | ||
| # The term is named where a caller asks about it, by the refusal this | ||
| # package exists to give. | ||
| with pytest.raises(SpecRefusal) as refused: | ||
|
|
@@ -2045,7 +2053,8 @@ def test_a_probe_given_the_width_that_has_none_empties_the_probe_tables(monkeypa | |
| (probes_module.SINGLE_CARD, probes_module.MULTI_RANK), | ||
| ) | ||
| under_test = reimported_validate("validate_with_every_width_filled") | ||
| assert under_test.PROBE_TABLES == () | ||
| # Emptied by the probe, and not empty before it. | ||
| assert (PROBE_TABLES, under_test.PROBE_TABLES) == ((THE_HOLE,), ()) | ||
| checked = under_test.validate(merged().document, tp_widths=(16,)) | ||
| assert not checked.ok | ||
| assert not any( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking, R1-2: same as R1-1, in the stack-mismatch arm.
Principle 6, and the rule "A check counts only once someone has seen it fire."
Mutant CA2mL. The mismatch arm keeps
fragment.source, and renders the rest of the stanza frommerged.fragments[-1]. The text it produces, probed on node 18:Result: head
064ac89bd, 1307 passed, 0 failed. Theendswithbelow pins everything after the stanza, and thisstartswithpins everything up to(machine. That leaves exactly the method, author and date free.The fix: extend the needle through the method,
"'tier2' (machine 'mi355x-8gpu-2node', transferred-from:mi300x-8gpu, by a person on 2026-09-18) carried ". With that,startswithplusendswithtogether cover the whole string.This is non-blocking for the same reason as R1-1: the #346 reviewer's CA2m is red at the head (1 F) and green at the tip.