Repository navigation
Conversation
Follow hckrman101's review of NotRexed#2270. A mod can ship several versions' size tables; do not seed the prompts' one-time merge from the first match in hash order. Use the game's RomFS table name, selected as the prompt-assets builder does, and look up the winning mod file exactly. Keep the merge and mod precedence unchanged. Made-up two-version tables cover both font-first and table-first opens. The branch passes with GCC and Clang; both orders fail on main. No game file is used by these fixtures. Assisted-by: GPT-6 Astra Co-Authored-By: GPT-6 Astra <noreply@openai.com>
|
Rebased |
bd4b1ec to
6cb337d
Compare
Joey-Magnus
left a comment
There was a problem hiding this comment.
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 same find() the RomFS open uses. Both orders now merge the same table, which fixes what hckrman101 pointed out on #2270. hos_mods_find has 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.
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:
python -I -B tests/test_mods_size_table.py --cc gcc python -I -B tests/test_mods_size_table.py --cc clang # In this checkout, against another checkout's unmodified host sources: python -I -B tests/test_mods_size_table.py --cc gcc --source /path/to/main/hostHow 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 noreply@openai.com