<feed xmlns='http://www.w3.org/2005/Atom'>
<title>eglantine-cirakg/src/common/host_memory.cpp, branch nx2</title>
<subtitle>Mirror of github.com/cira0100/Eglantine-public nx2, a fork of Djihads80/Eglantine.</subtitle>
<id>https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2</id>
<link rel='self' href='https://git.cirakg.xyz/eglantine-cirakg/atom?h=nx2'/>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/'/>
<updated>2026-11-02T13:43:01+00:00</updated>
<entry>
<title>Merge nx2 into nx2-experimental</title>
<updated>2026-11-02T13:43:01+00:00</updated>
<author>
<name>kraibse</name>
<email>33869366+kraibse@users.noreply.github.com</email>
</author>
<published>2026-11-02T12:50:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=c0cb3325e22756edb65c87d33ef298349ade0ad3'/>
<id>urn:sha1:c0cb3325e22756edb65c87d33ef298349ade0ad3</id>
<content type='text'>
Resolved by area:
- audio feature_support.h: nx2's native revision handling.
- fiber.cpp: ours, which also drops the unused rewind stack.
- host_memory.cpp: ours granule bitmap and HintCold, plus nx2's
  fallocate hole punching per whole dirty granule on Linux.
- texture_cache.h: nx2's old-age eviction pass, then our Collect().
- kepler_compute.cpp: shared upscale slots, then Fortune's Weave's,
  then the Kirby Air Riders scan.
- nx2_gsv.h: ours, plus nx2's GetBufferMaxResolution and graphics
  device ids (1-based).
- nvhost_ctrl_gpu.cpp: engine support flag bits 40-44.
- lower_to_maxwell.h: ours as the base, with nx2's seven lowering
  commits applied one at a time. Second texture descriptor buffers
  are read bindless in TEX, TLD.SCR (level zero) and SUST; FSEL
  keeps its operand modifiers; TXD takes any channel mask.

lower_to_maxwell.h lowers 837 Fortune's Weave and 1183 Mario Kart
World shader dumps with the same rejects as nx2 and ours (12 and 0).

Assisted-by: Claude Sonnet 5.5 (conflict analysis and drafting)
</content>
</entry>
<entry>
<title>Linux and AMD: BC3 flashing on RADV, ASTC decode stalls, lower RAM usage, a buffer cache crash (#260)</title>
<updated>2026-11-02T07:45:39+00:00</updated>
<author>
<name>Whovian64</name>
<email>86082882+whovian64@users.noreply.github.com</email>
</author>
<published>2026-11-02T07:45:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=a407703f6d29a5ab73328b4ededb12cf29b2758d'/>
<id>urn:sha1:a407703f6d29a5ab73328b4ededb12cf29b2758d</id>
<content type='text'>
* host_memory: punch holes in the backing on Linux instead of zero filling freed memory

Freeing guest memory zero filled the memfd backing with memset, which
commits every page it touches. fallocate(PUNCH_HOLE) hands the pages back
to the kernel instead, and they read as zero afterwards. Only the partial
pages at the ends are still cleared by hand.

Mario Kart World on Linux (RX 9070 XT, 31 GB): peak RSS 23.1 -&gt; 15.9 GB.
EDEN_PUNCH_HOLE=0 restores the memset.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* fiber: don't zero fill the stacks, untouched pages stay unbacked

The value initialised stack arrays were zero filled when each fiber was
made, which commits the whole stack. Left uninitialised, the pages a
fiber never touches stay unbacked. Together with the descriptor ring
change, about 1.2 GB less RSS in Mario Kart World.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* vulkan: don't zero fill the descriptor update ring

Same as the fiber stacks: make_unique value initialised the whole ring
for every frame in flight. Entries are always written before they are
read, so allocate it without initialising it.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* vulkan: wait for the GPU after an ASTC transcode decode like the other ASTC decodes

TranscodeAstcToBcn (astc_recompression Bc1/Bc3 with GPU decode) was the
only ASTC decode recorded with wait = false. On RADV (RX 9070 XT, Mesa)
Mario Kart World with BC3 flashed heavily all over the screen, while the
uncompressed GPU decode, which waits, did not. CPU decode with BC3 does
not flash either. Waiting after the transcode removes the flashing; full
pipeline barriers around its copy did not, so the wait hides a race
somewhere else rather than fixing one in the transcode itself.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* vulkan: submit after an ASTC decode instead of waiting for the GPU by default

Every ASTC decode ended with scheduler.Finish(). Over a 19 minute Mario
Kart World Grand Prix that stalled the GPU thread 30.7 s in total, up to
1.2 s out of every 5 s while new textures stream in (track sections,
race starts), which is where the hitches were. Flushing keeps the
ordering that stops the BC3 flashing on RADV without the CPU waiting:
no flashing in play, and frames over 100 ms went from dozens to 3 in
about 7 minutes. EDEN_NX2_ASTC_FLUSH=0 restores the wait.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* texture_cache: over the expected use, evict costly images unused for 1800 frames first

The collector never deletes CostlyLoad images outside aggressive mode, so
once a cup moves on, the previous tracks' textures stay resident and the
cache sits over its expected use deleting the cheap images still in use.
When over the expected use, costly images unused for 1800 frames (half a
minute) now go first.

Mario Kart World Grand Prix on an RX 9070 XT: frames over 20 ms 8.8% -&gt;
4.0%, 58.7 fps average. EDEN_NX2_TC_OLD_AGE=&lt;frames&gt; sets the age, 0
turns it off.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)

* buffer_cache: no buffer for device addresses past the page table

FindBuffer indexed page_table, which covers 2^36 bytes, with any address.
Mario Kart World crashed after about 4.5 minutes with a uniform buffer at
0x72253b2f2890 (FindBuffer &lt;- UpdateUniformBuffers &lt;- DrawEnd from a
macro), reading far past the table. Treat such an address as no buffer.
Where that address comes from is still unknown; this only stops the
crash.

Assisted-by: Claude Opus 5.5 (debugging, profiling and code drafts)</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/fix/memory-skip-zero-clears' into test/linux-all-prs-plus</title>
<updated>2026-11-01T20:13:56+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-11-01T20:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=76812d0bd86c3dfbef473ad6236a68045ad3d4b5'/>
<id>urn:sha1:76812d0bd86c3dfbef473ad6236a68045ad3d4b5</id>
<content type='text'>
# Conflicts:
#	src/common/host_memory.h
</content>
</entry>
<entry>
<title>texture_cache: mark guest memory textures were uploaded from cold</title>
<updated>2026-11-01T13:48:31+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-11-01T04:30:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=e2c512916c6f5042d030fcf1708043233f8df08e'/>
<id>urn:sha1:e2c512916c6f5042d030fcf1708043233f8df08e</id>
<content type='text'>
Once a texture is uploaded the host GPU has its own copy, and the guest
rarely reads that memory again, but it stayed in the emulator's working
set. Every 600 frames the guest ranges of images uploaded since (64 KiB
or more, not GPU-written or sparse) are marked cold through
HostMemory::HintCold, backing and CPU view, from a low-priority worker,
so the OS pages them out before anything else when it needs RAM. Their
contents stay; using them brings them back. Mario Kart World's title
screen at ~10 minutes: game memory in RAM 4.8-5.5 -&gt; 3.6 GB, the
emulator's real RAM 10.6-11.9 -&gt; 9.4 GB, frames over 100 ms not worse.

(cherry picked from commit ea36b2c5ca352f8c8cdcc829a2d3bde9bdc06ece)
</content>
</entry>
<entry>
<title>nx2: let the host page out texture pool backing first</title>
<updated>2026-10-31T05:32:04+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-31T05:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=a03e816886f4241309a6e77ba7df1ad922da1fc0'/>
<id>urn:sha1:a03e816886f4241309a6e77ba7df1ad922da1fc0</id>
<content type='text'>
Switch 2 sparse blocks and GPU-only regions get guest memory when a game
writes them (Mario Kart World copies 2-4 GB of compressed textures into
its sparse texture pools) and the texture cache reads it again only when
it builds an image there. Every 30 s, mark that backing cold: its pages
leave the working set (VirtualUnlock on Windows, MADV_PAGEOUT on Linux)
so the OS compresses or pages them out before anything else when RAM is
short. The contents stay. Mario Kart World: 8.5 GB of RAM in use at five
minutes instead of 9.0 GB on a machine with RAM to spare, frame times
unchanged.
</content>
</entry>
<entry>
<title>memory: skip clearing guest memory that is still zero</title>
<updated>2026-10-30T08:40:24+00:00</updated>
<author>
<name>Takoroka</name>
<email>137927095+Takoroka@users.noreply.github.com</email>
</author>
<published>2026-10-30T08:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=f260bcb5a26a6b6b9675b41969a273858f024c55'/>
<id>urn:sha1:f260bcb5a26a6b6b9675b41969a273858f024c55</id>
<content type='text'>
The kernel clears every page it hands out, and the backing memory is a
page-file section the host only gives RAM to once a page is touched. So
the clears themselves made every page of a game's heap resident: Mario
Kart World (12 GB layout) had a 12.5 GB working set 20 s after boot.

HostMemory keeps two bits per 64 KiB of backing: used (handed out by the
kernel at least once) and dirty (may hold data). Pages returned to the
kernel mark their granules dirty, and a zero clear only touches dirty
granules; a granule cleared in full is clean again. A new kernel on the
same memory marks everything a previous one used dirty, so leaked
processes can't leak data into the next game. KMemoryManager's
optimized-process fill and KSharedMemory's clear go through the same
path.

Mario Kart World, title screen and attract demo, 180 s: working set 20 s
in 4.7-6.4 GB instead of 12.5 GB, peak 14-17.6 GB instead of 20.1 GB.
</content>
</entry>
<entry>
<title>[common/core/dynarmic] Optimize page table allocations (#4219)</title>
<updated>2026-09-09T19:35:49+00:00</updated>
<author>
<name>Exverge</name>
<email>exverge@exverge.xyz</email>
</author>
<published>2026-09-09T19:35:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=5f142c7926d0c7fcbbd0ce30794d72f638a43b2a'/>
<id>urn:sha1:5f142c7926d0c7fcbbd0ce30794d72f638a43b2a</id>
<content type='text'>
Reduces the page entries from 32 bytes to 8 and rewrites `VirtualBuffer` to be more efficient in memory usage and specifically for large zero regions.

The page table will now only reserve 1GiB instead of 4GiB and of this memory it should only use at most ~8MiB.

This PR has the side effect of using Eden on Windows on low memory systems much more plausible since it would previously require ~10GiB of committable memory at front (despite using ~5-6 at most, inadvertently stalling other processes) where as now it should only require around the amount that it'll actually use.

Co-authored-by: Lizzie &lt;lizzie@eden-emu.dev&gt;
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4219
Reviewed-by: Maufeat &lt;sahyno1996@gmail.com&gt;
Reviewed-by: lizzie &lt;lizzie@eden-emu.dev&gt;
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
</content>
</entry>
<entry>
<title>[common/host_memory] Remove throw on benign path (#4359)</title>
<updated>2026-09-09T11:18:43+00:00</updated>
<author>
<name>lizzie</name>
<email>lizzie@eden-emu.dev</email>
</author>
<published>2026-09-09T11:18:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=c5f6f1ca5eaf16ff84aee7987c0c8d37a1d9d2b2'/>
<id>urn:sha1:c5f6f1ca5eaf16ff84aee7987c0c8d37a1d9d2b2</id>
<content type='text'>
The caller of GetFuncAddress already handles the case gracefully. Fixes crashes when the symbol aint present

Signed-off-by: lizzie &lt;lizzie@eden-emu.dev&gt;

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4359
Reviewed-by: CamilleLaVey &lt;camillelavey99@gmail.com&gt;
Reviewed-by: Maufeat &lt;sahyno1996@gmail.com&gt;
</content>
</entry>
<entry>
<title>[common] Switch to boost::unordered_flat containers (#4326)</title>
<updated>2026-08-31T00:58:09+00:00</updated>
<author>
<name>crueter</name>
<email>crueter@eden-emu.dev</email>
</author>
<published>2026-08-31T00:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=7fda6dde73ab9fa1eab40d43c90720a1d9ba054f'/>
<id>urn:sha1:7fda6dde73ab9fa1eab40d43c90720a1d9ba054f</id>
<content type='text'>
Replaces all instances of ankerl's unordered map/set with boost's
`unordered_flat_*` classes. This uses std::hash since boost::hash is
actually a lot slower.

Also adds an abstraction layer in `Common` so future changes are quicker
and easier.

Other implementation details:
- ankerl provided hash specializations for tuple and pair, so those were
  ported here
- std::erase_if doesn't work on boost, so just used the ADL'd erase_if

This should be about equal or superior performance as unordered_dense for everything except iteration.

Signed-off-by: crueter &lt;crueter@eden-emu.dev&gt;

- [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions).
- [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md)
- [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability.

-------------------

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326
Reviewed-by: Lizzie and Samuel &lt;lizzie@eden-emu.dev&gt;
Reviewed-by: MaranBr &lt;maranbr@eden-emu.dev&gt;
</content>
</entry>
<entry>
<title>[common] fallback to VirtualBuffer if we can't use file mappings (#4005)</title>
<updated>2026-06-15T20:05:42+00:00</updated>
<author>
<name>lizzie</name>
<email>lizzie@eden-emu.dev</email>
</author>
<published>2026-06-15T20:05:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cirakg.xyz/eglantine-cirakg/commit/?id=561adac0af563dc42ad5672aaf92e8c2001e98cc'/>
<id>urn:sha1:561adac0af563dc42ad5672aaf92e8c2001e98cc</id>
<content type='text'>
fixes:
- windows 8.1
- windows 7
- managarm
- openorbis

Signed-off-by: lizzie lizzie@eden-emu.dev

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4005
Reviewed-by: MaranBr &lt;maranbr@eden-emu.dev&gt;
Reviewed-by: Maufeat &lt;sahyno1996@gmail.com&gt;
</content>
</entry>
</feed>
