fix(tools): bind cached installation to extraction mapping #1311

Open
NitnekLeBorgne wants to merge 2 commits from NitnekLeBorgne/Longshot-contributions:fix/tools-stamp-mapping-20261117 into main
Contributor

Type: fix · Risk: low · Tested on: Linux and native Windows, game-free contributor-tool fixtures; no GPU/driver exercised · Needs: none

Why

Changing where the same downloaded archive is unpacked can leave an old tool installed. A matching archive digest alone does not mean the installed directory matches the requested prefix and destination.

Tracker searched again on 2026-11-17: no matching issue found in the returned issue corpus for stamp_of, extraction mapping or cache stamp; this is an observational search, not a claim about hidden/deleted issues. No issue closure is claimed.

How to reproduce

Seen on: Linux and native Windows, offline fixtures; GPU and driver not involved.
Settings and switches: Private synthetic fixtures; no game settings or GAME_PATHS inputs.
Steps: Use tests/test_tools_stamp_mapping.py with a local cached tiny archive. Install it, keep its SHA unchanged, then change prefix or an already-existing destination in the fixture lock and install again. Run python -I -B -m unittest discover -s tests -p test_tools_stamp_mapping.py against baseline production plus the added tests, then the combined candidate.
Expected: A changed extraction mapping causes reinstallation; an identical complete stamp remains a no-op.
Actual: The SHA-only reuse check keeps stale content even though both CLI invocations exit 0.

What changed

Compare the complete serialized (sha256, prefix, dest) stamp before reuse. Preserve SHA/None for existing two-argument stamp_of callers and retain the legacy behavior for absent/blank stamps. The patch is limited to the following production/test pair, both Git mode 100644.

  • Production: scripts/tools.py — stamp_of() and install().
  • Regression coverage: tests/test_tools_stamp_mapping.py — supported failure and neighboring controls.

Rebased onto main 544229a260c5f5008f241b9cf48ae6b01c1602b9. Test-only commit: 9755194deb04603727ff643145f961ae5796d75d. Final fix head: 66f3797003c9d726e05d436f76e354a37892aca2. Both changed files and Git modes are identical to the previously SPEC/QUALITY-reviewed source. Full tree/delta/parent-chain replay was independently verified; fresh normal qualification now uses this actual HEAD.

Measurements

Nothing to measure: this is an offline contributor-tool correctness fix, not a gameplay, rendering or performance change.

Flags and settings

None

Testing

Tested: The retained Linux focused closure passed 35 unique methods (6 new mapping, 15 lock and 14 Linux-caller methods); the six new methods make 20 CLI calls, not 20 extra tests. The native Windows focused run passed all 6 new methods and 20 internal CLI calls, native exit 0, complete raw streams and Job final 0. It uses authored local linux-x64 archive data on Windows, not an installed Windows SDK. That native receipt was acquired at the original head f674c0a3f17625365e32b84fd185e87abdc63caf; the production/test bytes, modes and dependency closure used there are unchanged by this rebase. It is retained evidence, not a new Windows run.

The actual offline regression is behavioral: baseline reuse returns exit 0 but keeps the wrong prefix/destination payload; final source installs the requested payload. Baseline Windows completed 6 methods with 5 failures and one unsupported baseline stamp_of(full=True) TypeError; this is not a missing-dependency/setup RED. The original observer-aborted attempts are not counted as product results.

Fresh normal Linux qualification on the pinned current base and actual rebased candidate used python -I -B tests/run_all.py --jobs 2 --junit ..., identical interpreter/environment policy and real Git HEAD/index:

  • Main @ 544229a260c5f5008f241b9cf48ae6b01c1602b9: 721 checks, 571 PASS / 42 FAIL / 108 SKIP, native exit 1.
  • This PR @ 66f3797003c9d726e05d436f76e354a37892aca2: 722 checks, 572 PASS / 42 FAIL / 108 SKIP, native exit 1.
  • The added passing check is tests/test_tools_stamp_mapping.py. All 721 common statuses, skip reasons and complete failure payloads agree after narrowly recorded diagnostic-noise handling: owned source/run paths, source-proven temporary file/directory suffixes, unittest elapsed times, one GCC intermediate object and one synthetic-fixture backup directory. Assertion values, failure identities, symbols, numeric offsets and statuses are not normalized. The GCC/linker error still names choose_face, hos_options_file, .text+0xa1a and exit 1; a separate retained compiler/assembler/linker trace proves this toolchain's temporary-object provenance. No universal no-regressions claim.
  • Tracked source bytes/modes remained unchanged; each owned process group was absent at completion. Exports omit the protected repository instruction file: this is source-only qualification, not literal-checkout or hosted-CI equivalence. The earlier source-only baseline lacking Git metadata and the historical night's strict-false comparison are retained separately, not relabelled as passing results.

The 42 normal failures also observed on this current-main qualification are named here, as the template permits; the normal suite is not green:

  • tests/test_bug_report.py
  • tests/test_bug_report_defaults.py
  • tests/test_cpu_report.py
  • tests/test_crash_groups.py
  • tests/test_crt_options.py
  • tests/test_damage_debug_menu.py
  • tests/test_discover.py
  • tests/test_display_startup_failure.py
  • tests/test_dlss_feature_size.py
  • tests/test_failed_compile_keeps_objects.py
  • tests/test_framegen_preset.py
  • tests/test_guest_imported.py
  • tests/test_hardware_report.py
  • tests/test_hud_layout_row.py
  • tests/test_invalidate_vcore.py
  • tests/test_lift_lookups.py
  • tests/test_link_skip.py
  • tests/test_linux_pressure.py
  • tests/test_linux_update.py
  • tests/test_longshot_saves.py
  • tests/test_mirror_budget.py
  • tests/test_missing_nup.py
  • tests/test_mods_size_table.py
  • tests/test_pending_guest_import.py
  • tests/test_pipeline_play_cache.py
  • tests/test_present_thread.py
  • tests/test_profiling_mode.py
  • tests/test_readback_timeout_source.py
  • tests/test_renderer_new_handler.py
  • tests/test_rumble_menu.py
  • tests/test_run_all_changed.py
  • tests/test_slow_frames.py
  • tests/test_switch_table.py
  • tests/test_target_image_pool.py
  • tests/test_tested_configurations.py
  • tests/test_upscaler_round_trip.py
  • tests/test_upscaler_rows.py
  • tests/test_vcore_escape.py
  • tests/test_vk_occlusion_queries.py
  • tests/test_vk_swapchain_compat.py
  • tests/test_walk.py
  • tests/test_walk_key.py

Not tested: Full Windows suite, real SDK/release installation, gameplay/GPU and a hosted-CI-equivalent checkout. These are not claimed, and no game/runtime files are changed. Hosted checks on the final public head are tracked separately; readiness is not maintainer approval or merge eligibility.

Must be tested: None additional for this two-file contributor-tool change. The normal-runner exception is explicitly limited to the named current-main failures above, with source-only context disclosed; it is not a waiver for a new candidate failure or an unknown comparison.

Risks

What could break: Tool reinstall decisions. Non-empty incomplete/corrupt/extra-field stamps intentionally reinstall; absent/blank stamps retain legacy behavior. Linux runtime SHA-only policy and pre-existing fetch/concurrency risks remain unchanged.

Turning it off: Revert the fix and its associated test commit.

Compatibility: No game runtime, saves, options, shader/pipeline cache or vk ABI changes; only the stated contributor-tool behavior changes. No GAME_PATHS directory is touched and no in-game run is claimed.

Checklist

The normal runner remains native exit 1; its named current-main failures use the template's explicit exception, not a full-suite PASS claim. Tracker search and the GPL-3.0-or-later diff/provenance check are complete. No incompatible dependency, third-party code, dump or decompiled/generated game content is introduced.

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.

The retained RED uses identical baseline production and regression-test bytes; the rebased normal run verifies the final source on the current-base context. No host C/C++, shader, game switch or visible-game change applies.

**Type:** fix · **Risk:** low · **Tested on:** Linux and native Windows, game-free contributor-tool fixtures; no GPU/driver exercised · **Needs:** none ## Why Changing where the same downloaded archive is unpacked can leave an old tool installed. A matching archive digest alone does not mean the installed directory matches the requested prefix and destination. Tracker searched again on 2026-11-17: no matching issue found in the returned issue corpus for `stamp_of`, `extraction mapping` or `cache stamp`; this is an observational search, not a claim about hidden/deleted issues. No issue closure is claimed. ## How to reproduce **Seen on:** Linux and native Windows, offline fixtures; GPU and driver not involved. **Settings and switches:** Private synthetic fixtures; no game settings or GAME_PATHS inputs. **Steps:** Use tests/test_tools_stamp_mapping.py with a local cached tiny archive. Install it, keep its SHA unchanged, then change prefix or an already-existing destination in the fixture lock and install again. Run `python -I -B -m unittest discover -s tests -p test_tools_stamp_mapping.py` against baseline production plus the added tests, then the combined candidate. **Expected:** A changed extraction mapping causes reinstallation; an identical complete stamp remains a no-op. **Actual:** The SHA-only reuse check keeps stale content even though both CLI invocations exit 0. ## What changed Compare the complete serialized (sha256, prefix, dest) stamp before reuse. Preserve SHA/None for existing two-argument stamp_of callers and retain the legacy behavior for absent/blank stamps. The patch is limited to the following production/test pair, both Git mode `100644`. - Production: `scripts/tools.py` — stamp_of() and install(). - Regression coverage: `tests/test_tools_stamp_mapping.py` — supported failure and neighboring controls. Rebased onto main `544229a260c5f5008f241b9cf48ae6b01c1602b9`. Test-only commit: `9755194deb04603727ff643145f961ae5796d75d`. Final fix head: `66f3797003c9d726e05d436f76e354a37892aca2`. Both changed files and Git modes are identical to the previously SPEC/QUALITY-reviewed source. Full tree/delta/parent-chain replay was independently verified; fresh normal qualification now uses this actual HEAD. ## Measurements Nothing to measure: this is an offline contributor-tool correctness fix, not a gameplay, rendering or performance change. ### Flags and settings None ## Testing **Tested:** The retained Linux focused closure passed 35 unique methods (6 new mapping, 15 lock and 14 Linux-caller methods); the six new methods make 20 CLI calls, not 20 extra tests. The native Windows focused run passed all 6 new methods and 20 internal CLI calls, native exit 0, complete raw streams and Job final 0. It uses authored local `linux-x64` archive data on Windows, not an installed Windows SDK. That native receipt was acquired at the original head `f674c0a3f17625365e32b84fd185e87abdc63caf`; the production/test bytes, modes and dependency closure used there are unchanged by this rebase. It is retained evidence, not a new Windows run. The actual offline regression is behavioral: baseline reuse returns exit 0 but keeps the wrong prefix/destination payload; final source installs the requested payload. Baseline Windows completed 6 methods with 5 failures and one unsupported baseline `stamp_of(full=True)` TypeError; this is not a missing-dependency/setup RED. The original observer-aborted attempts are not counted as product results. Fresh normal Linux qualification on the pinned current base and actual rebased candidate used `python -I -B tests/run_all.py --jobs 2 --junit ...`, identical interpreter/environment policy and real Git HEAD/index: - Main @ `544229a260c5f5008f241b9cf48ae6b01c1602b9`: 721 checks, 571 PASS / 42 FAIL / 108 SKIP, native exit 1. - This PR @ `66f3797003c9d726e05d436f76e354a37892aca2`: 722 checks, 572 PASS / 42 FAIL / 108 SKIP, native exit 1. - The added passing check is `tests/test_tools_stamp_mapping.py`. All 721 common statuses, skip reasons and complete failure payloads agree after narrowly recorded diagnostic-noise handling: owned source/run paths, source-proven temporary file/directory suffixes, unittest elapsed times, one GCC intermediate object and one synthetic-fixture backup directory. Assertion values, failure identities, symbols, numeric offsets and statuses are not normalized. The GCC/linker error still names `choose_face`, `hos_options_file`, `.text+0xa1a` and exit 1; a separate retained compiler/assembler/linker trace proves this toolchain's temporary-object provenance. No universal no-regressions claim. - Tracked source bytes/modes remained unchanged; each owned process group was absent at completion. Exports omit the protected repository instruction file: this is source-only qualification, not literal-checkout or hosted-CI equivalence. The earlier source-only baseline lacking Git metadata and the historical night's strict-false comparison are retained separately, not relabelled as passing results. The 42 normal failures also observed on this current-main qualification are named here, as the template permits; the normal suite is **not green**: - `tests/test_bug_report.py` - `tests/test_bug_report_defaults.py` - `tests/test_cpu_report.py` - `tests/test_crash_groups.py` - `tests/test_crt_options.py` - `tests/test_damage_debug_menu.py` - `tests/test_discover.py` - `tests/test_display_startup_failure.py` - `tests/test_dlss_feature_size.py` - `tests/test_failed_compile_keeps_objects.py` - `tests/test_framegen_preset.py` - `tests/test_guest_imported.py` - `tests/test_hardware_report.py` - `tests/test_hud_layout_row.py` - `tests/test_invalidate_vcore.py` - `tests/test_lift_lookups.py` - `tests/test_link_skip.py` - `tests/test_linux_pressure.py` - `tests/test_linux_update.py` - `tests/test_longshot_saves.py` - `tests/test_mirror_budget.py` - `tests/test_missing_nup.py` - `tests/test_mods_size_table.py` - `tests/test_pending_guest_import.py` - `tests/test_pipeline_play_cache.py` - `tests/test_present_thread.py` - `tests/test_profiling_mode.py` - `tests/test_readback_timeout_source.py` - `tests/test_renderer_new_handler.py` - `tests/test_rumble_menu.py` - `tests/test_run_all_changed.py` - `tests/test_slow_frames.py` - `tests/test_switch_table.py` - `tests/test_target_image_pool.py` - `tests/test_tested_configurations.py` - `tests/test_upscaler_round_trip.py` - `tests/test_upscaler_rows.py` - `tests/test_vcore_escape.py` - `tests/test_vk_occlusion_queries.py` - `tests/test_vk_swapchain_compat.py` - `tests/test_walk.py` - `tests/test_walk_key.py` **Not tested:** Full Windows suite, real SDK/release installation, gameplay/GPU and a hosted-CI-equivalent checkout. These are not claimed, and no game/runtime files are changed. Hosted checks on the final public head are tracked separately; readiness is not maintainer approval or merge eligibility. **Must be tested:** None additional for this two-file contributor-tool change. The normal-runner exception is explicitly limited to the named current-main failures above, with source-only context disclosed; it is not a waiver for a new candidate failure or an unknown comparison. ## Risks **What could break:** Tool reinstall decisions. Non-empty incomplete/corrupt/extra-field stamps intentionally reinstall; absent/blank stamps retain legacy behavior. Linux runtime SHA-only policy and pre-existing fetch/concurrency risks remain unchanged. **Turning it off:** Revert the fix and its associated test commit. **Compatibility:** No game runtime, saves, options, shader/pipeline cache or vk ABI changes; only the stated contributor-tool behavior changes. No GAME_PATHS directory is touched and no in-game run is claimed. ## Checklist The normal runner remains native exit 1; its named current-main failures use the template's explicit exception, not a full-suite PASS claim. Tracker search and the GPL-3.0-or-later diff/provenance check are complete. No incompatible dependency, third-party code, dump or decompiled/generated game content is introduced. ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. The retained RED uses identical baseline production and regression-test bytes; the rebased normal run verifies the final source on the current-base context. No host C/C++, shader, game switch or visible-game change applies.
Assisted-by: Hermes Agent (OpenAI GPT-6.1-sol)
Co-Authored-By: Claudia (OpenAI GPT-6.1-sol)
fix(tools): bind cached installation to extraction mapping
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
f674c0a3f1
Assisted-by: Hermes Agent (OpenAI GPT-6.1-sol)
Co-Authored-By: Claudia (OpenAI GPT-6.1-sol)
NitnekLeBorgne force-pushed fix/tools-stamp-mapping-20261117 from f674c0a3f1
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 66f3797003
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
2026-11-17 12:00:28 +00:00
Compare
Author
Contributor

Rebased onto main 544229a260c5f5008f241b9cf48ae6b01c1602b9, preserving both reviewed file bytes and modes. The new head is 66f3797003c9d726e05d436f76e354a37892aca2. Fresh source-only Linux normal qualification is 572 PASS / 42 named FAIL / 108 SKIP versus current main 571 / 42 / 108; both native exit 1. The added mapping check passes and the common diagnostics match after documented temporary-path/timing handling, without hiding assertion values or linker symbols. The description now records all 42 baseline failures and the qualification limits. The earlier native Windows six-method proof applies to the unchanged production/test closure; no new SDK/game/full-CI result is claimed.

Rebased onto main `544229a260c5f5008f241b9cf48ae6b01c1602b9`, preserving both reviewed file bytes and modes. The new head is `66f3797003c9d726e05d436f76e354a37892aca2`. Fresh source-only Linux normal qualification is 572 PASS / 42 named FAIL / 108 SKIP versus current main 571 / 42 / 108; both native exit 1. The added mapping check passes and the common diagnostics match after documented temporary-path/timing handling, without hiding assertion values or linker symbols. The description now records all 42 baseline failures and the qualification limits. The earlier native Windows six-method proof applies to the unchanged production/test closure; no new SDK/game/full-CI result is claimed.
NitnekLeBorgne changed title from WIP: fix(tools): bind cached installation to extraction mapping to fix(tools): bind cached installation to extraction mapping 2026-11-17 12:10:06 +00:00
Owner

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).

  • Tested on my own PC: ticked: Testing's Tested: the author's own Linux run_all.py qualification on the rebased head, plus a Windows focused run of the new methods.
  • Nothing gets worse that I know of: ticked: Measurements say nothing to measure for this offline tool fix, and Risks names no speed, latency or memory cost.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#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). - *Tested on my own PC*: ticked: Testing's Tested: the author's own Linux run_all.py qualification on the rebased head, plus a Windows focused run of the new methods. - *Nothing gets worse that I know of*: ticked: Measurements say nothing to measure for this offline tool fix, and Risks names no speed, latency or memory cost.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/tools-stamp-mapping-20261117:NitnekLeBorgne-fix/tools-stamp-mapping-20261117'
git switch 'NitnekLeBorgne-fix/tools-stamp-mapping-20261117'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1311
No description provided.