fix(mods): merge prompts with the game's resource size table #2592
Closed
mooki000 wants to merge 1 commit from
mooki000/fix/mods-opened-size-table into main
pull from: mooki000/fix/mods-opened-size-table
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
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/Hookshot!2592
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki000/fix/mods-opened-size-table"
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?
What this is for: keep controller-button prompts working when a RomFS mod includes resource size tables for more than one game version, following hckrman101's review of #2270. What is measured: on Linux, GCC and Clang both pass 12 file-routing cases and the existing merge checks, including seven malformed-table refusals; both new open-order cases fail against main
fce53453. Not measured: a new game run, Windows file enumeration, or any change to a normal single-table seed's gameplay.Problem
The reviewer noted that:
host/prompts.c::sizes()merges once and remembers the source file. If the font is requested first, the first matching mod table can belong to another game version: the real table is subsequently served unmerged alongside the larger font. In the opposite order, the real table is merged, but the font's check asks about the other table and disables the replacement font.The other review nit was about CI visibility, not another implementation change. At the 2026-11-11 17:13 CST check, #2270's check list still contained only two successful Conventional Commit title checks. That is not evidence that its GitHub regression suite ran. The current
.github/workflows/source-regressions.ymlalready runs all discovered checks for pull requests to main; this PR needs those checks approved and green before merge.What changed
host/prompts.c: discover the resource-table name in the game's own RomFS, using the same first-by-name rule asnx2/prompt_assets.py, before checking a mod's table for the font. This also works when the font is opened first.host/mods.c: replace the prefix/suffix hash-order search with an exact, case/slash-normalized lookup of that name. It uses the same winning indexed entry as the normal RomFS open path.tests/test_mods_size_table.py: add a second, wholly made-up table with different entries, exercise both table-first and font-first requests, and check both the returned files and merged bytes.--source <host-directory>runs the same fixtures against unmodified main.readme.md: explain which version's table is used.The merge algorithm, maximum-per-entry rule, malformed-table fallback, last-sorted-mod precedence and a mod's own font priority are unchanged. No game file or data made from the game is added.
How to try it
No switch or rebuild of a mod is needed. A mod containing two differently versioned size-table files should keep its matching table's entries and the controller font, irrespective of which file is requested first. The game-free reproduction is:
How it was tested
2026-11-11; Arch Linux, kernel
7.2.15-1-omarchy, Core i9-13900K; GCC 16.2.1 and Clang 23.1.3; deps Python 3.12 with-I -B. Basefce53453, branchfd017d3f. The machine was heavily loaded (load average about 287 during the focused checks). No GPU was used.Final branch:
bd4b1ec3, one commit on current mainef81aee7. The rebase fromfce53453was clean and its range-diff is=. Both compiler proofs, including the two failing open orders without the fix, were rerun after rebase; the relevant base host-source blobs are identical. The full-suite totals below are the recordedfce53453-based run, not a second full suite on the newer base.The focused runs after the rebase had load snapshots of 71.63 to 75.04.
Both compilers print:
Against the base, both compilers fail both new cases, rather than a source-text or compilation check:
The normal single-table cases still compare all merged bytes to the independent expected table. No new game run was made: the ordinary seed's merge and resource sizes are unchanged, and the changed source-selection case is fully made up in the fixture. This does not claim a new gameplay result.
The whole
tests/run_all.pysuite ran once, in the idle scheduling class:Load was 111.79 at its start and 92.91 at its end. The only failure is the unrelated main regression
test_env_on.py:HOS_FPS_LOG (host/oot_high_fps.c:15)still usesgetenv(...) != NULLafter #2470. That source and the guard test are unchanged here.test_updater_asset_digest.pypassed via this machine's fallback; it is not counted as a failure.coredumpctlreportedNo coredumps found.The same guard was then run against the untouched
fce53453checkout with GCC and Clang; both fail on that exactHOS_FPS_LOGline. This is the only remaining suite failure for B, not a mod-table regression.Before pushing: one commit on current main, the commit identity and trailers as the project asks, and no game file or build output among the four changed files. Rerun on the pushed head by me: the test with gcc and with clang passes, and against main's
host/sources it fails with both.Not tested
Risks
The font's initial preparation now enumerates the game's resource directory once per preparation rather than taking the first matching mod entry. It relies on
hos_romfs_dirbeing the game's RomFS. Unsupported/ambiguous base layouts need a separate version-selection decision; ordinary supported single-table layouts and the merge's bounds are unchanged.Overlaps
The final standalone overlap scan found 46 open PRs touching these files; the actual conflict hunks were read:
game_table; retain both helpers.string.hinclude. Keep its path changes and this exact-table selection.No separate claim issue: this is the review follow-up to #2270.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
Rebased
bd4b1ec3onto current main87991bc8as6cb337df. The declaration conflict keeps this PR's exact game-table lookup together with main's keyboard/XInput prompts; the native-Windows font fix and no-controller fixture repair remain. Merge/fallback rules, both open-order assertions and the original commit message/trailers are unchanged. All 21 selected checks passed with GCC and Clang, while the feature control failed on main; the suite was 469 passed / 1 inherited background-input fixture warning / 20 skipped. The last rebase adds only upstream #2671 and leaves every PR file byte-identical; size-table/prompt checks, final-main negatives, #2671's offline check and Windows-target syntax ran again, with zero syntax errors using the production zstd include. The final PR gate passes. The suite was not repeated; no new gameplay or native Windows execution is claimed. Sources: the #2592 evidence and final-handoff ledger above.I merged this into current main. tests/test_mods_size_table.py passes, including both new open orders, and so does tests/test_prompt_skip.py.
game_table()(host/prompts.c:1321) picks the game's table first-by-name, the same rule nx2/prompt_assets.py uses.hos_mods_file()(host/mods.c:200) then looks up that exact key through the samefind()the RomFS open uses. Both orders now merge the same table, which fixes what hckrman101 pointed out on #2270.hos_mods_findhas no other callers, so removing it is safe.FindFirstFileA on the RomFS path is fine on Windows because of the UTF-8 manifest (tests/test_utf8_paths.py passes), and on Linux it goes through host/posix like mods.c's existing scans. It runs once per font preparation, not per frame.
This will need care when #2478 (draft) is rebased, since it rewrites the same lookup. Your description already says so.