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
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!730
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/730/head"
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?
@aslan2142 on GitHub · 2026-11-24 13:01 UTC · original
aslan2142:build589-vs-layout-census-guard→main· +151 −7 · 2 files · 1 commits · merged 2026-11-25 22:27 UTCClaimed in the coordination issue as: OLD-8645 #14
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 at51f3160923; 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).
@abnalstlll-byte on GitHub · 2026-11-24 13:14 UTC · original · approved these changes
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.
@aslan2142 on GitHub · 2026-11-25 22:27 UTC · original
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).