-
Notifications
You must be signed in to change notification settings - Fork 0
compass(clock): apply the ponytail-audit of atom/compass/clock/ (#406 phase 2) #410
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 |
|---|---|---|
|
|
@@ -29,7 +29,6 @@ class LpRegistry: | |
|
|
||
| def __init__(self) -> None: | ||
| self._members: dict[LpId, None] = {} | ||
| self._ordered: tuple[LpId, ...] | None = None | ||
|
|
||
| def register(self, lp_id: LpId) -> LpId: | ||
| """Add one logical process. Refuses a duplicate rather than ignoring it. | ||
|
|
@@ -42,14 +41,11 @@ def register(self, lp_id: LpId) -> LpId: | |
| if lp_id in self._members: | ||
| raise ValueError(f"{lp_id} is already registered") | ||
| self._members[lp_id] = None | ||
| self._ordered = None | ||
| return lp_id | ||
|
|
||
| def ids(self) -> tuple[LpId, ...]: | ||
| """Every registered identity, in the total order, cheapest to call repeatedly.""" | ||
| if self._ordered is None: | ||
| self._ordered = tuple(sorted(self._members)) | ||
| return self._ordered | ||
| """Every registered identity, in the total order.""" | ||
| return tuple(sorted(self._members)) | ||
|
|
||
| def require(self, lp_id: LpId) -> LpId: | ||
| """Return `lp_id`, or refuse with the names that are registered. | ||
|
|
@@ -76,6 +72,3 @@ def __iter__(self): | |
|
|
||
| def __len__(self) -> int: | ||
| return len(self._members) | ||
|
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. The F7b ruling has no test that fires. This is at
The coordinator skipped F7b so that No test holds it, though. With So the next ponytail pass will measure F7b as free and propose it again. Two lines in with pytest.raises(TypeError):
[] in registryThis is not blocking: the PR follows the ruling, and the behaviour is intact at the head. |
||
|
|
||
| def __repr__(self) -> str: | ||
| return f"LpRegistry({', '.join(str(lp_id) for lp_id in self.ids())})" | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -70,7 +70,6 @@ | |||||||||
| print("seed", os.environ.get("PYTHONHASHSEED", "<unset>")) | ||||||||||
| print("hash", hash(names[0])) | ||||||||||
| print("module", atom.__file__) | ||||||||||
| print("arrival", " ".join(arrival)) | ||||||||||
| print("registry", " ".join(str(lp_id) for lp_id in registry.ids())) | ||||||||||
|
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. ponytail-review.
Once T2 removed
The 4 failures are the same tests each time, Removing the rotation also removes the reason for the docstring's "built from the unrotated list on purpose" clause (L16-18) and for the comment at L74-77. This is a suggestion, not a condition. The rotation is harmless, and removing it goes beyond the audit's 12 findings. |
||||||||||
| # Built from `names`, not from `arrival`: the seed is then the only thing that | ||||||||||
| # differs between children, so a difference in this line is attributable to it | ||||||||||
|
|
@@ -130,11 +129,6 @@ def test_every_child_ran_against_the_tree_under_test(runs): | |||||||||
| ) | ||||||||||
|
|
||||||||||
|
|
||||||||||
| def test_the_children_really_did_register_in_different_orders(runs): | ||||||||||
| arrivals = [run["arrival"] for run in runs] | ||||||||||
| assert len(dict.fromkeys(arrivals)) == len(SEEDS), arrivals | ||||||||||
|
|
||||||||||
|
|
||||||||||
| def test_the_total_order_is_the_same_in_every_process(runs): | ||||||||||
| expected = " ".join(sorted(NAMES)) | ||||||||||
| orders = [run["registry"] for run in runs] | ||||||||||
|
|
||||||||||
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, and already true at the tip. No test covers
LinkClass.__str__, and this PR rewrites its body.str(link_class)has one reader:InterLpLink.__repr__. That repr is the named reason indeclare's duplicate refusal (... is already declared as InterLpLink(prefill -> decode, prefill_to_decode, floor=0.001s)).With
mutate.py str_is_name,return self.namein place ofreturn self.value:return self.labelgives 74 passed and 0 failed.test_declaring_the_same_link_twice_is_refusedmatches only"already declared". So the evidence thatself.label→self.valueis equivalent is the probe, not a test.My probe on node 18 agrees with the developer's:
str(member)andrepr(InterLpLink)are byte-identical on both sides for all 3 classes. The change is correct.Optional one-line pin: add
match="already declared as InterLpLink\(prefill -> decode, prefill_to_decode"to that test'spytest.raises.