OLD-8645: restore old upstream PR 8645 - vs_layout_census: refuse a --json that is an input or a directory before survey() (BUILD-589) #730
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!730
Loading…
Reference in a new issue
No description provided.
Delete branch "build589-vs-layout-census-guard"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: OLD-8645 https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7132204652
Restoration of my original pull request, old upstream PR 8645 in
ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at 51f31609236a952badeb9c9aba9efc2a6e4dc2ff; the one commit cherry-picked cleanly and is unchanged. The tool isscripts/vs_layout_census.py, and it already uses the sharedtools/report_paths.same_report_pathguard that CONTRIBUTING.md names.What and why
--jsonis compared only withindex.json, using a rawos.path.samefile(scripts/vs_layout_census.py:189).--jsonthat names an indexed.dxbccontainer or adisasm/<stem>.slisting overwrites that input.--jsonthat is a directory runssurvey()first (that includes llvm-mc on every unlisted payload) and fails only at the write.main()now checks--jsonbeforesurvey()runs and refuses:same_report_pathmatches toindex.jsonor to a container or listing named in the index.input_paths(). It shares the newload_index()withsurvey(), so the guard and the census read the same index.--jsonpath still runs as before.report_pathsworks inside, without changing the call. It shares no files with this one and does not conflict.Tested
Linux, Python 3.14.10, CPU only. All inputs are synthetic and built by the test:
index.json, FSSM payloads in DXBC containers and hand-written.slistings. No game files.python -I tests/test_vs_layout_census.py:python -I tests/test_report_paths.py: OK.python -m compileall -q tools tests scripts: clean.git diff --check: clean.python -I scripts/check_no_game_data.pyon both changed files: clean.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)AI-assisted (Claude Code, Claude Opus 5.5).
LGTM. Properly validates --json output path against directory targets and input collision via same_report_path before running survey(). Clean-room synthetic test suite added to ests/test_vs_layout_census.py.
Merged:
vs_layout_censusrefuses a--jsonthat is an input or a directory beforesurvey().main, and no review point is open.tests/test_vs_layout_census.pypasses onmain+ this head (Linux, CPython 3.14).maind601736ce+ad136ffb9: the semantic suite passes (492 files, 6,315 tests, 0 files failed);test_vs_layout_censuspass; the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 2 changed files.AI-assisted (Claude Code, Claude Opus 5.5).