tooling: index local compute container candidates #2395
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2403"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T15:22:31Z.
Summary
HASHparts using the existing record and container validation.Verification
python -B tests/compute_container_index_check.pypassed, including duplicate, conflict, invalid flags and trace controls.python -B tests/startup_compute_request_offline_check.pypassed.python -B tests/dxcontainer_part_offsets_check.pypassed all 8 cases.python -B tests/docs_links_check.pypassed (19 Markdown files, 465 links).Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T15:49:20Z.
Two mutations survive, and neither is equivalent — they are the two places where the fixture compares a set instead of an order
Baseline:
tests/compute_container_index_check.py→Ran 1 test … OK, exit 0.tools/compute_container_index.pysorted(candidates[digest].values(), key=…sha256)→list(…)keys = sorted(observed if … else request_paths)→list(…)Both outputs are ordering in a file whose purpose is to be compared between runs ("index local compute container candidates"), so ordering is part of the contract, and both mutants were behaviour-changing when I checked rather than assumed.
The first one is vacuous because the expected list is also sorted
The expectation sorts itself, so the comparison only fails when the tool's natural order differs from the hash order. With the two conflict blobs you picked, the collection order happens to coincide with the sorted order, so
list(...)passes. That is not the assertion the line appears to make — it reads as "candidates are sorted", and it actually says "candidates are sorted or this pair is already sorted".The fix is one line in the fixture rather than in the tool: choose the conflict pair so that collection order is the reverse of hash order (compute
sha256of both and swap if needed), or assert[c["sha256"] for c in candidates] == sorted(...)and that the pre-sort order differs, so the case cannot go vacuous again. Thenlist(...)dies.The second has no assertion at all
rowsis a dict keyed by request key, and every access isrows[key(n)], so insertion order is never observed by the test even though it is what lands in the JSON. If the index is meant to be diffable,list(report["requests"])should equal the sorted key list; without that, changingsortedtolistchanges every output file and no test notices.One more shape to consider while you are there
summary.request_statusesisdict(Counter(...))andarchive_recordsisdict(archive_counts)— both take their order from first occurrence. If two runs see the same requests in a different order, the summary dicts serialise in a different order even when every value matches. Sorting those two keys at construction would make the whole report order-stable, which is the property the tool is for.What the fixture does cover well
The seven request outcomes (
unique,conflict,unmatched,unrecognized-data,missing-data,missing-request), the archive framing rejections, theselectionswitch betweendispatch-traceandcache, and the "the run does not modify the tree" assertion (self.assertEqual(set(root.rglob("*")), original_files)) — that last one is the kind of control most fixtures skip, and it is why I trust the rest of the table.AI-assisted; the two mutations and the read of the expected list were done locally on Windows 11 build 26300.9974.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-25T15:58:42Z.
APPROVED