With it set, the mirror budget check and the texture pressure checks compare with at most that many MiB, so a large card behaves as a small one does when video memory runs low. The heap lines still log what the driver reports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every 600 frames with NX2NAVI_TRACE=perf: the live textures' own memory by kind (decoded ASTC as BC3 or RGBA8, other CPU-written, GPU-written) with the part no lookup reached for 240 submissions and 120 presents, entries sharing a storage address with another, the VkFormats holding the most and the largest entries; then the imported pools the GPU resolved and those it never did, and the VRAM mirrors idle for 120 submissions. Textures now carry the submission and present of their last lookup for it.
Measured with it (user's save, RTX 5090, 2560x1440 with DLSS performance, astc_bc = 1): in the world the live textures held 5,166 MiB (3456 decoded ASTC as BC3, 3438 MiB; 3412 other CPU-written, 965 MiB; 216 GPU-written, 763 MiB; 46 sharing a storage address, 115 MiB) and the mirrors 927 MiB, and of the 5,007 MiB of imported pools the GPU never resolved 4,077 MiB (3787 pools). With fine ASTC footprints kept as RGBA8 (the main checkout's uncommitted rule for astc_bc set by hand), decoded ASTC took 10,382 MiB instead of 3,438.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pad_layout = playstation plays a pad by label as xbox does, named for a PlayStation pad: cross A, circle B, square X,
triangle Y. The prompts follow it like the Xbox layout, by label. Under Automatic the note says PlayStation for a pad
whose bottom button is labelled cross. The layout description in each menu language now says what every choice does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Controls tab has a Button prompts row again, with Nintendo, Xbox and PlayStation. prompts = playstation is a new
value next to xbox; nintendo, xbox and pc read as before, and pc stays out of the row as nothing makes its files for
this game. The game reads its prompts at start, so the row says when a restart would change them.
tools/pad_prompts.py writes the overlay folders romfs-patches-xbox, -xbox-label, -playstation and -playstation-label
from the player's RomFS and a folder of button art that stays outside the repository. The button font's glyphs become
outlines traced from the art, the action prompt's letters and the ocarina's note buttons are painted again in their
own BC4 and ASTC formats, and the font's entry in the resource size table grows with it. The by-position folders show
Switch A as B or circle, the by-label ones as A or cross, following the pad layout. The settings probe checks the new
value and folder names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--probe-astc now runs cut-out mip chains through the BC3 encoder at all 14 footprints, linear and sRGB, plus two
chains large enough to take several scratch chunks: transparent and opaque patches of void-extent blocks, whose edges
cut through BC3's 4x4 blocks where the footprint's side is 5, 6 or 10, mixed with ASTC blocks whose alpha jumps from
transparent to opaque between neighbouring texels, down to 1x1. Alpha 0 and 255 must come out exact and every alpha
test at 1/4, 1/2 and 3/4 must keep its side outside the block's alpha step. The encoder passes on an RTX 5090, before
and after this change (418540 BC3 blocks across a transparent-to-opaque edge); an encoder that lets an opaque 255 drop
to 254 in an edge block passes the old bounds and fails the new check.
The encoder reads texel bytes as integers instead of through unpackUnorm4x8, so its alpha endpoints are the block's
exact least and greatest alpha on any GPU.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The event order (vk_exec.c) holds a submission at a wait whose signal has not been replayed. In Kokiri Forest dialogue several presents a second came with the frame's whole submission held (4 held submissions, nothing drawn since the last present): the present showed the picture from before, a flash of the whole picture, and the frame was drawn afterwards in the present thread's empty submission, next to the following frame. With the event order off (NX2NAVI_EVENT_ORDER=0) the same spot had no such frame in 3600.
present_held (vk_backend.c, synchronous replay only): at a present with held work, what can go on runs first in a submission of its own; if work is still held, the present waits and goes out after the submission that replays the last of it, at the next present, or after 8 submissions. present_held = 0 (NX2NAVI_PRESENT_HELD=0) turns it off.
held_sync (vk_exec.c vk_exec_record): a submission without commands of its own that resumes held work now gets the VRAM mirror sync before and the write-back after, and a uniform copy, like any submission. Before, that work read mirrors that had missed the CPU's latest writes, and its GPU writes were dropped from the write-back list by the next submission's vk_mem_mirror_begin. held_sync = 0 (NX2NAVI_HELD_SYNC=0) turns it off.
Not yet measured in play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In Kokiri Forest dialogue (Saria, dlss = performance) about 1 frame in 20 had no camera, and DLSS started a new history twice for each: 24 to 26 camera resets per 300 frames. The camera block was looked up in the uniform copy of the submission DLSS ran in, which on those frames had none: the frame's work had been held past its present by the event order and ran in the present thread's empty submission. vk_dlaa_draw now keeps the camera rows as the first scene draw read them (vk_usnap_read), and mv_pass uses those. A frame with no scene-context draw at all keeps DLSS's history with zero motion, for up to 6 frames in a row.
Measured at the Saria spot: camera resets went from 24 to 26 per 300 frames to none in 3600 frames (the first frame only). The whole-picture flashes stayed: they come from the presents that go out with that work held, handled separately.
The log now explains frames without a camera, frames without the DLAA point (with the held submissions at that present), light target changes and a second scene after DLSS ran, plus a line every 300 DLSS frames with resets. dlaa_cam_keep = 0 (NX2NAVI_DLAA_CAM_KEEP=0) restores the old camera handling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guest code runs ballots and shuffles where the guest compiler had the warp reconverged, for example right after a loop
each lane leaves at a different iteration. Vulkan only promises that with VK_KHR_shader_maximal_reconvergence, so
the pipeline code adds the extension and the MaximallyReconvergesKHR mode to every module that declares subgroup
capabilities. vk_reconverge = 0 in nx2navi.ini turns it off.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The payload size in an NVN2 task or mesh program header counts only the program's own data, which starts after a
24-byte header (the mesh count and two words the mesh program reads). The foliage task writes three 1024-byte arrays
from there, up to byte 3096 of a payload sized 3072, so the last entries of the third array were lost and its mesh
programs read past the end of their buffer. Those reads came back different on each run, so a few leaves of each dense
patch landed in different places in the depth pre-pass and the colour pass, and the colour pass's equal depth test left
them unpainted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The step sat at 0 % until it was done, an hour on some PCs, because nothing it ran reported progress to the launcher. nx2navi.exe --prepare-shaders now prints how many shaders it has translated and how many it has built into the driver's cache every 2 s. make_game.py reads them as they come and fills the bar, the translation the first half and the build the second, with the counts in the step's text. An event every 10 s keeps the text current while nothing is printed, and after 3 minutes without a count moving it says so, and that the step is still running.
The selftest draws the step as a tenth screen. Its made-up update was version 0.3.11, so from 0.4.0 on the update-ready screen showed Up to Date and was no longer drawn; it is now a minor version past the launcher running it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSHQpLnScF9sNv4LNAaaS3
The foliage's sun shadows took most of the GPU time: one mesh draw shaded about 1,000 million fragments in the far cascade. The far cascade now shades them at a 2x2 rate, and the two far cascades drop one side of the double-sided cards. At the forest entrance the frame rate went from 18 to about 43 fps on an RX 7900 XT.
FSR 3.1, its frame generation and the console mode now take effect without a restart. The full performance overlay lists the settings shown in the options menu.
NX2NAVI_GPU_PASSES times each pass and counts its fragments, and NX2NAVI_SET_AT changes settings at a given frame for test runs. Both are off by default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These were already the defaults of a new install and of Default Settings; the test keeps a later change from turning one of them off unnoticed, and checks that a player's own choices still stay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSHQpLnScF9sNv4LNAaaS3
It was offered only while already set, because Streamline presented no generated frames yet. With Reflex now pacing it from the frame's start it generates frames, and the user played with it: it works well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NX2NAVI_TRACE=audio logs voices starting, stopping and sharing a wave buffer; NX2NAVI_DUMP_MOVIE dumps movie frames; NX2NAVI_LOG_CS_BINDS says why the stand-in for an untranslated compute program skipped a dispatch; and NX2NAVI_TRACE=perf adds heap and commit census lines on their own thread, with VMA maps when write-combined memory grows by 2 GiB. From a tester's fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reflex's markers sat at the host present with frame numbers unlike the frame's tags, slReflexSleep was never called, and the low-latency mode was set before any swapchain existed, so it never applied. GfxBackend.frame_start, called from nvnWindowAcquireTexture, now sets the simulation and submit-start markers after Reflex's sleep (skipped once nothing was presented for 200 ms); submit end is set when the frame's submissions went out; the mode is set again after each swapchain (NX2NAVI_REFLEX: 1 on, 0 off, 2 boost); frames are numbered by the game's presents; and the fps counter counts what was shown. NX2SL_VERSION is 3, so nx2navi_dlssg.dll must be rebuilt. From a tester's fixes: 42-45 fps game, 84-90 on screen (was 24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mirror prologue is closed after the part it was made for but runs first on the GPU; its timestamps were read in the wrong order, so its copies counted as idle time with work queued. ts_submitted now queues the reads in GPU order, and the perf line shows the copies on their own. From a tester's fixes: in Kokiri Forest at 4K on PCIe 3.0, 7.1 of 20.4 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With hdr = native the game's output pass writes a 10-bit PQ target (A2B10G10R10), not the 8-bit sRGB one vk_dlaa_pass looked for, so DLAA never ran and frame generation had no depth or motion vectors for most frames. The native HDR picture's format is now named once (vk_hdr_native_picture) and taken by both DLAA and the HDR present. From a tester's fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game's event script times the intro movie's narration and fades by counting updates as 60 Hz frames. At 144 fps everything ran 2.4 times early: each line started over the one before, and the closing fade hid the dream. frame_step_cap_ns caps the rate at the movie's 60 fps from the decoder's start to its end of stream (ov_movie_live); with fps_limit = unlimited the cap is the movie's rate. With RTSS limiting, the game's own limiter holds a new rate until RTSS has applied it. NX2NAVI_MOVIE_FPS sets the cap, 0 turns it off. From a tester's fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After an hour at 2160p the 2048 released entries held 5-7 GiB of render targets and decoded textures, charged to Windows' commit as well. NX2NAVI_TEX_RELEASED_MB caps them by size (default 1/16 of RAM, 1-4 GiB), and with less commit free than NX2NAVI_TEX_COMMIT_FREE_MB they are dropped to 256 MiB. Only entries released 120 frames ago or more go, at most 32 a check, oldest first. On Linux the commit check applies only with vm.overcommit_memory = 2 (plat_commit_enforced). From a tester's fixes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four play-recorded compute shaders of 0.87 to 4.4 million SPIR-V words (the game's tensor-core upscaler passes, which run through the stand-in here) are recorded and so prebuilt at boot. The driver spent minutes and gigabytes on each, four at once, none finished, and every start began again until RAM ran out and the screen went black. The boot prebuild now creates a compute shader over 512K words only from a pipeline cache (VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT) and leaves it to its first dispatch otherwise. NX2NAVI_LIB_PREBUILD_BIG=<words> sets the limit, 0 the old behaviour. From a tester's fixes: memory flat at 13 GB on the title screen, prebuild done in 463 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing kept a second copy of the game off the same profile (a double start, or the restart going ahead after 30 s
while the old process still ran). Its start took the first copy's commit in progress for an interrupted one and
deleted it, removed the first copy's working copy under its open files, and then both wrote into one save-tx/work,
so saves were lost or mixed. The save storage now takes <profile>/instance.lock (plat_lock_file: a file no other
process can open on Windows, flock on Linux) and a second copy stops with "another copy of the game is running".
--probe-fs gives the lock back before deleting its temporary profile and passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
make_launcher.py reused WORK/tcltk whenever DLLs/_tkinter.pyd was there: after a new Python or Tcl/Tk pin the old
files went into the release while its runtime id said new ones did, and an msiexec run cut short after that file
was written was trusted too. A stamp naming the msi, written once the unpack is complete, now decides.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/diff/common.py always passed -fuse-ld=lld, so on an MSYS2 install without the lld package simd.py, atomic.py
and the other Unicorn checks stopped at "invalid linker name" before testing anything. lld is used when it sits
beside the compiler, the default linker otherwise; atomic.py passes either way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-commit check took the staged file names from the index but read their content from disk, so a chunk with
the generated-code marker that was staged and then removed from the working copy alone passed the check and went
into the commit (CI's full check would still catch it). --staged now reads the staged blobs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The table's sha256 is checked, but a table whose counts and offsets do not fit it went on: a directory listed as its
own child made tree() go round for good (the build hung at "check"), and a name pool placed before the entries, an
entry index past the lists, a name that is not UTF-8 or damaged zstd data raised struct.error, IndexError,
UnicodeDecodeError or ZstdError, which make_game.py does not catch, so the player got a traceback. All of them are
NupError now, which make_game.py and the launcher report as a damaged dump.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
convert caught ValueError only, while the lifter raises its own Unsupported for an instruction it does not take (an
FP16 operation in a code cave): tools/cheats.py and tools/exefs_patches.py stopped, and the setup then built the game
without any of the mods' cheats or ExeFS patches. It is now that file's own "unsupported" with the reason. A code
cave with a trap or system instruction before its last one, which recomp/gen.py refuses and which failed the whole
lift, is refused here the same way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new input reset the steps in memory only; the next save came after the first step finished, while the exefs step
rewrites <out>/exefs in place. A run stopped there left the old state.json saying the old game's steps were done,
and --rebuild then trusted the half-replaced files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --exefs and --romfs folders, the identity the exefs and romfs steps are keyed on was the two paths and the
number of RomFS files: a RomFS extracted again or edited with the same number of files, or a replaced sdk or
subsdk0, printed "done before" and the build kept the old unpacked files. Each file's size and modification time
is now part of it. A build from such folders unpacks once more after this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nvnTextureInitialize copied the layout's size of packaged data to the pool's memory at the texture's offset without
checking either against the pool: a descriptor larger than its pool wrote past the pool's storage. It now stops
with the sizes instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The present resets its slot's fence after the acquire. When the submit then failed (out of device or host
memory), the fence stayed unsignalled and the acquire's semaphore signalled: the slot's next fence wait timed out
after 5 s, the frame counter no longer moved on, and every later present waited on the same slot, so the picture
stopped for good while each game submit waited behind it. An empty batch now takes the semaphore and signals the
fence, and the swapchain is made again, which gives the acquired image back.
- A crop from the game's nvnWindowSetCrop that starts past the image gave a blit with an inverted source rectangle;
the whole image is shown then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An empty NX2NAVI_SPIN or NX2NAVI_VRAM_HEADROOM in the environment stopped the game: both read the key with
cfg_bool, and an empty value falls back to the settings table, where these keys have no row. Empty now means unset.
- find_ini checked for 10 bytes after the exe folder's separator where "nx2navi.ini" and its NUL take 12, so an exe
path just under 1024 bytes wrote two bytes past the buffer.
- The performance overlay read the clock before taking the lock, so a frame pushed in between was newer than "now",
the unsigned age wrapped and the overlay showed 0 fps for that refresh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every settings change (a slider step, F10, a cheat) closed the connection and made a new one, so the status
disappeared and came back each time, and a held slider reconnected twice a second, enough to hit Discord's rate
limit. A new app id reconnects; a new image is resent on the same connection; anything else changes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- At shutdown, restart or logoff Windows ends the process after WM_ENDSESSION without a WM_CLOSE, so the close path
never ran: a settings change from the menu still waiting to be saved was lost, RivaTuner's profile kept the
game's limit and a save Commit in flight was cut off. WM_ENDSESSION now runs the close path.
- The window opened at its setting (by default 1920x1080) whatever the screen, so on a 1080p laptop its bottom, the
HUD with it, was under the taskbar. At start it is scaled down, in its own proportions, to fit the work area; the
setting is left as it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A measured rate under the lowest limit (a 24, 25 or 29.97 Hz TV) was taken for an unknown one and paced at 60: twice
the screen's rate, so half the frames were thrown away. Only an unknown rate (no window yet) is 60 now; a real one
below 30 Hz is held at 30.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GetInfo's program id and the application id IsSaveDataExisting and MountSaveDataReadOnly answer for were another
game's. The game asking about its own save data by its own id was told there was none; asking with the other id
mounted its own save. Both are now this game's id, and --probe-fs passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A profile, save or account folder that is a junction or symbolic link (a profile moved to another drive and linked
back) stopped the start at "cannot create directory"; it is now taken as the folder. A save folder linked to
another drive than save-tx cannot take commits (a folder rename cannot cross drives); the log now says so instead
of blaming a file in use.
- A missing account.uid made a new account, and the save under the old account's folder was no longer found (a
profile copied without the file, or only its save folder put in place). When save/ holds exactly one account
folder, its account is taken. A file that is there but cannot be read now stops the start instead of being
replaced.
- WriteFile's check of offset plus size against the file size could wrap for a size near 2^64.
- The first save mount deletes the last session's working copy with the retries the start uses, so a scanner
holding a file there no longer stops the game.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The probe waited for each Commit's background thread with fs_save_flush, which since Quit keeps saves safe also marks
the process as exiting: every later Commit was refused ("the game is closing") and 20 of the 160 checks failed. It
now waits with save_wait_commit; all checks pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B is Left Ctrl and Backspace, and Left Shift is A (held, dash), but the example said B was Left Shift, so copying
its sample bind lines moved dash to B. Its walk_key example collided with that dash key, and it named a G key for
SHAKE, which has no default key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing reads SDL's events there (the window is our own), yet every axis and button change of a gamepad was queued
until SDL's cap of about 65,000 events, several MB, after which each further event failed and set SDL's error text,
which later log lines report. The gamepad state the input code reads does not come from the queue.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GetAsyncKeyState reads the physical buttons, so with "switch primary and secondary buttons" on, a left-handed
player's primary button targeted and the secondary attacked, the other way round from the window's own clicks.
mouse_l and mouse_r now mean the primary and secondary buttons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lstick_deadzone = 8% (or any typo) counted as set, and since that row has no default of its own it read as 0: no
dead zone at all, so a drifting stick moved Link. The documented fallback, stick_deadzone, is now used then.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
menu_sound_play restarts a voice in place for a repeated cursor tick. When that happened between the mixer's loads
of the voice's position and its sound, the old position was used with the new, shorter sound: the frame count
wrapped and the mixer read past the sound's samples. The mixer now checks that the position is still the voice's
and inside the sound.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An audio_prefill_ms of 180 or more asked for more queued audio than the renderer ever fills the ring to (half of
it), so the output never started and stayed silent. The prefill is now held to that target; nx2navi.ini.example
says so.
- An infinite or huge pitch or sample rate from the game kept the per-sample loops going for good under the
renderer's lock, which then blocked the game's RequestUpdate. The step is held to 64 source samples per output
sample.
- An endless loop buffer with no samples (start equal to end), which the voice keeps as the DSP does, made
advance_voice go round for good; it now starves the voice as intended.
- A NaN sample or effect state reached the device, where it plays as full scale; it now plays as silence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A relative mods_dir is under the game's folder, the setup builds only the default folder's ExeFS patches and code
cheats, and the order is set in the file: the in-game menu it named has no Mods tab.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A folder in a mod's RomFS that could not be listed (no permission, or a path longer than 260 characters, as a mod
deep in a long game folder makes) lost its files without a word in the log; the walk now names it. The manifest
asks for long path support, so where Windows has it switched on (LongPathsEnabled) those files are served.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the launcher's drive has less than 40 GB free, the proposed game folder goes to the drive with the most free
space, and a mapped network share or a USB drive was counted: the 26 GB RomFS image and the build would go there.
Only fixed drives are counted now, as the docs say.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The setup left the folder alone whenever app/current.txt named a newer version than its own, so after an update
"Run NX2navi-Setup.exe again to repair the installation" did nothing when python\ or that version's launcher was
gone (deleted, quarantined). A newer install is now kept only when its launcher and Python are there; otherwise the
setup unpacks its own release.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a new version did not start, the stub started the previous one with --rolled-back and the same arguments,
--continue-update among them: the previous version then ran the update's rebuild as if it were the new one, and the
"Version X did not start" notice on home never showed. A rolled-back start now goes to home with the notice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>