Skip to content

Dalia - #925

Open
azeselh wants to merge 491 commits into
Eglantine-Community:nx2-experimentalfrom
azeselh:Dalia
Open

Dalia#925
azeselh wants to merge 491 commits into
Eglantine-Community:nx2-experimentalfrom
azeselh:Dalia

Conversation

@azeselh

@azeselh azeselh commented Nov 21, 2026

Copy link
Copy Markdown

Summary

What does this PR change and why?

Type of change

  • Bug fix
  • Game compatibility / game-support
  • Performance
  • New feature
  • Refactor / cleanup
  • CI / build
  • Documentation

Related issues

e.g. Fixes #123

Testing

  • Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Tested on NVIDIA
  • Tested on AMD
  • Tested on Intel

Games tested:

E.g. Mario Kart World 1.8.0: no more black textures

Checklist

  • I built it locally and it compiles without new warnings
  • I did not add any copyrighted game data, keys or firmware
  • Docs updated if needed
  • I added AI Disclosure if one was used

Screenshots / logs

Before/After

zortos293 and others added 30 commits November 7, 2026 15:07
…y#537)

Add an FG status bar toggle next to FX. The renderer reports whether frame
generation can run and how many frames it has generated, so the item can show
active, idle, or unavailable (with the reason) during a game.
…rofile (Eglantine-Community#526)

windows-x86_64-pgo now reuses the windows-x86_64 clang-cl job and adds -fprofile-use with lichii-windows.profdata, an MSVC-ABI IR profile merged with LLVM 22.1.8 from about six minutes of Ocarina of Time. The MinGW toolchain, its configure, build and packaging steps are removed. A stale profile only warns. The object cache key includes the profile hash. Asset names stay lichii-windows-x86_64.zip and lichii-windows-x86_64-pgo.zip.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…lantine-Community#509)

* updater: PGO fallback, skip/remind, digest check, install-aware package, error messages

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: install AppImage updates in place with one rollback copy

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: fix ListFromJson overload ambiguity and test JSON literals

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: lock the install against concurrent updates, build the installer always, probe writability without touching files

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: resolve merge markers in update_dialog.cpp

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: drop the duplicated download verification left by the nx2 merge

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* net: cast the lowercased digest character so the MSVC build compiles

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: install Windows updates with a helper that swaps the files after exit (Eglantine-Community#510)

* updater: install Windows updates with a helper that swaps the files after exit

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: keep the new backup when restoring from the backup

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: use QString for the helper path, which QStringBuilder otherwise turns into a builder

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* net: cast the lowercased digest character so the MSVC build compiles

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* updater: link QuaZip on every Windows build, keep a committed install successful, tell the user when the helper times out

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-Community#520)

* ci: build and test with clang-cl on Windows in build-check

build-check had no Windows job, so MSVC and Windows-only breakage went unnoticed until a release run. The new job builds the production targets and tests with the release compiler (clang-cl from LLVM 22.1.8, without ThinLTO) and runs ctest, with sccache and the CPM cache. The pinned LLVM install moves to tools/windows/install-llvm.ps1 so both workflows use one version and checksum.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci: spell the build-check clang-cl flags with dashes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* build-check: make the Windows clang-cl tests pass and keep their cache

Bundled zlib registered its example tests, which cannot find an installed
package, so turn ZLIB_BUILD_TESTING off. The NUP metadata-edit test held
the archive open while the edit renamed over it, which Windows refuses.
Save the sccache cache even when tests fail.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* tests: keep the microphone capture stream off the stack

SinkStream holds several megabytes of inline queues, which overflowed the
1 MiB Windows main stack. Allocate it on the heap like the sysmix tests.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ts were null, bind up to 64 storage buffers (OoT Hyrule Field grass; imports Eglantine-Community#395, Eglantine-Community#421, Eglantine-Community#434) (Eglantine-Community#551)

* shader: charge pointer table entries only for bindings the first pass left free

Pointer table entries are bound in the storage buffer bindings that the
pass without them leaves free. The second pass charged a table entry's
holder to that budget whenever it was not in the set yet, but the holder
is usually a buffer the first pass bound, and so already left out of the
budget: charged twice, it shut out other tables. Ocarina of Time's
foliage culling compute 331e607152ce78d5 bound 28 of 32 storage buffers
and 4 of its 8 per-type instance tables, and a type whose table is not
bound is culled whole. Only buffers the first pass did not bind take
from the budget now: it binds 32 with all 8 tables (541ba22d44898196: 7
tables, was 6). Should the second pass still exceed the 32 bindings, the
program keeps the first pass's buffers rather than failing to build.

Two tests cover the charge and the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4ff805a0c096d6a2aeb3ab3107d2d76b39ffc2c0)

* shader, buffer_cache: bind up to 64 storage buffers per stage

A native (Switch 2) program takes a storage buffer for every raw pointer
it reads, and 32 bindings are not enough for all of them. Ocarina of
Time's foliage culling computes need 33 in Hyrule Field and 37 with
Castle Town's leaf lists bound too. Past the cap the pass leaves pointer
table entries out, the per-type instance tables, and every instance of a
type whose table is unbound is culled.

Raise the cap to 64, which takes the buffer cache's storage binding
masks to 64 bits, and keep each program within the device's per-stage
storage buffer limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f25c551c772acf232ae4dbd1b3c1a2882d7a1829)

* vulkan: rebuild native compute pipelines whose pointer slot was null at translation

Native programs only bind a constant buffer pointer as a storage buffer when
it pointed to mapped memory while the program was translated, and that
answer is stored in the pipeline cache. Ocarina of Time's foliage culling
compute was first translated while two list pointers (c4[0x90], c4[0x130])
were still null; its list writes were dropped for good and the near hedges
in Castle Town kept only their bare branches (Lichii Eglantine-Community#201).

Remember the slots that were null at translation and rebuild the pipeline
once such a slot holds a mapped pointer. Replaced pipelines stay alive for
work in flight. When the cache holds both translations, keep the later one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 30e43ca548aae597f4b7d57479b6669943f88f0e)

* vulkan: keep the cached compute translation that binds more pointers

Which of a native program's pointer slots are filled depends on the area
(Castle Town and Hyrule Field fill different list slots of Ocarina's
foliage culling compute), so the later cache entry is not always the
better one. Prefer the translation that bound more pointers and keep the
earlier entry on a tie, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 15ff6cb26ccd3314e138ead3ac78967ba4127632)

* vulkan: keep the old compute pipeline when its rebuild fails

A rebuild can fail where the stale translation worked, for example when
a narrow access now stays global across two mapped buffers. Keep the
working pipeline and stop retrying instead of losing the dispatches.

A cache reload loads entries while runtime entries exist; keep those and
only choose between duplicates read from the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1ba80f0b2e21dfae965f2f526ef842789efeac23)

* vulkan: choose between cached compute translations before building them

Replacing an already loaded entry could destroy a pipeline that a
dispatch was using, when loading overlaps guest work (cache reload, CLI
startup). Read all compute entries first and order the duplicates of a
key: more bound pointers first, the earlier entry on a tie. One worker
per key builds the first candidate that translates and only adds it, so
an existing entry is never replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1e22e5ce6d2af61405d2a1422f244473ee02e9b2)

* vulkan: rebuild compute translations without dropping the pointers they bind

A rebuilt translation binds the pointer slots that are filled when it is
translated, so a rebuild in one area dropped the slots another area
fills: Ocarina of Time's foliage culling fills different list slots in
Hyrule Field and Castle Town. The load then preferred whichever cached
translation bound the most pointers, which need not bind those the first
translation did.

A rebuild now keeps binding every pointer the old translation binds (a
null pointer binds nothing), and the load tries first the cached
translations that bind every pointer the first one binds, those binding
the most first. With all of them bound, Castle Town's hedges keep their
near leaves and Hyrule Field's grass keeps its per-type tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit dfc72118ac0655f252a77ddc53db7324228f03c7)

* tests: hold 64 storage bindings in the binding capacity test

The stages bind up to 64 storage buffers now, past what a 32-bit mask
holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 16551ffcba94221ed836a7b31ffd13a29dc1b316)

* shader: reject programs that read more pointers than a stage binds

Only the retries for competing loaded pointers and for pointer table
entries kept a program within the stage's storage buffer limit. A
program reading more direct pointers than that got a pipeline layout
past the device's limit, or, past 64, a bad_alloc from the descriptor
list, which the pipeline caches don't catch. Reject such a program with
a translation error instead: binding only some of its pointers would
drop the accesses through the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a695c147aec4bb153d71508f392079a8ab1e544a)

* vulkan: free replaced compute pipelines once the GPU is done with them

A rebuilt compute pipeline's predecessor was kept until the cache was
destroyed. Retire it with the current tick and destroy it in TickFrame
once the GPU has passed that tick, as evicted graphics pipelines are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 4d62d81b7470ea90d655bea021a581287a4e623b)

* shader: count NVN buffers and the descriptor set limit against the limit

The check that a program stays within the storage buffers a stage binds
ran before AddNVNStorageBuffers appends the NVN fallback descriptors,
and it took only the per-stage limit. StorageBufferLimit now also caps
by the device's descriptor set limit, and AddNVNStorageBuffers rejects a
program the same way when an NVN descriptor it adds would pass it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a676f102b09ddd24a518478e1a2d2834f7e7b524)

* vulkan: keep a replaced compute pipeline until its queued build has run

A runtime compute pipeline queues its build on a worker, and a dispatch
may build it first on the scheduler thread; the queued task still runs
later and reads the pipeline. Destroying a replaced pipeline once the
GPU passed its tick could free it before that task ran. The task now
marks the pipeline when it is done with it, and a retired pipeline is
destroyed only after both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit bec25b494d2916895977a63ac02aa05861cc088d)

* shader: keep a dual vertex program's storage buffers within the limit

MergeDualVertexPrograms joined Vertex B's storage buffers onto Vertex
A's without a limit, so the merged stage could pass the device's limit
or, past 64, overflow the descriptor list. JoinStorageInfo now takes the
limit and rejects the program as the storage buffer pass does; the
Vulkan and OpenGL pipeline caches pass their host's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 89f72df5528566ccb0fe42b01088d1708a832f70)

* shader_environment: keep the native shader hash comment on its function

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* vulkan: keep a graphics pipeline's storage buffers within the descriptor set limit

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* tests: give the table loop helper internal linkage (-Wmissing-declarations)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: jpkto <255363096+jpkto@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: win <atk3001@gmail.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-Community#221)

* file_sys: ignore IPSwitch lines that are not patch records

Text after a patch block, such as a mod's credits, was parsed as records
and written into the module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* file_sys: require the IPSwitch value right after the offset

A quote or hex word later in free text still passed as a record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* file_sys: require a closing quote at the end of IPSwitch strings

A line such as A "thank you was still written as a string record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* file_sys: keep the opening quote active when stripping IPSwitch comments

An apostrophe inside a double-quoted value changed the quote state, so a
later comment was kept and a slash could cut the value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…mmunity#95) (Eglantine-Community#160)

A ZBIC segment that failed to decompress only logged `assert r > 0`; the
loader then copied the previous segment's bytes into the code set and
booted a corrupt image that never presents a frame.

- DecompressDataZBIC logs zstd's error name instead of discarding it.
- LoadModule returns nullopt on failure, which the callers already report
  as ErrorLoadingNSO, and zero-fills a short segment instead of leaving
  stale bytes in it.
- zbic_compression.cpp is built with -fno-profile-instr-use: it runs once
  per module at load, and the aarch64 PGO build is the one that fails.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…munity#511)

* dist: install the MIME package under the Lichii app id

The Linux install still shipped dist/dev.eden_emu.eden.xml to
share/mime/packages. That path collides with the file an installed Eden
package owns, so package managers refuse to install both. Each MIME type
also pointed at the dev.eden_emu.eden icon, which Lichii never installs,
so NRO, NSO, NSP and XCI files showed no icon.

Rename the package to io.github.zortos293.lichii.xml and point the icons
at io.github.zortos293.lichii, matching the installed desktop file,
metainfo and icon. The application/x-nx-* type names stay unchanged: the
desktop file's MimeType= line uses them, and shared-mime-info merges
duplicate definitions from several packages.

* dist: register NUP, NSZ and XCZ MIME types

The loader and the game list open .nup, .nsz and .xcz files, but the
MIME package only defined NRO, NSO, NSP and XCI. Desktops showed those
files without a type or icon and did not offer Lichii to open them.

Add application/x-nx-nup (matched by its "NUP\x01" header),
application/x-nx-nsz (a PFS0 container like NSP) and
application/x-nx-xcz, and list them in the desktop file's MimeType=.
…unity#484)

* qt: don't resize a maximized window when a game boots

Resizing leaves the window marked as maximized at the new size, stuck in
the top-left corner until it is dragged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* qt: keep a hidden render window hidden when resetting its size

showNormal() showed the render window of a stopped game again. Clear the
maximized state without changing visibility instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…tine-Community#365)

* vulkan: disable installed Overwolf hooks before loading Vulkan

* docs: keep Overwolf startup notes limited to implementation and checks
…y#270)

A Switch 2 game paces itself on the vblank word in its present call: Lichii
holds each present until the next vblank of that word times the swap interval
(PaceToVblank), so the game cannot run faster than the rate it declares. Games
that declare 60 Hz therefore cap at 60 whatever the host display does, and
EDEN_NX2_VSYNC_HZ, which only drives the synthetic vblank event some titles
start frames on, does not change it (OoT ignores it: its word stays 0x1003c).

Add "FPS Limit" to the renderer settings (0 = off, up to 480): the paced
interval becomes the longer of the game's vblank interval and 1/fps_limit, so
the game itself runs at the requested rate instead of only the display.
EDEN_NX2_FPS_LIMIT=<n> overrides it for tests without touching a config.

The interval maths moves into PacedInterval so it is testable; the pacer tests
cover limits above, at and below the vblank rate.
The experimental pin_gpu_threads setting (Eglantine-Community#418) only applied Windows CPU sets
and was skipped elsewhere. On Linux, read each allowed logical processor's
package and core id (and cpu_capacity on hybrid CPUs) from sysfs, plan the
same way (the front and back on a physical core each, the guest cores on the
other performance cores) and apply it with pthread_setaffinity_np.
…antine-Community#495)

* vulkan: grow descriptor payload storage on demand after draining its worker

* docs: clarify bounded descriptor growth and format its tests
…ffer (Eglantine-Community#427)

Draws with no colour and no depth target take their framebuffer size from
the surface clip, which Ocarina of Time leaves at 32768x32768 after the
intro video. Apple GPUs allow 16384 (maxFramebufferWidth/Height), and
Metal loses the device on the larger attachment-less render pass
(kIOGPUCommandBufferCallbackErrorPageFault, or Internal Error 0000010d on
M1). Clamp the framebuffer width, height and layers to the device limits.

Constant buffers are bound from the stream buffer and shaders declare each
at 64 KiB, so a binding near the end of the buffer reads past it; the Metal
debug layer reports "argument c3[0] ... has space for 26624 bytes, but
argument has a length(65536)". Create the stream buffer 64 KiB larger than
the part that is handed out.

Based on the patch balderos posted in Eglantine-Community#237, which was tested on an M1 and
an M6. Adapted to current nx2: the layer clamp now applies to the layer
count the framebuffer is created with, and the clamp is a small header so
it can be unit tested.

Refs Eglantine-Community#237
…owing (Eglantine-Community#440)

* vulkan, texture_cache: fail an image that does not fit instead of throwing

MemoryAllocator::CreateImage threw vk::Exception once every fallback was out
of memory. On the texture cache path nothing catches it (the cached image is
built inside SlotVector::insert, which is noexcept), so an 8 GB RX 9060 XT
running Ocarina of Time died when the 1024x1024 RGBA8 decode image of an
ASTC to BC3 transcode did not fit (Eglantine-Community#342).

TryCreateImage returns a null image on VK_ERROR_OUT_OF_DEVICE_MEMORY or
VK_ERROR_OUT_OF_HOST_MEMORY instead; CreateImage still throws for every other
caller. On the texture cache path:

- A cached image without memory is left out of the cache: JoinImages erases
  it and returns no image, so lookups get a null view (blits fall back) and
  make it again later.
- TranscodeAstcToBcn frees its idle decode images and retries once; if that
  fails too it leaves the image to be uploaded again on its next use.
- The allocator counts images it could not make, and the collector runs at
  the critical threshold the frame after one, whatever the usage counts say.

Refs Eglantine-Community#342

* texture_cache: retry a texture whose image did not fit on its next read

VisitImageView kept the null view of an image that had no memory in the
channel's descriptor map, so the texture never came back once memory was
freed. Leave it out of the map and invalidate the table so the descriptor is
read and the image made again.

Refs Eglantine-Community#342

* texture_cache: retry only images that did not fit, after the collector ran

6a53fbd dropped every null view from the descriptor map and invalidated the
table on each visit. Drop it only when the allocator's failed image count
moved during CreateImageView, and leave the table alone: the collector's
deletions invalidate it, so the image is made again once memory was freed
rather than on every draw.

Refs Eglantine-Community#342

* texture_cache: re-read texture tables the frame after an image did not fit

A texture left out for lack of memory was only retried once some image was
deleted, which the out-of-memory collection does not guarantee. Invalidate
the channels' image tables after that collection, so such textures are made
again once a frame while images keep failing.

Refs Eglantine-Community#342
… (Ocarina ~11% faster in Kokiri village) (Eglantine-Community#446)

* gpu_thread: poll suspended channels every 50 us instead of every 1 ms

A channel suspended on a semaphore its CPU releases is polled with yields for 500 us, then with
1 ms sleeps. Ocarina of Time suspends ~330 times a second and its present waits for the GPU work
behind those acquires, so a release seen up to 1 ms late delayed the frame: in Kokiri village
its present waited ~17 ms a frame on the GPU fence. Sleep 50 us instead, with the GPU thread's
timer slack lowered on Linux so the sleep stays short.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* gpu_thread: back to 1 ms polls for a channel still waiting after 2 s

Long waits (menus, loading) don't need 50 us polls. The waits behind the frame time measured
in Kokiri village last ~1 ms.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…base (Eglantine-Community#245)

Handle programs record storage buffer offsets relative to the buffer address
aligned down to the host storage buffer offset alignment (StorageOffset), and
the buffer cache binds the buffer at that same aligned base. The CPU-side
evaluator read from the unaligned address instead, so when a storage buffer
address is not a multiple of the host alignment (16 on NVIDIA, up to 256
elsewhere) a storage-sourced handle is read from the wrong word.

Pass the device alignment through from both the Vulkan and OpenGL pipelines
and mask the buffer address the same way the shader does. For indirect
buffers the table entry is still read at its exact address and only the
address it holds is masked, as in the SPIR-V base_address. Adds a unit test
that reads the same program at alignments 16, 4 and 0, directly and through
an unaligned table.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…mmunity#174)

Lets the shuffles of a group overlap; unrolling all of K16 raised register pressure and slowed large dispatches. Ocarina's DLSS menu frame went from ~18 to ~12.6 ms of GPU time on a 7900 XT.
…ose pages (Eglantine-Community#250)

* video_core: skip GPU-write invalidations of caches with nothing on those pages

The GPU's own cached guest writes (WriteBlockCached: constant buffer data, every draw) are
invalidated in the texture, buffer, query and pipeline caches at the next draw
(FlushCaching -> InnerInvalidation). The texture, query and shader caches only visit the objects
registered on those pages, and constant buffer memory holds none: each call still took the
cache's lock and walked its page tables, about 88k times a second in Ocarina of Time.

Each of the three now keeps a PageFilter: one bit per 4 KiB device page it ever registered an
object on (images, cached queries, shaders), never cleared. A write whose pages have no bit set
can't concern that cache, so InnerInvalidation skips it. The buffer cache is still always told.

Ocarina of Time, Kokiri Forest village, GPU accuracy Low, RTX 4090 + i9-13900K:
nx2 52.0-52.3 fps -> 53.6-54.2 fps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* shader_cache: mark rejected native programs in the page filter

A program rejected before Register is never marked, so InnerInvalidation
skipped the shader cache for GPU writes over it and its rejection was never
cleared. Mark its start address, which is all the erase predicate matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* video_core: leave ranges past the page filter's space untracked

Marking one (a stand-in address of an image without CPU backing) set an
overflow flag that made the filter report every range as possibly holding
objects. Any already reports ranges past its space that way, so Mark now
ignores them and the flag goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The buffer cache makes about 30,000 RangeSet lookups and 18,000 subtractions
a frame in Ocarina of Time, 97% of the subtractions missing every range,
against 3,400 additions. The sets stay small: 35 ranges on average at an
add, 198 at a subtract that hits, 763 at most. A boost interval_set with
pooled tree nodes behind a mutex spent 5.0% of the GPU back thread on that.

Sorted, joined ranges in one array answer the same questions with a binary
search over contiguous memory and no allocation per range. Add and Subtract
keep the interval set's semantics, including the joining of touching ranges.
OverlapRangeSet needs counts per segment and stays as it is.
…e-Community#333)

* nvdrv: size Switch 2 GPU page tables to the VA NVN is given

nx2:gpu reports [0x8000000, 0xC000000000) to NVN, but AllocAsEx built the
GMMU from NvRm's 128 GiB va_range_end. Nintendo GameCube - Nintendo
Classics mapped 0x2109ec0000 and PageTableOp indexed off the end of
entries[]. Size the tables to the advertised end on Switch 2, and refuse
a map that is still outside the address space.

* nvdrv: refuse a sparse destroy that runs past the GPU address space

PageTableOp leaves a range that crosses the address-space end mapped.
DestroySparseRegion still released that range's backing, so the pages
could be freed while the GMMU pointed at them. Reject the destroy
before the release. A map or unmap of the last valid page that crosses
the end leaves that page's translation alone.
…e-Community#465)

Scenario: Switch 2 (native Turing) draws whose graphics pipeline is still
building are never skipped, so the GPU waits for the driver build. On an
RX 6700 XT (Zelda OoT Switch 2) the log showed up to 14656 ms of draws held
in a 10 s window and single builds of 16.7 s.

Add native_async_draws (Wait, Bounded, Skip; default Wait keeps the current
behavior) and native_pipeline_wait_ms (per-frame budget, default 8 ms), both
in the Qt advanced graphics settings. Bounded does a timed condition-variable
wait on the pipeline build up to the per-frame budget, reset in
PipelineCache::TickFrame, then follows Skip. EDEN_NX2_ASYNC_DISCARD=1 still
forces Skip. The decision is a pure function covered by a Catch2 test.

Measured with Bounded at 8 ms on the same machine: at most 229 ms of draws
held per 10 s window, 10 to 614 ms of bounded wait per window, and a
one-frame flash when the budget runs out.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ine-Community#550)

* vulkan: don't evict disk-cache pipelines that were never used

A pipeline prebuilt from the disk cache at boot keeps last_use_frame 0 until
a draw uses it, so the first eviction pass after 9000 frames destroyed nearly
all of them and the game translated them again on the GPU thread when it
reached that content.

* vulkan: track first use separately from the frame number

frame_count starts at 0, so a pipeline used only on the first frame also had
LastUse() 0 and was never evicted. Mark first use with a flag instead.

* vulkan: cap the never-used prebuilt pipelines kept from eviction

The used list spans 16 sessions, so a large cache could keep thousands of
never-used pipelines resident for the whole session. Keep at most 2000
(~0.9 GB of driver memory); past that they are evicted like the rest.
… queued (imports Eglantine-Community#170 by @janvitos) (Eglantine-Community#585)

Imports Eglantine-Community#170 by @janvitos.\n\nCo-authored-by: janvitos <10037804+janvitos@users.noreply.github.com>
…12% standing, +24% walking) (imports Eglantine-Community#475 by @mstampfli) (Eglantine-Community#582)

Imports Eglantine-Community#475 by @mstampfli.

Co-authored-by: mstampfli <marc.kurt.stampfli@icloud.com>
…eneration loads (imports Eglantine-Community#230 by @PantACRO4life) (Eglantine-Community#587)

Imports Eglantine-Community#230 by @PantACRO4life.

Co-authored-by: PantACRO4life <6643071+PantACRO4life@users.noreply.github.com>
…a of Time 41 → 60 fps) (imports Eglantine-Community#521 by @estevanbs) (Eglantine-Community#583)

Imports Eglantine-Community#521 by @estevanbs.

Co-authored-by: estevanbs <estevanbartmann@gmail.com>
zortos293 and others added 20 commits November 12, 2026 13:17
…6 GB of RAM (#1478)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ery GPU (#2393)

* vulkan: decode large ASTC arrays in batches the free pool keeps on every GPU

An ASTC array whose RGBA8 decode image passes the 256 MiB free pool now decodes
and encodes a few layers at a time on discrete GPUs too, not only on integrated
ones. Over budget, VMA puts the whole-array image in system RAM rather than
failing, so the batched fallback never ran: on a 6 GiB GTX 1660 Super Ocarina of
Time's 90-layer 1365x1365 array placed 915 MiB in host memory, spilled 1258 MiB
and forced a collect (#2365). The capped image also stays in the free pool, so
the next upload reuses it.

The decode and encode loop moves into TranscodeAstcBatches, and a lavapipe test
checks that batches of 1, 2 and 3 layers encode the same BC1 and BC3 bytes as
the whole array.

Refs #2365

* vulkan: let a scheduler without a query cache submit

The ASTC batch test submits compute passes through a Scheduler that no
rasterizer gave a query cache; EndPendingOperations dereferenced the null
pointer on the first flush.
…g (#2396) (#2402)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ports Resort (#2384)

* video_core: restrict header byte-offset handles to Switch Sports

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* video_core: recapture texture classifications after the handle rule changes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* video_core: replace records whose dropped texture classifications translation reads on any host

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* vulkan: record again a pipeline whose disk record the prebuild found incomplete

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ore it runs (#1799)

ComputePipeline counts a build in the status bar's "Building: N shader(s)" when it is made and
as done at the end of its build task. A compute pipeline destroyed with its build still queued
(~ComputePipeline cancels the job) never ran that task, so it was never counted as done: the
counter stayed above zero for the rest of the session. It now counts itself as done exactly
once, when its build ends or when it goes. Graphics pipelines already balance a dropped build
(CompleteOnRelease, #1803).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Only call sparse-segment visitors when GPU-to-device translation returns an address. Log the first few skipped ranges and test that an untranslatable segment doesn't prevent visiting the next valid segment.

Port of mastorok@19dfa54 by mastorok (AI-assisted, Claude).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Use GlobalMemoryStatusEx to read the current process's remaining commit.
Keep the system-wide query where diagnostics need total commit and its limit.

Port of DuskDarf1/Lichii@6221540 by DuskDarf1.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…WER=1) (#2350)

The follower from #2319 stays in the tree but starts only with
EDEN_NX2_RENDER_FOLLOWER=1. In #2348's build-366 OoT log the back joined it
on 4502059 of 4510269 packets and overlapped 0.71 ring entries per packet,
so each warm draw paid a cross-thread wake-up for no parallelism.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Read the same fenced TSC and Q0.64 factor as WallClock::GetCNTPCT in
x64 A64 code. The slow thunk preserves live host registers and shares
the polling state with the inline read.

A per-System atomic clock policy is read both by generated code and by
CoreTiming. ApplySettings publishes CPU clock and core speed sync together,
so a live change cannot leave compiled code using different clock settings
from the callback or SVC. Use the wall clock's own live factor rather than
a duplicate. Leave cycle counting, nonnative clocks, guest stats and the
debugger on the existing path.

Keep EDEN_NX2_JIT_INLINE_CNTPCT=1 opt-in for ZOR-491. This candidate is
independent of shared executable caches.

Port-of: felt-mx/fritchii@e518ec6
Original-Author: Frizti <FriztiMouche@gmail.com>
Idea-from: bakemono's Blitchii round 7 handoff, as credited by Frizti

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
* common: make UniqueFunction own a callable given as an lvalue

UniqueFunction's constructor took a forwarding reference and stored
Callable<Functor>. For a const lvalue Functor is `const T&`, so the
wrapper kept a reference to the caller's object instead of a copy (a
non-const lvalue did not compile).

PipelineCache::QueueVulkanPipelineCacheSave builds its work as
`const auto save = [this, after_save = ...] {...}` and queues it with
serialization_thread.QueueWork(save) where the driver cache can be read
during builds. The worker then ran a lambda that lived in the stack
frame of a function that had already returned. On an Apple M6 that
crashed two times out of two after a shader precache: the lambda's
`this` read back as null, and SerializeVulkanPipelineCache faulted at
0x1a3f reading vulkan_pipeline_cache_filename (null + its offset).

The wrapper now stores std::decay_t<Functor>, forwarding the argument:
an lvalue is copied, an rvalue is moved as before, and a function given
by name is kept as a pointer. The constructor no longer takes part for
a UniqueFunction itself, so it cannot hide the deleted copy.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RcHkcx3CbFgcY6d7BpdyKC

* common: constrain UniqueFunction's constructor to what it can own and call

The converting constructor now takes part only for a callable it can
store (constructible into its decayed type) and call with the wrapper's
signature, so is_constructible tells the truth and a callable that
cannot be copied fails at the call instead of inside make_unique.
Callable initializes its functor with parentheses, not braces.

Tests: a non-const lvalue is copied (the original changes, the wrapper
does not), the wrapper outlives a const lvalue it was made from,
std::ref shares the caller's object, and the constructor's constraints.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RcHkcx3CbFgcY6d7BpdyKC

* common: call UniqueFunction's callable as its constraint says it can

The constructor's constraint is std::is_invocable_r, which also holds
for a callable whose result is dropped by a wrapper that returns nothing
and for a pointer to a member function. Callable's operator() called
`return functor(args...)`, which does not compile for either, so the
constraint accepted what the call then rejected. It now goes through
std::invoke and returns the result only when the wrapper has one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RcHkcx3CbFgcY6d7BpdyKC

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…hader cache deletions (#2349)

* shader_cache_v2: find driver blobs stored in the same session once they are written

A precache stores the binaries of every pipeline it builds, but the store only
read blobs a file held when it was opened, so the first gameplay use of a
precached pipeline compiled it again. The writer now reports where each record
landed, and the store finds the session's blobs from then on. The driver key
check is unchanged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* qt, shader_warm: log shader cache and precache deletions

Deleting a title's shader caches, its precache files or the whole shader
folder left no trace in the log.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions
github-actions Bot changed the base branch from nx2 to nx2-experimental November 21, 2026 23:37
@github-actions

Copy link
Copy Markdown

Retargeted to nx2-experimental for pre-build testing. It will be promoted to nx2 after validation.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4fbd2ad0-2ec9-4c1e-ad7f-46a4318c0ae4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

capy-ai Bot added a commit to zortos293/Lichii that referenced this pull request Nov 22, 2026
)

Port azeselh's c5acae66caef5156b0091e1462842a6280cf7e88 from Eglantine-Community/Eglantine#925.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.