Commit Graph
218 Commits
Author SHA1 Message Date
Valiantsin DzerakhandClaude Opus 5.5 3c5ae12830 Merge pull request #1393: build_game.py quotes command arguments with shlex on non-Windows hosts and passes the linker map path through cmd_arg and -Xlinker on both platforms (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:18:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 da27398c5f Merge pull request #1405: ab_summary.py prints n/a for the replay change when side A averages 0.00 ms instead of dividing by zero (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:18:18 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4cfb2e82c4 Merge pull request #1403: perf_summary.py reports FPS as total frames over total window time instead of the mean of per-window FPS (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:18:12 +03:00
Valiantsin DzerakhandClaude Opus 5.5 480ccec4b1 Merge pull request #1398: run_game.py rejects a profile copy that overlaps the original and a --tag with path separators, and stops a still-running child before deleting its profile (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:17:37 +03:00
Valiantsin DzerakhandClaude Opus 5.5 0deeb914cf mods_romfs_check tests the kept resource size table across starts
With restbl_cache = 1 on the restbl mods: built on the first start, served on the second with the same bytes, built
again after a rewritten mod file, an added or removed mod, another order and a new totk.exe, and after a torn or
random key file and a damaged or missing table. With the default 0 the key is neither read nor written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:51:02 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1b303282a3 Merge pull request #1372: the shader-cache packer reads the loose files on up to 8 threads (half the logical CPUs, 1 below 512 MiB free memory, 32 MiB read ahead, serial reads on any failure), with a byte-identical pack (ShannoonRuaaa)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:24:38 +03:00
Valiantsin DzerakhandClaude Opus 5.5 f1ec56b592 Merge pull request #1245: AMD FSR 4 upscales the 3D scene on Windows through AMD's signed FSR SDK 2.4 libraries (scene_upscaler = fsr4, off by default), and the setup can download them (codexx-dev) (#1409)
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object
motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its
FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources.
Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays
off with a log line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:39:08 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c581b779fa Size the shader cache readers for the machine and fall back to serial reads on any failure
pack_shader_cache.py picked 8 readers on every machine. It now takes half the logical CPUs, 1 to 8, so a 1- or
2-CPU PC reads one file at a time, and reads serially with less than 512 MiB free RAM (tools/hostmem.py, as the
compile and lift workers use). --read-workers still overrides; the log names the choice.

The read-ahead is also capped at 32 MiB of file data by the listed sizes, beside the two files per reader; a file
larger than the cap is read alone.

Any failure of the parallel path (a thread that does not start, a MemoryError in a reader, an executor error) prints
a line and reads the remaining files serially, so the pack still completes with the same bytes.

Tests cover the worker choice, the byte cap and the three fallbacks, each giving the same pack as a serial run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:27:09 +03:00
Valiantsin Dzerakh a80cb1e35d Merge PR #1372 head into task/pr1372 2026-11-23 14:20:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 be98dbc336 Merge pull request #1245: AMD FSR 4 as a fourth scene upscaler, scene_upscaler = fsr4 (codexx-dev)
The PR's FSR 4 path (runtime/vk_ffx.c over AMD's FSR SDK 2.4 signed libraries, ffx_api_min.h, the cooperative
matrix and float8 device extensions in vk_device.c), its setup step that downloads amd_fidelityfx_loader_vk.dll and
amd_fidelityfx_upscaler_vk.dll, its notices and the FXAA copy shader hash 0x9d065204aac9766b now serve dev's own
scene upscaler as UPSCALER_FSR4. FSR 4 goes through vk_dlaa.c fsr_evaluate beside FSR 3.1: the same frame point,
jitter, motion vectors with the per-object pass, camera from vk_fg_camera, mip bias, fsr_sharpness, FXAA skip and
dynamic resolution hold.

Dropped from the PR: the dlaa_backend setting, FSR 3 through the DLL and the separate Upscalers row. vk_ffx.c pins
FSR 4 only; a device the libraries offer no FSR 4 for runs with the upscaler off and the menu says so. It keeps one
context per output size with dynamic resolution, like vk_fsr3.cpp, waits on the SDK's ring depth and is released
before the device goes. The menu's scene upscaler row gets "AMD FSR 4" (Windows; marked when the libraries or the
GPU are missing). The setup's FSR box and its strings are in all eleven installer catalogs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:13:20 +03:00
kaiyao7 7e54200454 extract.py: --skip-base-romfs leaves out the 17 GB base RomFS that nothing reads
The extraction writes build/extracted/v0/romfs/romfs.bin (17 GB) and no other
tool in the repository reads it: build_game.py, gen.py, prepare_shaders.py and
package_build.py all take the version's own directory, and merge_update_romfs
takes the base Program NCA from the base game file itself and verifies all six
IVFC levels of what it merges.

The base game's ExeFS still decides the file is TotK 1.0.0, so damage is still
found, only later, with a message that names the damaged file.

The flag is off by default: a run without it extracts and checks as before.
2026-11-23 16:23:55 +08:00
Valiantsin DzerakhandClaude Opus 5.5 3fe8d7a1d9 Mod plugins that hook the middle of game functions, swap pointers in the game's data, use the SD card or switch their hooks during play build in, and may call what the game itself calls; Zonai Fieldworks starts (#1388)
Zonai Fieldworks was refused at several steps; each is now handled:
1. The start-up asked GetInfo 6, 7, 16 and 17 and SetHeapSize; runtime/plugin_init.c serves them.
2. Its start-up calls main where the lift has no function start. The tool names those addresses (--entries-out) and
   the installer lifts again with them as `entry` lines, up to four rounds (installer/steps.py PLUGIN_ENTRY_ROUNDS).
3. Branch hooks into the middle of game functions (far-jump veneers) and pointer swaps in main's data are accepted
   hook kinds; the veneer targets seed the plugin's lift, and an Orig trampoline counts as a seed.
4. Code the start-up writes into the plugin's own .text (hook pads it switches to during play) is found by comparing
   the image before and after the init, and seeds the lift (init_code). Without it the game stopped with "no function
   at guest pc" when a feature switched on.
5. recomp/gen.py: a branch-out alternative on a flag-writing site leaves with the flags from before the site; an inline
   hook may sit on a blr.
6. nn::fs::MountSdCard mounts <profile>/sdcard (runtime/fs_host.c), and nn::settings language codes are answered
   (runtime/ov_system.c).

The import check now also allows what the game's main imports (--exefs, game_imports): the game runs on those paths,
so the runtime serves them. Left out: nn::ro, the C runtime start, the thread-local allocator hook and the shader
compiler. Break in code the hooks reach is allowed (an abort ends the game with the reason, as on the Switch), and
RenameFile, DeleteDirectoryRecursively, Commit and Unmount join the SD card calls. Checked: Zonai Fieldworks, The Second
Quest, Challenge Mode and Material Columns on 1.4.3, Full Inventory Expansion, Quick Weapon Durability and Magic of the
Kingdom on 1.2.1 accepted; UltraCam's init still crashes its service run. Plain lift unchanged; probes 4/4 on both
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:35:59 +03:00
Valiantsin DzerakhandClaude Opus 5.5 c603112fca The plugin check accepts exlaunch's exl_inline_hook_with_fp_impl, the inline-hook entry that saves d0..d15 next to x0..x29. Magic of the Kingdom's hook stub calls it and was refused for it (#1388)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 08:40:59 +03:00
ICUMADETHIS 1b573e00bf Handle zero replay baselines in A/B reports 2026-11-22 20:58:26 +00:00
ICUMADETHIS 7d740a0083 Quote the literal linker map path on both platforms 2026-11-22 20:50:31 +00:00
ICUMADETHIS a37f7d8f15 Compute benchmark FPS from the combined window duration 2026-11-22 20:46:59 +00:00
ICUMADETHIS d7c408c4d7 Stop interrupted runs before removing their profile copy 2026-11-22 19:43:19 +00:00
ICUMADETHIS 767f2f6663 Protect the original profile during scripted runs 2026-11-22 19:37:46 +00:00
ICUMADETHIS 2acefbe473 Place command tests beside the other build checks 2026-11-22 19:25:14 +00:00
ICUMADETHIS 9e732f0096 Quote Unix build arguments before Ninja escaping 2026-11-22 19:17:05 +00:00
Valiantsin Dzerakh 0e810f429a Merge branch 'dev' into task/tramp 2026-11-22 16:42:36 +03:00
Valiantsin DzerakhandClaude Opus 5.5 3c62640d80 Flags pass between a mod plugin's code and the game as on the Switch: exlaunch's inline hook saves no NZCV, so a hooked site goes on with the flags its callback left. Challenge Mode's hooked b.eq sites follow its version check (#578, #1360)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:42:31 +03:00
Valiantsin Dzerakh 18ce808d03 Merge task/pr1363 into task/pr1357 2026-11-22 16:21:08 +03:00
Valiantsin Dzerakh d6b484a5c9 Merge task/pr1362 into task/pr1357 2026-11-22 16:21:03 +03:00
Valiantsin Dzerakh 3fd3eb7be9 Merge PR 1357 2026-11-22 16:17:39 +03:00
Valiantsin Dzerakh 2bfde7ac0c Merge PR 1363 2026-11-22 16:17:00 +03:00
Valiantsin Dzerakh cfbfa70c63 Merge PR 1362 2026-11-22 16:14:22 +03:00
Valiantsin DzerakhandClaude Opus 5.5 57137cb108 Merge pull request #1355: the setup reads output_res, prompts, pad_layout and hud_width with the game's INI rules (quotes, last non-empty value), so it prepares the layouts the game will use (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:17 +03:00
Valiantsin DzerakhandClaude Opus 5.5 85c0de3aa3 Merge pull request #1352: the installer reads and rewrites the last non-empty lang setting in totk.ini, as the game does (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:16 +03:00
Valiantsin DzerakhandClaude Opus 5.5 9812378665 Merge pull request #1350: the installer rejects a state file with malformed fields as unreadable before prefill and resume, instead of a traceback (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:15 +03:00
Valiantsin DzerakhandClaude Opus 5.5 af60f6a062 Merge pull request #1349: the shader-cache packer checks a pack's entry count and index size against the runtime's limits before it reads the index, and rebuilds a broken pack from the loose files (ICUMADETHIS)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:13:14 +03:00
Valiantsin DzerakhandClaude Opus 5.5 589bd9e08f A block that decompresses to the wrong size is a damaged file again, so the installer asks for a fresh copy
The size check added in this pull request raised a plain ValueError, which the installer maps to
check.unpack_failed. Before it, such a block ended in a hash or length mismatch and the player saw
check.input_damaged. ncz.unpack_ncz now turns the new BlockSizeError into DamagedFile, like ZstdError and EOFError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:11:48 +03:00
Ruan Shannon b4dcc3431f tools/pack_shader_cache.py reads the loose files with 8 bounded readers
pack() read every loose file one after the other. On Windows each open costs milliseconds (the antivirus scans it), so
folding a fresh cache was dominated by waiting: 12000 loose files took 79-90 s. The files are now read ahead by a pool
of 8 threads (--read-workers, 1..16; 1 reads serially), at most twice that many in flight, and written in the same
sorted order, so the pack is byte-identical. 12000 files: 18-20 s. The CLI prints read and cleanup progress every 5 s.
tests/pack_shader_cache_test.py checks parallel against serial packs, fresh and incremental, and the bounded read-ahead.
2026-11-22 05:10:48 -08:00
Valiantsin Dzerakh 936b0e264c Merge pull request #1355 head 2026-11-22 16:05:01 +03:00
Valiantsin Dzerakh 516b1d2ab5 Merge branch 'pr1351-head' into task/pr1351 2026-11-22 16:04:59 +03:00
Valiantsin Dzerakh 0894366f29 Merge pull request #1352 head 2026-11-22 16:04:58 +03:00
Valiantsin Dzerakh ea3c78de37 Merge pull request #1350 head 2026-11-22 16:04:46 +03:00
Valiantsin Dzerakh 7949484a40 Merge pull request #1349 head 2026-11-22 16:04:43 +03:00
Valiantsin DzerakhandClaude Opus 5.5 b61b2b0922 The plugin check accepts the .quad exlaunch writes for a backward b.cond, cbz or tbz: its relocation drops the offset's sign. Challenge Mode's two backward b.eq hooks were refused for it (#578)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:03:48 +03:00
Valiantsin DzerakhandClaude Opus 5.5 4c4d1310a5 A quoted plugin image path that is empty is a patch table error with its line, not a read of the folder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:02:34 +03:00
Valiantsin Dzerakh 2593618a65 Merge branch 'pr1356-head' into task/pr1356 2026-11-22 15:59:02 +03:00
Valiantsin Dzerakh f8eabdad46 Merge pull request #1367 head 2026-11-22 15:50:35 +03:00
Valiantsin DzerakhandClaude Opus 5.5 d181714398 The installer stops with the crashing Vulkan layer named instead of going on with a warning (#1345)
A layer that crashes hostcheck at vkCreateInstance also breaks totk.exe --prepare-shaders in the prepare step and the
game (runtime/vk_device.c create_instance loads the same implicit layers): with the PR's warning the install failed
again after lift and compile. Check.probe_host now turns each listed implicit layer off alone, names the one whose
absence lets the probe pass with its manifest path in check.vulkan_layer_crash, and says how to turn it off
(VK_LOADER_LAYERS_DISABLE=<name> for the user account); when no single layer explains it, check.vulkan_layers_crash
lists the installed ones and offers ~implicit~. The list covers the loader's places: VK_(ADD_)IMPLICIT_LAYER_PATH, the
registry in the 64-bit view or the Linux implicit_layer.d folders, with names read from the manifests. A failed host
check is kept on the context, so key() and run() no longer build and crash it twice, and the App Control reputation
codes 4557-4559 and 4581-4583 count as a block too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:49:04 +03:00
Valiantsin Dzerakh 08e44f43ad Merge pull request #1361: Installer host check survives a crashing Vulkan layer and explains an App Control block (ShannoonRuaaa) (#1345, #875) 2026-11-22 15:37:53 +03:00
Valiantsin DzerakhandClaude Opus 5.5 1c2a0e5a33 The plugin check accepts exlaunch's long trampolines: a hooked tbz, cbz, b.cond, adr, adrp, load literal or far b/bl whose relocation takes several words, and the jump back by ldr x17/br x17. Challenge Mode's plugin was refused at its tbnz site (#578)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:31:30 +03:00
ICUMADETHIS 5bbd461d35 Keep installer actions visible on small screens (#744) 2026-11-22 12:26:32 +00:00
Ruan ShannonandClaude Opus 5.5 78f8362a9e tools/build_game.py sizes the compile jobs by the free memory too
The budget was the smaller of 50 GiB and 80% of the RAM, so RAM that other programs held counted as available: on a
16 GiB laptop with 2 GiB free it allowed 16 jobs of JOB_MEM (12 GiB), and the compile paged or a job ran out of
memory. compile_budget also takes 80% of hostmem.available_ram (free physical memory, capped by a job memory limit),
as recomp/gen.py already does for the lift workers; off Windows, where that is unknown, the budget is as before. The
build prints the budget and the free memory it saw. tests/compile_budget_test.py covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:19:44 -08:00
Ruan ShannonandClaude Opus 5.5 e18eb68b6d tools/check_isa.py scans the instructions of linked images too
An instruction line of llvm-objdump starts with its address: short and indented in an object, 9+ hex digits at the
start of the line in a linked .exe or .dll. The scan kept only lines with leading whitespace, so it skipped every
instruction of a linked image and reported it clean, although the usage line names executables. It now keeps lines
that start with an address. tests/check_isa_test.py covers both forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:17:23 -08:00
Ruan ShannonandClaude Opus 5.5 d240181005 The installer's host check survives a crashing Vulkan layer and names an App Control block
hostcheck flushes what it found before each Vulkan call, so a probe killed inside Vulkan still shows how far it got.
Check.probe_host logs the exit code as Windows reports crashes (0xC0000005), runs a probe that died inside Vulkan once
more with the implicit layers off (VK_LOADER_LAYERS_DISABLE=~implicit~) and, when that passes, goes on with a warning
that lists the installed implicit layers; when it crashes again it stops with check.vulkan_crash. A probe Windows
refuses to start (Smart App Control and other App Control policies, group policy, an antivirus) now stops with
check.host_blocked instead of an uncaught OSError. Issues #1345 and #875.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:10:51 -08:00
ICUMADETHIS 7b53833a04 Run standalone regression suites with their prerequisites 2026-11-22 08:59:49 +00:00