WIP: fix(build): honor selected external hot-function profiles #754

Draft
siantm wants to merge 1 commit from siantm/Longshot:fix/external-hot-profile into main
First-time contributor

Type: fix · Risk: low · Tested on: Windows 11 Pro 26300, game-free · Needs: complete game-free suite and Linux verification

Why

An explicitly selected hot-function profile can silently lose to the build folder's default list. Editing an external profile at the same path can also reuse a translation produced from its old contents.

How to reproduce

Seen on: Windows 11 Pro 26300, Python 3.14.7; no GPU or game used.
Settings and switches: external or explicitly empty A64_HOT_FUNCS with a different default work/hot_funcs.txt.
Steps: Run the two selected override-consumer tests in tests/test_make_game_cache.py against main using its LONGSHOT_CACHE_TEST_SOURCE override, then against this branch. Run check_selected_hot_list() from tests/test_lift_cache.py against each implementation.
Expected: the chosen list controls the real lifter consumer; empty disables it; editing selected contents invalidates the translation.
Actual: main selects the default list for both overrides and does not invalidate on external-file edits.

What changed

Preserve explicit profile selection, including an empty value, and hash the selected profile's contents. Resolve relative profiles from the translation child's checkout root.

  • nx2/make_game.py: override precedence and selected-content lift-key inputs.
  • Tests exercise real environment merging, a64_lift.hot_functions(), cache invalidation, and cross-folder reuse.
  • Bind the cache fixture's real shipped-profile lookup to its authored checkout and close only its owned Windows lock. The profile-isolation part overlaps the fixture prerequisite in #592.
  • Scope is distinct from environment-key cleanup in #22 and profile-path object keys in #660.

Measurements

Verdict: the authored regressions fail on main and pass with the fix. No FPS claim.
Hardware: Windows 11 Pro 26300, Intel Core i7-9700, 31.8 GiB usable RAM; pinned Python 3.14.7; no GPU work.
Method: identical authored consumer/cache cases against main and the prepared branch.

Check Before: main @ 9e6f231d After: this PR @ b6d9ad2af4
External override and explicitly empty override Both fail: default function selected Both pass
Selected file edited at the same path Cache key incorrectly retained Lift-key regression passes
Complete cache/consumer driver Not claimed as a baseline full-driver result 19 pass, 1 platform skip

Observed: FAIL: editing the same external profile path changes the key on main; main's two consumer assertions select f_80000000 rather than the authored external function/empty set. Patched driver: Ran 20 tests ... OK (skipped=1). Lift-key and cross-folder lift-store drivers pass. These checks ran on the source snapshot committed as b6d9ad2af4 before browser submission; no generated game files are included.

Flags and settings

A64_HOT_FUNCS: previously the builder's default list could override an explicit setting; now explicit selection wins, empty disables it, and unset retains existing behavior. No new switch/default or runtime quality change.

Testing

Tested: focused lift-key, complete cache/consumer, and lift-store drivers; authored baseline failure proofs. New run fragment is accepted by the actual tested-configurations renderer.
Not tested: complete suite, native Linux, or an actual game build. The independent tested-configurations unit driver has a Windows CRLF-vs-LF pipe-fixture failure; it is not reported as passing.
Must be tested: complete game-free suite on Windows and Linux, with source commits recorded, before readiness; by hand or the project's Test Farm. No runtime performance claim is proposed.

Risks

What could break: profile selection or cache invalidation could reuse the wrong translated code.
Turning it off: revert the fix or leave the existing override unset.
Compatibility: selected translation inputs can intentionally cause one retranslation. Saves, settings, shader/pipeline cache formats, renderer ABI and tools are unchanged.

Checklist

Everyone

  • One topic.
  • Conventional Commit title: fix(build): honor selected external hot-function profiles.
  • Matching issue search completed; related open PRs reviewed, remaining issue search pending publication.
  • Measurements state the observed verdict and exact limitations.
  • Testing distinguishes tested, untested and required work.
  • Based on current main 9e6f231d, confirmed by the upstream compare page.
  • Complete tests/run_all.py result recorded; not run.
  • No game files, dumps, generated game files or build output.
  • Third-party sources untouched.
  • Existing Longshot source and authored fixtures; GPL-3.0-or-later.

When it applies

  • Source commit records Assisted-by: OpenAI Codex.
  • Existing switch behavior documented.
  • Observed run recorded under docs/tested/.
  • Behavioral regression fails on main and passes here.
  • Development documentation updated.
**Type:** fix · **Risk:** low · **Tested on:** Windows 11 Pro 26300, game-free · **Needs:** complete game-free suite and Linux verification ## Why An explicitly selected hot-function profile can silently lose to the build folder's default list. Editing an external profile at the same path can also reuse a translation produced from its old contents. ## How to reproduce **Seen on:** Windows 11 Pro 26300, Python 3.14.7; no GPU or game used. **Settings and switches:** external or explicitly empty `A64_HOT_FUNCS` with a different default `work/hot_funcs.txt`. **Steps:** Run the two selected override-consumer tests in `tests/test_make_game_cache.py` against main using its `LONGSHOT_CACHE_TEST_SOURCE` override, then against this branch. Run `check_selected_hot_list()` from `tests/test_lift_cache.py` against each implementation. **Expected:** the chosen list controls the real lifter consumer; empty disables it; editing selected contents invalidates the translation. **Actual:** main selects the default list for both overrides and does not invalidate on external-file edits. ## What changed Preserve explicit profile selection, including an empty value, and hash the selected profile's contents. Resolve relative profiles from the translation child's checkout root. - `nx2/make_game.py`: override precedence and selected-content lift-key inputs. - Tests exercise real environment merging, `a64_lift.hot_functions()`, cache invalidation, and cross-folder reuse. - Bind the cache fixture's real shipped-profile lookup to its authored checkout and close only its owned Windows lock. The profile-isolation part overlaps the fixture prerequisite in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/592. - Scope is distinct from environment-key cleanup in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/22 and profile-path object keys in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/660. ## Measurements **Verdict:** the authored regressions fail on main and pass with the fix. No FPS claim. Hardware: Windows 11 Pro 26300, Intel Core i7-9700, 31.8 GiB usable RAM; pinned Python 3.14.7; no GPU work. Method: identical authored consumer/cache cases against main and the prepared branch. | Check | Before: main @ 9e6f231d | After: this PR @ b6d9ad2af4 | |---|---|---| | External override and explicitly empty override | Both fail: default function selected | Both pass | | Selected file edited at the same path | Cache key incorrectly retained | Lift-key regression passes | | Complete cache/consumer driver | Not claimed as a baseline full-driver result | 19 pass, 1 platform skip | Observed: `FAIL: editing the same external profile path changes the key` on main; main's two consumer assertions select `f_80000000` rather than the authored external function/empty set. Patched driver: `Ran 20 tests ... OK (skipped=1)`. Lift-key and cross-folder lift-store drivers pass. These checks ran on the source snapshot committed as b6d9ad2af4 before browser submission; no generated game files are included. ### Flags and settings `A64_HOT_FUNCS`: previously the builder's default list could override an explicit setting; now explicit selection wins, empty disables it, and unset retains existing behavior. No new switch/default or runtime quality change. ## Testing **Tested:** focused lift-key, complete cache/consumer, and lift-store drivers; authored baseline failure proofs. New run fragment is accepted by the actual tested-configurations renderer. **Not tested:** complete suite, native Linux, or an actual game build. The independent tested-configurations unit driver has a Windows CRLF-vs-LF pipe-fixture failure; it is not reported as passing. **Must be tested:** complete game-free suite on Windows and Linux, with source commits recorded, before readiness; by hand or the project's Test Farm. No runtime performance claim is proposed. ## Risks **What could break:** profile selection or cache invalidation could reuse the wrong translated code. **Turning it off:** revert the fix or leave the existing override unset. **Compatibility:** selected translation inputs can intentionally cause one retranslation. Saves, settings, shader/pipeline cache formats, renderer ABI and tools are unchanged. ## Checklist ### Everyone - [x] One topic. - [x] Conventional Commit title: `fix(build): honor selected external hot-function profiles`. - [ ] Matching issue search completed; related open PRs reviewed, remaining issue search pending publication. - [x] Measurements state the observed verdict and exact limitations. - [x] Testing distinguishes tested, untested and required work. - [x] Based on current main 9e6f231d, confirmed by the upstream compare page. - [ ] Complete `tests/run_all.py` result recorded; not run. - [x] No game files, dumps, generated game files or build output. - [x] Third-party sources untouched. - [x] Existing Longshot source and authored fixtures; GPL-3.0-or-later. ### When it applies - [x] Source commit records `Assisted-by: OpenAI Codex`. - [x] Existing switch behavior documented. - [x] Observed run recorded under docs/tested/. - [x] Behavioral regression fails on main and passes here. - [x] Development documentation updated.
fix(build): honor selected external hot-function profiles
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 / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (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 15s
Website / Website on Cloudflare (pull_request_target) Has been skipped
b6d9ad2af4
Extracted the focused local fixes from 27674af1 and 4e19ef16. Preserve explicit profile selection and selected-content cache invalidation; include authored consumer regressions and observed verification limits.

Assisted-by: OpenAI Codex
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 / The same as upstream (pull_request) Blocked by required conditions
Third-party parts / As their notes say (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 15s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/external-hot-profile:siantm-fix/external-hot-profile'
git switch 'siantm-fix/external-hot-profile'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!754
No description provided.