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>
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>
In a thunderstorm the world manager's lightning update (1.4.3 main+0x62aac4, 1.2.1 main+0xab849c) runs once per frame
and draws, each update, a random number in [0, 1) for each of three fixed chances: 0.013333 for a distant bolt (the
effect Far_Lightning), 0.01 to pick a near strike and 0.01 for the environment's lightning flag. Its timers follow the
frame step, the draws do not: above 30 fps a storm has more distant bolts and lightning flags the higher the frame
rate. The new set lightning (TOTK_LIGHTNING_FIX, lightning_fix, on by default) multiplies each chance by the time
object's frame ratio (+0x38), at most 1, on 1.2.1 and 1.4.3: above 30 fps the rates per second of 30 fps, and at 30 fps
and below the game's own chances.
Counted on 1.4.3 in the reporter's storm (205 s with the storm on, Link standing still) with a local build that logs
each draw that succeeds, which this change does not contain: distant bolts 22, 52 and 94 to 96 a minute at 30, 60 and
120 fps with lightning_fix = 0, and 26, 27 and 20 to 24 with lightning_fix = 1, each one a Far_Lightning effect; the
lightning flag 19, 34 and 64 to 80 times a minute of the storm's lightning phase with 0, and 12 to 17 with 1. Near
strikes stayed at 14 to 18 per run at every rate with either value: each lightning phase lets its last pick strike in
the phase after it, where nothing is drawn, and that phase ends with a strike of its own.
On 1.2.1, which the logging build does not cover, the distant bolts were counted in screenshots of a storm in Hyrule
Field (one every 0.2 s of game time, a detector of thin bright lines, each counted screenshot checked by eye at 30 fps
and at 120 fps with lightning_fix = 1, a sample of 48 with 0): 19 screenshots with a distant bolt a minute at 30 fps,
about 61 at 120 fps (105 to 107 fps in the storm) with lightning_fix = 0, and 15 with lightning_fix = 1. The same count
on the 1.4.3 runs gives 25 to 26, 65 to 68 and 16 to 20 a minute: at high rates it misses bolts that share a
screenshot.
Co-Authored-By: Claude <noreply@anthropic.com>
Without shadow storage a plain GPU copy back into a mirrored range lands after the game, told the value is done a
frame early, may have written other words of that range for the next frame; with TOTK_SYNC_AHEAD_WBMERGE (1 by
default) the copies' and updates' write-backs go through the word merge as a shader's do. With memory = import the
GPU reads vertex, index and storage data in place, and a check run on the islands saw the game rewrite about 10 KiB of
them a frame after the wait, so the switch is refused there unless shadow storage is on. --probe-vkmem checks the
pending-write list (newest writer below a bound, pruning, joining when full). The one-off readback rule copied from
Savage Wind gets its THIRD_PARTY_NOTICES.md row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With shadow off the back end turns on guards, each with its own switch: the mirror syncs copy the synced pages into staging on the CPU at submit and wait for an earlier write-back into the same range first (TOTK_SYNC_AHEAD_MSYNC), a texture the CPU rewrote takes the CPU deswizzle (TOTK_SYNC_AHEAD_DESWZ), an invalidate of a range not read lately waits for the pending GPU write into it, from a bounded list pruned at completion (TOTK_SYNC_AHEAD_READS), and the frame wait waits up to the value of a one-off small target (Savage Wind's 16-frame, 64-entry rule, TOTK_SYNC_AHEAD_ONESHOT) or, off by default, of a samples-passed report (TOTK_SYNC_AHEAD_QUERIES). TOTK_SYNC_AHEAD_CHECK=1 runs the check-mode detector with the late wait itself. The shadow form and the default are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A binding the replay resolves again in the same submission hits a per-thread table of the last notes, and the byte
compare walks the memory state once per union range instead of once per written page: the check's game-thread cost on
the islands bench went from 5-9 to about 3 ms a frame. The log line gives the notes taken and the time of each step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whether the game writes what the GPU still reads does not depend on this machine's timing, so check mode now takes the
late wait's value at every frame wait (the frames where the GPU really was behind are counted apart). The set's bytes
are copied at the snap: a written page counts its changed bytes too, and the mirror sync copies are narrowed to the
bytes the frame binds from the mirror (class bound), since a page written only outside them races nothing it reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The replay notes each GPU-timeline access of guest memory with its submission's value (in-place bindings of imported
pools without a mirror, mirror sync copies, GPU deswizzle sources, mirror write-backs); at the frame wait the notes of
the frame the late wait would leave running form its read set, snapped with the write watch and checked again at the
next frame-wait entry. Invalidates and small-target write-backs of GPU results from that frame count as stale
readbacks. One summary line per second and a run summary with the largest offenders by pool (runtime/vk_ahead.c).
--probe-vkmem checks the detector with a synthetic write after the wait; tests/sync_ahead_check.py checks that check
mode keeps the wait exact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TOTK_PERF_CENSUS=0 (perf_census in totk.ini) keeps TOTK_TRACE=perf and its frame lines but skips the write-watch
queries the census makes at every submit, so a perf trace on Linux measures the frame without them. On an LCD Steam
Deck at Lookout Landing (dev, three interleaved runs each) the census costs about 0.8 ms a frame: 38.0-38.3 fps with
it, 39.1-39.4 fps without, 1% low 30.5-31.5 against 32.1-33.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vk_objmv_wanted is FSR 3.1's latched upscaler half (DLSS with NGX up, or FSR 3.1 picked at start) or frame generation following the scene with its objects (vk_fg_objects_on), and vk_mvprev_frame turns the tables on for the running upscaler or for frame generation. vk_usnap.c keeps this branch's host regions: a region's host flag says whether this submission wrote its host copy, which covers frame generation going on and off live without fg's separate U.host pointer. The jitter fix in mv_pass stays a single copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Field still view, 28 s, TOTK_MVPREV_CHECK=1: mv_check 0 of 60 checks with over 0.5 % object pixels fit better by a variant; mv_prev intact 100 % in c5, c6, c7, c14, c15 and c16; 0 of 214238 last-frame copies differ from the neighbour copies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lifetime: a scene submission's arena (vk_usnap_scene, from the scene draws vk_mvprev notes) is kept at its vk_usnap_end as the last-frame copy instead of going to the free list at its fence. The next scene submission's end, or any end once the motion is off, hands the kept arena to the completion thread with that submission's fence, then keeps its own. The motion draws that bind the kept arena are listed and recorded within the next scene submission (vk_mvobj_execute drops a list of another fence), so the GPU has read it before that fence; the fences of one queue complete in order, so its own submission's reads are done too. One arena is held beyond those in flight, whatever the session length; vk_usnap_shutdown frees it with the others. A frame whose scene spans two submissions finds only the last one's blocks; the others keep the camera's motion.
TOTK_MVPREV_CHECK=1 still copies the neighbours and compares them with the kept copy. Field still view, 28 s: the mv_prev lines intact 100 % in c5, c6, c7, c14, c15 and c16; over whole blocks 87 of 218320 last-frame copies differ from the neighbour copy (the game changed the other copy after last frame's submit; the kept copy is what last frame drew); mv_check 0 of 60 checks with over 0.5 % object pixels fit better by a variant, object end-point error median 0.98 px against the camera's 1.27; the c7 lookups split as before (nearer to side 1.87, reference 1.83).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Taken from #497: the seven catalogs, the language choice in installer/guilogic.py and the launcher, the launcher header and bundle check in the release scripts, the tests. Added here: the ids dev and this branch gained since (kit, PC prompts and display shapes steps, the locked exe and skipped plugins messages, the form sections and More details), and new translations of the ids whose English changed after #497 was translated (NSZ and XCZ input, the missing shared fonts warning, the PlayStation prompts). README gains a Languages table that shows the menu in four languages.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Noting only the candidates' blocks was tried and dropped: the table then misses the other draws' blocks, a sixth of the c7 "nearer" picks became "side" ones, the copies mo_similar refuses doubled and the field still check got 5 of 60 checks with over 0.5 % object pixels fit better by a variant (0 before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since the jitter went into the game's camera (#1284), cam_unjitter writes the scene camera's snapshot back without it from the scene's end, before the DLSS point where vk_mvobj_execute redraws the moving objects through that snapshot. The draws rasterised unjittered and their fragment shader took the jitter off a second time. TOTK_MV_CHECK on a still Link (FSR 3.1 path, task/fsr31) measured the object part equal to the frame's jitter in every check; with the jittered rows written back around the motion draws and taken off after them, object pixels on a still Link fell from 1.2-2.1 % to about 0, and the object vectors beat the camera's (median end-point error 0.68 px against 0.88, before 0.93 against 0.82).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>