fix(release): reject duplicate checksum manifest names #1039
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1039
Loading…
Reference in a new issue
No description provided.
Delete branch "NitnekLeBorgne/Longshot-contributions:fix/release-checksum-names-20261116"
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?
Type: fix · Risk: low · Tested on: Linux and native Windows CLI, game-free Python checks (GPU unused) · Needs: no remaining Windows public-fixture gate; production use remains untested
Why
Release assets from different directories can share a filename. The checksum writer currently writes both under that one name, while the reader silently keeps only the last checksum. A manifest should identify each asset unambiguously, not depend on entry order.
This is a locally reproduced filename-identity defect, not a reported player incident or a signature-verification bypass. The parent admitted this scope using the public corpus and complete PR file lists; no matching issue is claimed. PR #685 changes the same file's
.nxblacklist regex only; that line is untouched here.How to reproduce
Seen on: Linux, no GPU or game needed.
Settings and switches: defaults; no new switches.
Steps: create
left/Builder.zipandright/Builder.zipwith different bytes. Runpython -I -B scripts/release.py sums left/Builder.zip right/Builder.zip --out SHA256SUMS. Separately pass two checksum lines namingBuilder.ziptoread_sums. The newtests/test_release_manifest_names.pyexercises both using temporary fixtures.Expected: reject duplicate names, even when hashes are identical; leave an existing output untouched and do not create a new output on rejection.
Actual: on the pinned main: writer exits successfully and emits duplicate names; reader silently overwrites the earlier dictionary entry. These were independently observed as RED assertion failures before the respective production edits.
What changed
Repeated filenames now fail explicitly instead of producing or accepting ambiguous checksum manifests. Unique-name output stays byte-for-byte unchanged.
scripts/release.py,sums: check asset basenames before opening the output file; keep the existing exclusions for the manifest and its signature.scripts/release.py,read_sums: reject an already-seen filename before dictionary assignment. The policy rejects all duplicates, including identical hashes and alternate sha256sum separators.tests/test_release_manifest_names.py: five automatically discovered game-free tests cover both regressions, identical/repeated inputs, preserving an output that is itself an input, absent-output preservation, sorted unique output, manifest/signature exclusions, and unchanged malformed-line diagnostics.Measurements
Both reproduced regressions are fixed; this is a script correctness change with tests, not a performance change. No runtime or throughput measurements or median claims.
Flags and settings
None.
Testing
python -I -B tests/test_release_manifest_names.py -vpasses all five methods; unchangedpython -I -B tests/test_release.py -vpasses all 34 methods. Every native command exited 0, including real checksum CLI subprocesses. Tests ran in an accented path (épreuve) with private D: temporary files. No GUI or release publication was exercised.Tested: commit
7bb689d619250bc2a0d791875a3a6555aebc72f3, tree2bc9f5059021b469d334f7a996393d8eebf47446, direct parentd9486a0846e90905e2ee0bdc4a0d6df96c547c87.tests/test_release.pytests pass. Its verbose run emitted ResourceWarnings from existing fixtures; none suppressed.python -I -B tests/run_all.py --jobs 3, with no selection or skip overrides, isolated HOME/XDG/TMP and baseline-identical PATH. 538 passed, 22 failed, 92 skipped, 652 checks, native exit 1, 234.172 seconds wall time. Four discovered C++ checks pass.test_bug_report.pyandtest_hardware_report.pyreport a missing sibling Tooling directory using checkout-specific absolute paths. A separate literal substitution of only those exact paths proves otherwise identical diagnostics; the original strict result and diffs are retained. This is not CI-green.AGENTS.mdmaterialized. Two unchanged upstream SwitchesRemoved methods additionally pass with the public blob provided in memory. This is native normal-runner qualification of a source-only checkout, not exact-tree CI.Existing baseline failures retained:
tests/test_appimage_player_build.pytests/test_bake_portability.pytests/test_bug_report.pytests/test_crash_dialog.pytests/test_crt_options.pytests/test_env_on.pytests/test_guest_imported.pytests/test_hardware_report.pytests/test_lift_cleanup_error.pytests/test_link_skip.pytests/test_linux_update.pytests/test_make_game_cache.pytests/test_missing_nup.pytests/test_mods_size_table.pytests/test_options_budget_once.pytests/test_pending_guest_import.pytests/test_pipeline_tour.pytests/test_readback_late.pytests/test_run_all_changed.pytests/test_vk_occlusion_queries.pytests/test_vk_pgo.pytests/test_walk_key.pyNot tested: real release publishing, production manifests, or any game. No API call, publication, or test-farm request was made.
Must be tested: None for the public-fixture regression; the Windows CLI checks above are complete. Production use and the other exclusions under Not tested remain unqualified.
Risks
What could break: callers that intentionally repeat an asset path or manifest name now receive an error, even with identical bytes. This is the chosen consistent duplicate policy. Filename comparison remains exact and case-sensitive; filesystem alias normalization is not added.
Turning it off: revert the commit.
Compatibility: valid unique-name manifests keep their format and sorted output. No flags, saves, runtime, ABI, shaders, signature format or cryptographic checks change.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
mainat frozen intake (d9486a0846e90905e2ee0bdc4a0d6df96c547c87). Public main has since advanced; no rebase to that later tip is claimed. Relevant source closure is checked again before publication, without transferring full-suite results to another tree.python -I -B tests/run_all.pyqualified against its exact pinned-main baseline: native exit 1 is preserved, all 22 existing failures are named above, and no new failure or changed skip status was found. This does not assert a wholly passing suite.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened (new independent test file).Source export scope: unchanged gpu/build-shadertool.bat has the recorded .gitattributes LF-to-CRLF conversion. Candidate production and test files match native Git blobs; source/modes are unchanged across each run. Tooling is absent in the isolated runner context: two corresponding failure messages require only an exact sibling-path substitution; the original strict comparison remains false. This is not hosted-CI or literal exact-tree equivalence.
Current-main context: at the fresh read of main
6fb13fe527, scripts/release.py adds an unrelated nightly-age command and its standard-library datetime import. The sums/read_sums fix remains on the exact reviewed and tested commit above; full-suite results are not claimed for the later main tip or a merged tree. The initial whole-file closure guard stopped before any push or PR creation, and that stop is retained.Windows qualification caveats: Native CPython 3.14.7 used a new independent copy of an existing pinned-dependency runtime, not a venv or a replacement product runner. Each candidate used its own full frozen-head public Git-blob export (2652 tree entries; 2651 files materialized;
AGENTS.mdkept opaque and never materialized). Production/test SHA-256 and all exported file bytes were verified before/after; Git modes remain metadata, not a claim of POSIX permission semantics on NTFS. Normal public test sources and commands were unchanged. Full stdout/stderr and exact native executable/argv/cwd/exit records are retained. A post-test harness assertion exited 1 because five CPython encoding bytecode cache files appeared only in the new owned runtime copy; independent readback confirmed no existing runtime file changed, the original runtime stayed byte-identical, and all test invocations exited 0. No full Windows suite, real compiler, game, GUI, hosted CI or publication qualification is claimed. Existing Linux full-suite results above are unchanged and are not transferred to Windows.WIP: fix(release): reject duplicate checksum manifest namesto fix(release): reject duplicate checksum manifest namesCode-only review of
7bb689d619; informational findings, with final approval left to another reviewer.No new correctness issue found in the duplicate-name checks or their regression tests. The writer rejects repeated asset basenames before opening the output, and the reader rejects repeated parsed names before overwriting a dictionary entry, including identical hashes and alternate checksum separators. Unique-name output and the manifest/signature exclusions remain unchanged.
The new tests exercise the real CLI and parser rather than matching source text, including existing-output preservation, absent-output preservation, repeated input paths, and distinct files sharing a basename. Removing either production guard would make the corresponding regression fail. The stated policy remains exact, case-sensitive names; this does not add filesystem alias normalization.
The author reports five new tests and 34 existing release tests passing on Linux and Windows. The Linux full-suite report retains 22 baseline failures and its strict-comparison caveat; this is not a green full-suite claim. I read the full diff, relevant release/signature call sites, test coverage, release documentation and main's intervening changes; I did not run tests, builds, scripts from the PR, or a publication.
The shared-file overlap with PR 685 is a separate release-file exclusion edit, not a duplicate fix or an apparent merge-order dependency. Final integration checks and approval remain with another reviewer.
Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.