Skip to content

Call for contributors: AnyKyty architecture v2 — what the GPU writes, the GPU reads (path to playable GPU-driven PS5 games) #168

Open

Description

@simnJS

Call for contributors: AnyKyty architecture v2 — "what the GPU writes, the GPU reads"

AnyKyty already runs most of our test games well, but GPU-driven titles such as our bench title (a native PS5 title on an in-house engine) are stuck around 12–13 fps on a strong PC (Ryzen 9 7950X3D + RTX 4080 SUPER, 4K). After a lot of measurement, our conclusion is that this is not something more tuning will fix: it is an architecture problem, and it will get worse as more games move to GPU-driven rendering (UE5-style engines, compute-generated draw data).

We measured where the time goes, wrote two throwaway proofs of concept, and drafted a step-by-step plan. We are looking for people who want to take one or more steps of this plan. Everything below is measured unless marked estimate.


1. Diagnosis (six games, same build, same PC)

Game fps draws + dispatches / frame Execute thread µs per op write faults / frame buffer uploads / frame
Our GPU-driven bench title 11.6 3 789 + 2 616 9.85 1 933 46 MiB
A PS4-era open-world title 139 3 096 + 66 1.74 37 0.2 MiB
a UE4 title 71 4 242 + 78 2.47 11 0.7 MiB
a Unity title 150 992 + 73 3.81 52 1.0 MiB
a second UE4 title 93 506 + 17 4.62 6 0.2 MiB
a second Unity title 209 812 + 61 3.21 14 0.2 MiB

Five of six games are above 60 fps and are held by the GPU or by the game itself. The bench title has three walls stacked at 45–75 ms per frame: our Execute thread (~61 ms CPU), the GPU (45 ms, real busy time), and the game's own threads (write faults and waits). Each isolated fix only revealed the next wall, which is why individual optimisations gave 5–15 %.

Three root causes, present in all six games:

  1. The CPU redoes, per draw, what the console does at execution time. On PS5 the shader loads its own descriptors (T#, V#, S#) and tables from memory. We read, resolve, specialise, revalidate and record them on four CPU threads: 5.6–11.6 µs per operation on five games, 20.4 µs on the bench title. The measured floor for a Vulkan operation is 0.06–0.21 µs. The pathological case is data written by the GPU: the bench title builds its draw tables with compute shaders, so every CPU read of a word written in the current tick forces us to wait for the whole GPU queue to drain (once per frame, 5–21 ms).
  2. Guest memory exists in two copies kept coherent by page faults. Harmless when one thread writes a little (6–52 faults per frame). Explosive when eleven game threads write: one fault costs ~5 µs alone and ~71–77 µs under contention.
  3. Shader translation costs GPU time. The GPU runs a frame from the bench title in 45 ms where we estimate ~13–15 ms native (estimate). Biggest finding so far: PS5 scalar loads (S_LOAD_DWORD, one per wave) translated into per-invocation storage-buffer loads. Making them uniform made one full-screen pass ×22 faster and the whole frame's GPU time −15 % (landed in AnyKyty).

2. What was already tried and ruled out (please don't redo these)

  • Reusing recorded command buffers / diff-decoding PM4: between two real frames, 0 % of draws are byte-identical (games re-allocate per-frame memory).
  • VK_EXT_device_generated_commands (tested on a Unity title): only 23 % of draws eligible because descriptor sets were rebuilt by the CPU per draw; with resolution already this cheap, there is nothing left for DGC to remove, and each cut costs ~16 µs of GPU.
  • Guest memory imported as host memory for the GPU (VK_EXT_external_memory_host): GPU +57 % in our POC. Reads across PCIe are paid on every access.
  • Moving the CPU resolution earlier / to more threads: the resolver thread was only 36 % busy; the cost is in proving that an early read is still valid, not in the resolution itself.
  • userfaultfd + PAGEMAP_SCAN instead of faults: 1.5 ms per 4 GiB scan, ~93 ms per frame at 60 syncs. Linux-only as well.

3. Target architecture

Pillar 1 — "What the GPU writes, the GPU reads." The recompiler already classifies every load of a shader (control word, flattened word, descriptor). If the address chain stays in CPU-written memory, keep today's ahead-of-time resolution. If a word is written by the GPU (or reached through a pointer read from a GPU-written page), the shader reads it itself from a contiguous VRAM mirror of guest memory: first data words, then V# (a buffer becomes a mirror address), then T#/S# (image-heap index found through a GPU-side table). No GPU-written value ever becomes part of a module key, a specialisation or a revalidation. Second slice: once all resources are data, a draw no longer needs the resolver at all ("thin chain": decode, pipeline lookup, push constants, draw).

Today (the bench title) Target
GPU drains caused by Execute ~1 per frame, 8–12 ms 0 by construction
Execute time tied to GPU-written words up to 37 ms / frame ~0
Execute per operation 9.85 µs ≤ 2 µs (2.25 µs measured in-game on draws that already take a table path)
Modules per guest program 1.37 (up to 95) 1

Driver needs: Vulkan 1.2/1.3 core features (bufferDeviceAddress, non-uniform descriptor indexing, shaderInt64, storage images without format) and sparse buffers for the contiguous mirror. VK_EXT_descriptor_buffer is not required. Fallback is per shader: today's path.

Pillar 2 — "One mirror, writes that mark themselves." One sparse VRAM buffer mirrors GPU-visible guest memory (address = base + guest address). CPU writes stop faulting: at the first fault of a write site, the instruction is replaced by a jump to a trampoline that writes through the always-writable second view and marks a card table. Sync points scan the cards and upload dirty pages in stream order. Our own libSceAgc marks its pages at the source. The fault stays as the fallback, so unseen sites still work.

Today (the bench title) Measured target
Game write faults 1 933–2 301 per frame, ~77 µs each 99.3 % come from patchable sites
Thread time in faults ~136 ms per frame (all threads) 163 → 0.15 ms in a calibrated bench
Scan at sync points re-protection 6–28 ms per frame card scan 0.9 ms per frame at 587 syncs

This is the only fault-free tracking that works on both Linux and Windows. It does not move today's wall (removing 44 % of faults gave 0 fps on the bench title while Execute is the wall); it becomes the wall once Execute is light.

Pillar 3 — GPU translation cost. No proven factor yet. Leads: generalise the scalar-load rule (everything uniform per wave becomes a per-operation constant), fewer cuts and barriers (the bench title: 2 872 barriers per frame), native wave64 on RADV (NVIDIA only has 32-wide subgroups; splitting wave64 gave −5 % GPU there).

4. Proofs of concept (code on branch poc/architecture-v2)

POC 1 — who resolves descriptors, CPU or GPU (poc/gpuresolve/). Bench calibrated on a frame from the bench title: 3 800 draws + 2 600 dispatches, 180 passes, 8 textures + 4 buffers + 24 table words per operation, tables in a GPU-side guest-memory mirror. Six arms render the same image to the byte.

  • CPU: 0.056 µs per draw when the GPU resolves (0.21 µs/op on the draw+dispatch mix, 1.35 ms per frame) vs 9.85 µs/op in Execute in-game today.
  • GPU, draws: resolution in the shader is free (−4 to −10 %).
  • GPU, small serial dispatches: +6 % with a contiguous mirror, +28 % with a page table → contiguous wins.
  • One resolution pass per render pass: +2–3 ms/frame → rejected. Per-draw blocks in host memory over PCIe: +57 % GPU → rejected.
  • Same image and ≤ 2 % GPU cost on RADV (AMD iGPU).
  • Key insight: resolving on the CPU is nearly free in itself (+0.04 µs/op). Our 10 µs/op is the machinery that proves an early read is still valid (read log, revalidation, specialisation, faults, drains). A GPU reading at execution time needs none of it.

POC 2 — self-marking writes vs faults (poc/selfmark/). Bench calibrated on the bench title's fault profile (11 threads, 2 300 pages per frame):

  • mprotect + SIGSEGV: 163 ms of thread time per frame (~71 µs per fault), plus 6 ms of re-protection;
  • self-marking writes through a second view: +0.15 ms per frame, 0.9 ms with 587 sync points;
  • a first-fault site patcher (Zydis-based, patch.cpp) on real write sites: 99.3 % of faults covered, 0 failures, +0.98 ns per patched write, 5 µs to patch a site. Half of the sites are shorter than 5 bytes and need the neighbouring instruction relocated: the relinker can prove at conversion time that no jump lands there.

Not measured yet: the fps these pillars give in-game. Estimate only: pillars 1 and 2 could bring the bench title down to its GPU wall (~45 ms/frame). Going further needs pillar 3.

5. Plan — pick a step

Each step is shippable on its own, universal (nothing per game), and proven by an in-session A/B (KYTY_AB) on the bench title plus a non-regression run on other games. Days are worker-days, estimated.

# Step Days Risk Proof / stop gate
E0 Emit the 20 most expensive programs from the bench title with their GPU-written words read from the mirror (SRT root as a dynamic-offset uniform buffer); compare registers/size (nvstats) and time by compute replay 2 low Stop gate: more than +10 % GPU → change the emission form before E2
E1 Our libSceAgc marks its own pages instead of faulting 1 low write-fault counter
E2 GPU-written words and V# read by the shader, compute first (indirect args, GPU-formed V#, image tables, indirect descriptor tables, refused flattened words) 6–9 medium–high A/B on the bench title; stop if no gain beyond the error
E3 CPU pre-records: no execution-time revalidation for loads left to the GPU; resolver only prefetches 3–5 medium A/B on the bench title, [kyty-resolve] counters
E4 Thin chain: draws/dispatches whose resources are all data skip the resolver 6–10 medium A/B on the bench title + two other games
E5 Images as data: T#/S# → image-heap index via a GPU-side table; miss → fallback texture + miss ring; format/swizzle carried by the view 8–12 high one module per program
E6 First-fault site patcher + card tables (new concurrent code in Rust), safe zones and trampoline section from the relinker 8–12 medium fault count per frame; stop at sites ≥ 5 bytes if any wrong image or crash
E7 Contiguous mirror replaces the buffer-cache buffers (Rust spec + differential replay, like our tracker model) 10–15 high Execute buffer-cache and mprotect time
E8 Command-processor copies at their stream position, labels published at real GPU completion for GPU-written pages 5–8 medium existing ordering tests + A/B
G GPU track, offline proof first: per-operation constants for everything wave-uniform; fewer cuts; native wave64 on RADV 2–3 per proof — nvstats, real GPU time

Order: E0 and E1 now; E2 then E3 (the bench title's measured wall); E4; E6 in parallel from E1; E5; E7 with E8. Total 50–75 worker-days.

6. How to help

  • Comment here with the step you want to take so we don't duplicate work. Branch off AnyKyty, one step per PR.
  • Measure, don't estimate. Every PR needs an A/B inside one game session (KYTY_AB toggles a temporary switch per phase); the switch is removed once the A/B decides.
  • GPU time: measure real busy time (segment-level timestamps). Per-command timestamps serialise the GPU and doubled the bench title's GPU time in our own measurements (113 ms instead of 54).
  • New concurrent/critical code goes in Rust; the recompiler stays C++. No comments in code, please (project convention).
  • Especially welcome: people with AMD GPUs (pillar 3 and RADV checks), Windows testers (pillar 2's second view and vectored-exception fallback), and anyone with SPIR-V / Vulkan shader-compiler experience (E0, E2, E5, G).
  • Testing a game and posting logs with fps, [kyty-*] counters and frame times also helps a lot: we need more GPU-driven titles besides our bench title to validate the pillars.

Thanks to everyone already testing and sending PRs. This is a big one, and it is the path to running the new generation of PS5 games well.

Activity

  1. added
    help wanted
    on Nov 21, 2026
  2. Raghav314 commented on Nov 21, 2026

    @Raghav314

    I'm taking E1: our libSceAgc will mark the command-buffer pages it writes itself, instead of taking a write fault on them. The hook is already there: Allocate in libSceAgc/Command/src/Packet.cpp calls AgcDriverPrepareCommandWrite with the exact range before writing, and on the Kyty side that function does nothing yet. The fault stays as the fallback, so a write that races an upload still works.

    Before the change I'll check how many of the write faults actually come from libSceAgc's own stores and how many from code the game inlines (the downward embedded data is written by the game, not by libSceAgc). Each fault gets classified by its faulting address. On Astro Bot's hub, about a quarter of the guest write faults land in command-buffer segments; GTA V in game opens about 10k 64 KiB blocks per second. The PR will show the write-fault counter and an in-session A/B (KYTY_AB) on those two games.

    Branch: perf/kyty-agc-self-mark off AnyKyty.

  3. Raghav314 commented on Nov 21, 2026

    @Raghav314

    E1 update: I measured where the guest write faults come from before building anything. A temporary diagnostic classifies each write fault by the module that contains the faulting instruction, on the current AnyKyty build with an RTX 4090. Counts are per 10 s; handler time is our fault handler only, without the kernel's signal delivery.

    Game Code doing the write Faults Handler time
    GTA V (PPSA04264), in game the game's own code 87 288 (84 %) 2 217 ms
    the game's libc (memcpy) 16 049 (15 %) 112 ms
    our libSceAgc 543 (0.5 %) 7.7 ms
    ASTRO BOT (PPSA01325), hub the game's own code 3 538 37.5 ms
    the game's libc (memcpy) 2 408 31.2 ms
    our libSceAgc 0 0

    Our libSceAgc's own stores already fault only about once per 64 KiB command block, since those blocks open as a whole on the first fault. Most command-segment faults come from the game's memcpy into the segment, which libSceAgc can't mark. In GTA V, most of the game-code faults land in a block that also holds a page the GPU wrote (about 40k), or in a buffer of the cache (about 38k). Both take the single-page path.

    So on these two games E1 would remove at most 0.5 % of the faults. We'll also run the same diagnostic on Ghost of Yōtei and come back here with its numbers, then build E1 only if libSceAgc's share there is worth it.

  4. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Raghav314 thanks a lot, measuring before building is exactly the right call.

    We already have the Ghost of Yōtei split (same idea: each write fault classified by the module holding the faulting instruction, bpftrace on the game process, current AnyKyty, RTX 4080 SUPER, 4K):

    Code doing the write Share of write faults
    the game's own code ~61 %
    the game's libc (memcpy and friends) ~31 %
    our libSceAgc ~7.4 %

    That is ~2 300 write faults per frame, coming from only 639 distinct instructions (6 sites make 50 %, 59 make 90 %, 248 make 99 %), all plain stores (mov, vmovups, vmovntdq…).

    So your numbers and ours agree: E1 alone is small (0.5 % on your two games, ~7 % on Yōtei). It is still worth it as a cheap first step on Yōtei-like titles, but the real lever is E6 (patch the faulting store site on its first fault so it marks its page itself): it covers the game code and the libc memcpy too. In the POC (poc/selfmark/patch.cpp on poc/architecture-v2), 310 of Yōtei's 318 hot sites were patched and verified (99.3 % of its faults), 0 failures, +0.98 ns per patched store.

    If you want to fold E1 into E6, or take E6 directly, that would be great. Either way, please post the Yōtei-like numbers you get and keep the KYTY_AB A/B in one session. One caution from our measurements: removing faults alone did not move Yōtei's fps last night, because its current wall is the Execute thread (see pillar 1). The fault work pays off once that wall moves, and on weaker CPUs.

  5. Celegans12 commented on Nov 21, 2026

    @Celegans12
    Collaborator

    I'd like to take E0, and then E2 if E0 passes its gate. We're on Windows with an RTX 3080 Laptop + i9-11900H, running Yōtei 1.008 at our Teshio Ridge save, where your slope test puts Execute at 0.6-0.7 frame-ms per thread-ms (#55). So the effect of E2/E3 should show up directly in frames here, and we can measure it with the same session A/B.

    My plan for E0: take the 20 most expensive Yōtei compute programs (by our per-shader GPU timer; the cloth solver 0x53f2b6c8a752875a and the particle passes lead it), emit each with its GPU-written words read from the mirror, with the SRT root as a dynamic-offset uniform buffer as in your table, and compare against today's module by register count, code size and GPU time in a compute replay. Then I'll stop at your +10 % gate before touching E2. I'll start from poc/architecture-v2 (397cc6cd632) for the emission side and branch off AnyKyty for the step itself, one step per PR.

    A note on our measurements so far: the GPU numbers I posted today came from a timestamp around every draw and dispatch, which you've found serialises the GPU. They're fine for comparing two heads, but not as absolute GPU time. For E0 I'll use segment-level timestamps and the replay times, as you suggest.

    Two questions before I start. Is there an existing replay harness for single compute programs that you'd want E0 to use, so the numbers line up with yours? And do you already have the list of which loads of those programs count as GPU-written in your classification, or should E0 derive it from the recompiler's load classes on our captured state?

    AI-assisted: yes

  6. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 thank you! For transparency: we've already started E0 on our side (Linux, RTX 4080 SUPER, Ghost of Yōtei 02.002, the 20 most expensive programs, both emission forms, register and code size from nvstats plus real GPU time). The result is expected within a few hours; we'll publish the numbers and the tool on the poc/ branch so you can replay it.

    Your measurement on Windows and Ampere (RTX 3080 Laptop) stays very useful as a second point: another driver, another GPU generation. You can run it with our tool as soon as it's published, or with your own.

    E2 is yours if you want it, once E0 passes its gate (less than +10 % GPU). We won't start it on our side.

    On your two questions: the harness for E0 will be the tool we publish with it (the existing kyty_compute_pipeline_replay from #133 only replays pipeline creation and doesn't dispatch, so it can't give GPU time). And the list of loads we treat as GPU-written for those programs will be part of that publication, so you won't need to derive it separately.

  7. Celegans12 commented on Nov 21, 2026

    @Celegans12
    Collaborator

    @simnJS thanks, E2 it is, after your E0 gate. While E0 runs I mapped where GPU-written words still turn into CPU state on the current head, so E2 can start as soon as the gate passes. A few things came out of that where I'd like your direction before writing code.

    At our Teshio save the resolve thread refuses about 38k dispatches per 10 s: two thirds because the walk hits a GPU-written word, the rest because the program uses the image heap (that part is E5). The GPU-written words that still reach the CPU are the ones something exact depends on: a word used as the address of the next walk level (FlatWordsReadOnCpu), V# fields that end up in the module key (ResourceSpecialization), indirect dispatch args, indirect descriptor key tables, and image tables. My first slice would be a counter that splits the refused loads by what they feed, so the order of the rest follows the measured size.

    1. Mirror form. On this RTX 3080 Laptop (driver 621.14) both sparseAddressSpaceSize and maxBufferSize are 1 TiB, so a literal "base + guest address" mirror of the whole guest GPU range doesn't fit here; it would have to cover the mapped windows only. AnyKyty already has the 16 KiB page table read through BDA (bda_load_u32), which sees GPU writes in stream order. Should E2 start on that page table and move to the contiguous mirror with E7, and could your E0 run also time the page-table form, since POC 1 put it at +28 % against +6 % on small dispatches?
    2. V# formed by the GPU. If the shader reads a buffer through a V# the GPU formed, the CPU tracker learns about writes through it too late today (the GPU write bitmap is only processed at garbage collection). Would you rather E2 cover read-only buffers first, or is there a planned way for the tracker to learn those ranges in time?
    3. Chased words. For a word that only feeds the next address, is a per-dispatch flag in push data acceptable, or would you rather have one module variant per set of chased words?
    4. Does your list of GPU-written loads for E0 split them the same way (address-only, V#, key table, args)? If so I'll use your classes instead of mine.

    Our machine has the rest of what the plan lists (BDA, shaderInt64, non-uniform indexing, sparse buffers, storage images without format, pipeline statistics). I'll run your E0 tool here as soon as it's on the branch.

    AI-assisted: yes

  8. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 great mapping, thanks. Answers:

    1. Mirror form: start E2 on the existing BDA page table. A literal "base + guest address" mirror of the whole range doesn't fit a 1 TiB sparse space, so the contiguous mirror (E7) would only cover the mapped windows anyway. E2 on the 16 KiB page table keeps the stream-order visibility of GPU writes we already have; moving to the contiguous mirror becomes an E7 change behind the same shader-side load. Our E0 run will now time the page-table form too (alongside the contiguous mirror), on the 20 real programs, so the +28 % vs +6 % from the POC gets checked on real shaders.

    2. V# formed by the GPU: read-only buffers first. Reads through a GPU-formed V# need nothing from the tracker. Writes through one would need GPU writes tracked at sync points instead of at GC; that belongs with E7/E8. If a program writes through such a V#, keep today's path for it in E2.

    3. Chased words: per-dispatch flag in push data. One module per program is a goal of the plan (Yōtei sits at 1.37 modules per program, up to 95), so we'd rather not add variants per set of chased words. If E0 or your A/B shows the branch costs something measurable on a real program, we can revisit for that program only.

    4. Load classes: yes. Our E0 now splits the GPU-written loads exactly as you listed: address-only words, V# fields feeding the module key, indirect args, indirect descriptor key tables, image tables, with count and cost per class. Please use those classes. The tool goes on a poc/ branch with the results.

    Your first slice (a counter splitting refused loads by what they feed) sounds right as the start of E2. Thanks for taking it on.

  9. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 E0 is done: E2 is a go, and it's yours. Tool and code on poc/e0-gpu-reads (6fb1dbdfbd). Everything below is GPU time only, measured as ratios against today's emission, on a rented RTX 4090 (driver 615.71); E0 says nothing about fps, since it moves no CPU work.

    What was measured

    • 25 Ghost of Yōtei programs emitted, 17 timed with a usable result, 13 of them on inputs captured in game. They cover 83 % of the GPU time of the 20 most expensive programs.
    • 176 output comparisons (each form against today's, and today's against itself): 0 differences. All modules pass spirv-val. Registers on NVIDIA unchanged in sum, code −2 %.

    Result

    • Form B (V# by mirror address, words read by the shader, SRT root as a dynamic-offset uniform buffer), weighted by Yōtei's GPU time: −4.6 % serial, −5.8 % overlapped, so faster than today, well under the +10 % gate.
    • Two opposite effects: V# by address gain (0.93 of today); words read by the shader cost (1.02-1.04 weighted). Outside the cloth solver, B is even with today.
    • Per program the gate isn't held everywhere with plain B. The selective form (only chains that go through GPU-written memory are read by the shader, which is what pillar 1 says) gives −5.8 % / −6.8 % weighted; one program stays at +17-19 % (about 0.3 ms per frame).
    • The cost of the shader-read words is in words reached through an address chain, not root words: the prototype re-reads the whole chain at each use.

    Your question on the page table

    • With a simple inline lookup: +9.2 % / +2.9 % (selective: +5.3 % / +1.0 %).
    • With the existing bda_load_u32 / get_bda_pointer at every access: +89 % / +74 %, up to ×6.5 on one program.
    • So if E2 starts on the page table, the simple inline lookup is a must, and it's worth re-measuring on your 3080 Laptop.

    Recommended form for E2

    1. V# by mirror address for every buffer described by words, GPU-written or not (it's a gain, and the V# fields then leave the ResourceSpecialization key).
    2. Words read by the shader only for chains that go through GPU-written memory (selective form).
    3. SRT root as a uniform buffer, not by address.
    4. Share the words of a chain instead of re-reading it at each use: the first thing to try on the three programs above +10 %.

    Your question on classes: kyty_e0_emit writes them per program (classes in its info.txt): data words, address-only words (FlatWordsReadOnCpu), V#, T#, S#, indirect descriptor key tables and image tables, each with the share read from GPU-written memory. So you can use ours. In the captured programs, the GPU-written V# is the most frequent class and costs nothing; address-only words in GPU-written memory are rare (the pointer usually sits in CPU-written memory and points into GPU-written memory). Indirect args weren't covered (the captures only took direct dispatches); [kyty-resolve] counters in game would size them at the start of E2.

    Limits: 6 of the top 20 without a usable time (still under the gate at the worst measured ratio), one capture per program, a rented GPU rather than our PC's, bench times that differ from the game (only ratios count), indirect buffers and image tables left to the CPU (E5), and the in-game capture patch isn't on the branch, so without it emit.sh falls back to synthetic inputs. poc/e0/ has the replay steps (build.sh, emit.sh, bench.sh, summary.py); the bench is standard C++20 and Vulkan but hasn't been compiled on Windows yet.

    Your questions 2 and 3 (GPU-formed V# and the tracker; chased words) are E2 design calls; we'll answer them separately.

  10. Celegans12 commented on Nov 21, 2026

    @Celegans12
    Collaborator

    @simnJS thanks, that's a clear go, and the selective form plus "V# by mirror address for every buffer" is a nicer starting point than I expected, since the V# part is a gain on its own and takes those fields out of the key. I'll build E2 in that order: V# by mirror address first, then shader-read words for chains through GPU-written memory, with the root as a uniform buffer and chain words shared rather than re-read.

    On the page table, I'll go with the simple inline lookup from the start and re-measure it here. I'll also compile your poc/e0 bench on Windows and run it on the 3080 Laptop as the second data point, before writing E2 code, so we know whether Ampere and the Windows driver agree with your 4090 ratios.

    Also thanks for folding the label deferral in, and for the cloth fix. Both will be in our next Yōtei build, and I'll post the laptop numbers when it's measured.

    AI-assisted: yes

  11. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 for coordination: we're taking step G, generalising the rule from the 4K pass so that the PS5's scalar loads are translated into uniform loads instead of one load per invocation, offline first, without touching the SRT root or the V# that E2 covers.

  12. Celegans12 commented on Nov 21, 2026

    @Celegans12
    Collaborator

    @simnJS first E2 measurement, before any E2 code: a counter that classifies every resolution Execute has to do because of a GPU-written word, by your classes, on our Yōtei build at Teshio (your head of this afternoon plus our commits, RTX 3080 Laptop). It changes the picture a bit, so I wanted you to see it before I go further.

    Per frame, those resolutions cost Execute about 5.4 ms for dispatches and 0.6 ms for draws. Almost all of it is V#: 98 % of the dispatch refusals and all of the draw ones. Indirect args are 0.6 ms, T#/S# 0.2 ms, and address-only words and key tables are practically zero. The catch is that one compute program carries 4.5 ms of the 5.4: about 280 dispatches per frame of the program under the game's "Proxy Set Cull" marker (our hash 0x3e9ec76bb9964bff), with about 385k V# loads per 10 s. Its GPU-formed V# are written through, so under the rule from your answer (written-through V# keep today's path in E2) it stays on the CPU, and the first slice covers only about 1-1.5 ms per frame here.

    So I'll still build the read-only V# slice first as agreed, but the big item on this title is a write through a GPU-formed V#. I'm looking at whether that program's writes can be bounded per dispatch from the V# itself (the range num_records × stride describes), so the tracker could mark it GPU-written at submit instead of learning it at GC. If that holds, it would be exact to include V#s whose written range is fully described by the V#. Would that be acceptable in E2, or do you want those to wait for E7/E8?

    Details

    One 10 s window, 93 frames, counter on (KYTY_E2_STATS=1), 92.8 presents per 10 s in that leg.

    dispatches draws
    refused for a GPU-written word, per frame 289.5 (ahead walk 284.5, table revalidation 5.0) 101.5
    Execute time resolving them, ms per frame 5.40 0.62
    of which GPU-formed V# written through 4.75 ms 0

    By class (first blocking class, refusals per 10 s, ms per frame): dispatches: vsharp_key 26,284 (4.58 ms), indirect_args 465 (0.61), T#/S# 170 (0.21); draws: vsharp_key 9,439 over 60 programs (0.62). Address-only 1, key tables 0.

    Top dispatch programs by Execute cost: 0x3e9ec76bb9964bff 4.50 ms per frame (25,316 refusals per 10 s, 384,652 V# loads), then four indirect-args programs at 0.10-0.31 ms each, 0xe7a45b7d19e249fa 0.23 ms (V# + T#/S#).

    AI-assisted: yes

  13. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 great measurement, and it does change the picture: one program at 4.5 ms of Execute per frame is the biggest single item we've seen.

    On including written-through GPU-formed V#s in E2: yes, but not by marking the range at submit from the V#. At submit, the V# is a GPU-written word of the current tick: reading it on the CPU to get base and num_records × stride is exactly the drain E2 exists to remove. It would only be exact if we waited for it, and guessing it from the previous frame is the kind of speculation that just cost us #170.

    What we'd accept in E2, as a second slice after the read-only one, with its own A/B:

    1. Shader-side write marking. For stores through a V# that the GPU formed, the shader marks the written pages itself in a GPU-side bitmap. That means one atomic OR per wave and per 64 KiB block touched, not per store: coalesce first in the wave (lane 0 after a ballot of block indices).
    2. The tracker consumes that bitmap at the next sync point the CPU actually waits on (the label or fence before a CPU read of that memory), not at GC. CPU reads that fault on a marked block take the normal GPU-written path.
    3. The exact range then comes from the shader at run time, so it stays correct even if the V# changes every frame, and the CPU never reads the V#.

    Before building it, please measure the cost of that marking offline on 0x3e9ec76bb9964bff with the E0 tool (poc/e0, same method: captured inputs, batch timestamps, outputs identical). If the atomics cost more than they save, we'll keep that program on today's path and move the write side to E7/E8.

    Order stays: read-only V# slice first (your 1-1.5 ms), then this.

  14. simnJS commented on Nov 21, 2026

    @simnJS
    OwnerAuthor

    @Celegans12 a coordination note on step G, so our branches don't collide with your E2.

    What G touches

    • IR::Bindings: a new field, flattened_srt_uniform_index (serialised).
    • DefineDescriptors: a uniform index for buffers read by S_BUFFER_LOAD and never written, plus a uniform view of the flattened table for words at a constant index below 4096.
    • EmitReadConst, EmitReadConstBuffer, EmitReadCallWord.
    • RenderExecutor::RebindBuffers, which fills that view.

    What G leaves alone

    • The form of the SRT root, and the V#.
    • S_LOAD by address (2,202 loads over 287 Ghost of Yōtei modules) and S_BUFFER_LOAD on indirect buffers (5,514 loads over 74 modules). Those are the chain words that E2 moves to the mirror.

    Please say if you see an overlap with your E2 branch.

  15. Celegans12 commented on Nov 21, 2026

    @Celegans12
    Collaborator

    @simnJS thanks for laying it out. There is one real overlap and a few nearby edit sites, and I think a clean split is easy.

    The overlap is buffers read only by S_BUFFER_LOAD whose V# the CPU knows (root user data or SRT words). My first E2 slice, as written so far, puts every read-only, untyped buffer with a word-described V# on the mirror address, and that includes those constant-only ones, which are exactly the buffers G wants as a uniform buffer. I'd split it this way:

    • G owns buffers read only by S_BUFFER_LOAD whose V# the CPU knows: they stay bound and get your uniform index.
    • E2 owns buffers with vector reads (buffer_load*), by mirror address.
    • E2 also owns any GPU-formed V#, constant-only or not, from E2's second step on, since the CPU can't bind those anyway.

    In my slice that's a single change (skip constant-only buffers when choosing what to mirror), and I'll make it now unless you'd rather draw the line differently.

    The other contact points are mechanical: E2 adds a serialised field to IR::Bindings next to your flattened_srt_uniform_index (same field list), gives mirrored buffers no descriptor index in DefineDescriptors (the same loop where you add the uniform index), and adds one loop in RebindBuffers after the bound buffers to fill the mirror slots, separate from your table view. I don't touch EmitReadConst, EmitReadConstBuffer or EmitReadCallWord; the mirror path goes through the storage-buffer access helpers instead. So I'd suggest G lands first and I rebase E2 onto it.

    AI-assisted: yes

  16. 68 remaining items

  17. teepean commented on Nov 25, 2026

    @teepean

    I'd like to take E5 (images as data), unless it has already started on your side. @Celegans12 left the E7.5/E3/E5 side to you on 11-22, so if you'd rather keep E5, say so and I'll take something else.

    Setup: Linux, Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), Ghost of Yōtei at 1080p, ~19-20 fps at full detail on an AnyKyty-based tree (7de61e3451 plus local measurement switches).

    What we measured on Yōtei that bears on E5 (10 s windows, per frame):

    • The resolve thread refuses ~450 image-heap ops (~270 draws, ~166 dispatches), and Execute resolves them itself at ~25 µs each: ~11-12 ms of Execute per frame.
    • The image heap itself (acquire, lists, rebind, commit) is only ~2 ms of that. About two thirds is the SRT walk; the rest is images and specialisation.
    • Moving just the walk to the resolve thread (revalidated at execute) cut Execute's resolution from 13.9 to 9.4 ms per frame and moved fps by nothing measurable. That's the same lesson as yours: moving work doesn't pay, removing it does.

    Plan, measuring first:

    1. Counters. Per frame: heap programs, heap roots and their table sizes, distinct T#/S# per table, kinds per view, and how often a table's contents change between uses. These size the GPU-side table and the miss ring.
    2. Design posted here before any code. T#/S# become a heap index through a GPU-side table; a miss falls back to a fallback texture and a miss ring; format and swizzle are carried by the view.
      • Deletes: the per-op image-heap Acquire/Refresh/Intern on Execute, the image-heap refusal of ahead resolution, and heap kinds in the module key.
    3. One PR per step, with a KYTY_AB A/B on Yōtei plus a non-regression game, and the deleted lines counted.

    Two questions:

    • Should E5 build on feat/e7-5 (the mirror) or on AnyKyty?
    • Does E3 need to land first, or can the image side go ahead on its own?

    AI-assisted: yes

  18. teepean commented on Nov 25, 2026

    @teepean

    E5 step 1, the census. Measured on Yōtei, nothing built yet.

    Setup: same as above, plus a game-side detail-scale patch, so this is ~1,520 draws/frame at 25.9 fps. At full detail the image-heap numbers scale about with draw count; the full-detail figures are in my previous comment. Our image-heap census counter is printed every 10 s; per-frame values are averages.

    Heap state (stable across windows):

    Tables 26–29, 3.7 MiB in all; two of 1,442 KiB, then 124, 124, 96 KiB
    Views 26–29, ~970k dword slots, ~104k of them non-empty
    Live entries (distinct T#/S#) 49,296
    Kinds per view max 2 (14–18 views with 1, 7–8 with 2)

    Churn per frame:

    New entries 2.0
    Table words changed ~31,600 (~124 KiB rewritten)
    Refreshes 485, reading 1.73 MiB, 0 GPU-dirty
    Probes / interns 10,311 / 5,630

    So the tables are rebuilt every frame but point almost only at descriptors the heap already knows.

    Execute cost of image-heap programs (refused ahead, resolved at execute):

    ops/frame µs each ms/frame
    Draws 189 19.7 3.7
    Dispatches 170 24.2 4.1

    Total ~7.9 ms/frame of Execute. The heap work itself (acquire, rebind, commit, lists) is only ~1.3 ms of that; the rest is the full execute-side resolution that heap programs force.

    Design sketch for discussion (no code until you're OK with the direction):

    1. Lookup in the shader. Today Kyty probes every T# of a table on the CPU when the table's pages change, inside execute-side resolution, and fills a per-view slot buffer.
      • E5 instead has the shader turn the T#/S# words it loads into an entry index itself, through a GPU-side hash table: key = descriptor words, value = entry.
      • The CPU keeps that table up to date from interned entries: ~49k entries, ~2 new per frame.
      • The table words are read by the shader from guest memory (mirror or page table, as in E2).
    2. Misses go to a fallback entry and append the descriptor to a miss ring. The CPU interns those at the next sync, so a miss costs one frame of fallback texture, ~2 per frame here.
    3. Kinds leave the module key. Each entry carries its kind index, and the shader selects among the program's kinds (max 2 measured), so one module per program.
    4. Heap programs resolve ahead like any other program. The image-heap refusal goes away.

    Deletes: per-view slot buffers and their uploads, table probing and refresh, page watching of heap tables, ImageHeapPredictions, and the image-heap refusal of ahead resolution.

    Gate before E5 proper, like E0: emit the top heap programs with the hash lookup and time them in a replay. Stop if more than +10 % GPU, then do the KYTY_AB in game.

    Questions:

    • Is a hash lookup per descriptor load acceptable to you, or would you rather a GPU-side table indexed by table address/offset, like today's slot buffers?
    • And as before: base on feat/e7-5 or on AnyKyty?

    AI-assisted: yes

  19. teepean commented on Nov 25, 2026

    @teepean

    E5 gate, first answer to my own hash question: the per-load hash fails, by a wide margin.

    Bench: a synthetic Vulkan compute micro-bench on an RTX 3090 (NVIDIA 615.78.08).

    • 49,296 bindless textures (the census' live entries), a 4,096-T# guest table, a 131k-bucket open-addressing hash (mean 1.31 probes). Both lookups were verified exact on all 4,096 T#.
    • Segment-level timestamps: one pair around K dispatches with compute barriers between them, median of 15 rounds.
    • Three arms:
      • slot: today's per-view slot buffer, one dword load per T#;
      • hash: load the 8 T# words from the table, hash, probe, load the entry;
      • floor: entry computed from the index, no load.

    Hash vs slot:

    T# index samples/invocation 1 group 64 groups 1,020 groups 32,400 groups (1080p)
    wave-uniform 1 +34 % +72 % +66 % +27 %
    wave-uniform 8 +438 % +490 % +189 % +172 %
    per-lane 1 +120 % +144 % +61 % +67 %
    per-lane 8 +612 % +328 % +55 % +71 %

    The slot buffer stays within 3–15 % of the floor in the uniform cases.

    Why:

    • The hash turns one texture fetch into a chain of dependent loads: table words, then bucket, then value, then descriptor. That latency dominates small serial dispatches, which Yōtei has plenty of.
    • The shader does nothing else, so this is an upper bound. But the margin is too large for real shaders to dilute it under +10 %.

    Revised E5 direction: keep a slot buffer indexed by table position, and change who fills it.

    • Today Kyty's CPU probes each table's T#s when its pages change, inside execute-side resolution. That's the per-view refresh/probe/intern work plus the full execute-side resolution that heap programs force (~7.9 ms/frame of Execute at scale 0.15).
    • Instead, one GPU pass per sync fills the slots from the changed table words: ~4k T# per frame here. The hash runs there, once per T# write, not once per T# load.
    • Misses go to the fallback entry plus a miss ring, as before (~2 per frame).
    • Shader cost is today's. The CPU only uploads the table pages (or the mirror does, with E7) and interns misses.
    • Kinds: ≤ 2 per view measured, so the module carries both arms and the entry's kind picks one. Slot contents no longer feed the module key, so heap programs can resolve ahead.

    Still deleted: CPU probing and refresh, page watching of heap tables, ImageHeapPredictions, and the image-heap refusal of ahead resolution. The slot buffers stay, but become GPU-written.

    Next:

    1. Find out which Yōtei heap programs index the heap wave-uniformly vs per lane. A colleague is extracting that from the translated programs offline.
    2. A real-program replay of the top heap programs in the slot form, to confirm the shader side is level.
    3. A prototype of the GPU fill pass, behind a KYTY_AB switch.

    Open question for you: does the GPU fill pass conflict with your E3 plans (resolve preloads, no revalidation at execute)? It seems complementary, since it removes the reason heap programs are refused, but I'd rather check before building it.

    AI-assisted: yes

  20. teepean commented on Nov 25, 2026

    @teepean

    E5 follow-up: the slot form's GPU side checks out.

    The shader body doesn't change.

    • Today's heap shader reads its slot and switches on the entry's kind. The kind is numeric class × cube; a table profile has a single kind.
    • With KYTY_AHEAD_IMAGE_HEAP on (five Yōtei runs: plain, KYTY_AHEAD_HEAP_SHAPE, KYTY_AHEAD_HEAP_ROOTS, 10 s windows), predicted vs executed views always logged replays: ... other kinds 0. Only slot contents changed, never the kinds.
    • So E5 can keep kinds in the module key exactly as today. Only the slot contents move to the GPU, and the CPU never needs them. There's no shader-side change left to replay.

    The fill pass

    • One dispatch hashes the changed T#s of the guest tables, writes their slots, and appends misses to a ring.
    • Same bench as above (RTX 3090, 49,296 entries, 131k buckets), K = 20 passes with barriers, median of 9.
    • Verified exact on 131,072 T# with 2 % unknown descriptors (2,631 misses, all counted).
    Changed T# per pass GPU µs per pass
    64 6.0
    512 8.1
    4,096 8.2
    16,384 10.2
    104,057 (every non-empty slot) 35.8

    At Yōtei's ~4k changed T# per frame, that's ~8 µs/frame with one pass per frame, and ~36 µs even for a full refill.

    The caveat is pass count, not pass size. Kyty refreshes heap tables 485 times per frame today. One pass per refresh would add ~3 ms of serial GPU time, so the fill has to be batched: one pass per submit, or per sync that actually changed table pages. The miss ring is read back at the next sync, so a miss shows the fallback for one frame (~2 per frame measured).

    Status:

    • GPU side of E5: fine, at about +8 µs/frame.
    • Still to prove: the CPU side, i.e. how much of the ~7.9 ms/frame Execute spends on heap programs actually goes away once they resolve ahead. That needs the Kyty prototype behind KYTY_AB. I'll hold it until you've said whether E5 is mine and which base you want (AnyKyty or feat/e7-5).

    AI-assisted: yes

  21. teepean commented on Nov 25, 2026

    @teepean

    E5 CPU-side ceiling on Yōtei: Execute's image-heap cost nearly disappears, but fps moves only +2.7 % at this scene.

    What the ceiling does. A local hack on top of 7de61e3451, not a PR. It uses f474daa's predictions (restored locally), changed in two ways:

    1. Shape-less keys. Predictions are keyed by (root, step, first, table) only, without base, size or count, and hold up to 256 roots per key. Yōtei rebuilds its tables at new addresses and sizes every frame, so keys that include them were mostly unknown: ~520–900 "table unknown" per frame.
    2. Patch, don't redo. When Execute's replay finds the same kinds but another slot buffer, it rewrites the {slot_count, address} triple in the flattened SRT instead of resolving again. Slot contents never matter to the CPU; this is what a GPU-filled slot buffer allows.

    Execute still fills slots on the CPU (refresh/probe), so the fill pass isn't in it yet.

    Results. Same scene and settings, scale-0.15 detail patch, ~1,520 draws/frame, 3 alternating pairs:

    control ceiling
    fps 26.1 / 25.7 / 25.0 26.7 / 26.3 / 26.1
    image-heap ops resolved on Execute per frame 361 8
    Execute time on them per frame 7.5 ms 0.25 ms

    Ceiling counters per frame:

    • predictions: ~950 known, 5 unknown;
    • replays: ~260 exact, ~490 patched, 21 patch misses, 15 other kinds;
    • a new refusal class: 31 draws, 0.37 ms.

    The result is +0.7 fps (+2.7 %), 3/3 pairs positive.

    For comparison, two earlier variants:

    • Predictions alone: 25.2 fps.
    • 8 roots per key: 25.1 / 24.5 fps.

    Both are below control, which matches #170: missed predictions cost more than they save.

    Why so little fps for ~7 ms of Execute:

    • nsys GPU Metrics (10 kHz, same build) show GR Active 69 %, about 27.7 ms per ~40 ms frame. GPU fully idle is 11 %, in short gaps (mostly < 1 ms).
    • SMs Active is only 38 %, async compute 0.
    • The game's main thread spends most of the frame in three waits: a job wait, a GPU label wait, and a submit fence on earlier GPU work.

    So each Execute cut moves time into those waits instead of off the frame; we saw the same with other Execute-only cuts. At full detail (~3,100 draws), where Execute is ~50 ms/frame, the share should be larger; I haven't measured it there yet.

    Heap-index census of the translated programs (offline, by a colleague, from our dumps; last-write tracing, hand-checked on 2 programs):

    stage programs heap image ops per-lane uniform
    CS 133 278 200 78
    PS 58 154 24 130
    VS 24 26 0 26
    • Compute heap reads are per-lane waterfalls: readlane, then s_buffer_load_dwordx8 of the T# at table + id × stride, then sample, then loop.
    • The slot index is a runtime register in 457 of 458 ops.
    • A per-load hash would sit inside every waterfall iteration, which settles it: slot buffer, filled by a GPU pass.

    What this means for E5:

    • Kinds are stable.
    • Slot contents can leave the CPU entirely.
    • The ahead resolution then covers ~98 % of image-heap ops, without the redo cost that sank f474daa.

    The fps return depends on what else bounds the frame, though. Here that is the main-thread wait chain, not Execute.

    Next on my side: check the image with patched slots (screenshots), then the same A/B at full detail. If those hold, a clean version on AnyKyty: GPU fill pass, shape-less kind prediction, no CPU slot probing, behind a KYTY_AB switch.

    AI-assisted: yes

  22. teepean commented on Nov 25, 2026

    @teepean

    The same E5 CPU-side ceiling at full detail (no detail-scale patch, ~3,100 draws/frame). Same scene and settings, alternating runs.

    ceiling control
    pair 1 19.6 fps 19.4 fps
    pair 2 19.3 fps 19.1 fps
    image-heap ops resolved on Execute per frame 12 (8 draws + 4 dispatches) 450 (276 + 174)
    Execute time on them per frame 0.34 ms 11.0 ms

    That is +0.2 fps (~+1 %) for ~10.7 ms/frame less Execute work.

    At the reduced-detail scene it was −7.3 ms for +0.7 fps. So at both detail levels the ceiling removes almost all of Execute's image-heap cost, and fps barely moves.

    On this title and machine, Execute's total isn't what paces the frame. The game's main thread spends ~17 ms of a ~37 ms frame (reduced detail) waiting on three things:

    • a job wait released by a GPU end-of-pipe interrupt;
    • a GPU label on a compute queue;
    • a frame fence.

    Cutting Execute work that isn't on those ops' path just moves the time into those waits. We're now measuring the frame's critical path, from each wait back to the op, queue and thread that releases it, before deciding where E5-style work actually pays.

    So for E5 itself:

    • The design holds: slot buffer, GPU fill pass, shape-less kind prediction, no CPU probing. The resolve thread copes, and the image is unchanged (screenshots).
    • Yōtei can't justify it on fps, at least not alone. I'd keep E5 as a later step: it is worth it once the waits are fixed, or for titles where Execute is the wall (ASTRO BOT's op-count profile, per mrfelek above, might be one).

    Side note for anyone running Yōtei at full detail on NVIDIA: two of six runs here hung the GPU on the loading screen (Xid 109, CTX SWITCH TIMEOUT), one in each arm, so it isn't E5. I haven't found the cause yet.

    AI-assisted: yes

  23. simnJS commented on Nov 26, 2026

    @simnJS
    OwnerAuthor

    Status update on our side of v2 (E7.5, the guest-memory mirror), plus what we learned this week.

    E7.5 T1–T3

    • T1 (cache buffers become windows of one mirror of guest memory) and T2 (no buffers of their own; −1.5k lines, the old command memory removed) are done.
    • T3 removes the dense 768 MiB device-address page table: every address access goes through mirror_base + address, and misses go through the residency map. The code is done. Its first measurement was +40 % GPU time, all of it in compute. The cause was a serial chain on every device-address access: six metadata words, then the residency word, then a device-scope atomic on the usage word, and only then the data. The fix reads the metadata in one block, reads residency and usage with plain loads, and keeps the atomic on the rare miss path. A cross-model review then found a race in the first version of that fix (a stale plain read of the usage word could skip marking a block that was still in use). The usage bit is now set by an unconditional atomic OR whose result is never read.
    • The gate (T1+T2+T3 against the head, in one A/B session on the bench title) is running now, on a rented card of the same model and with the same driver as our reference PC. We'll post the numbers whatever they say. If it passes, T1–T3 land together.

    Two NVIDIA 595 compiler crashes worth knowing about

    • libnvidia-gpucomp segfaults on an OpGroupNonUniformShuffle that reads the first lane inside a waterfall loop (V_READFIRSTLANE compared against itself, then a ballot). The fix emits V_READFIRSTLANE as a subgroup reduction instead (fix(kyty): read the first lane with a subgroup reduction instead of a shuffle). It is in review for AnyKyty.
    • A second crash (+0xa3465b) shows up on Blackwell (RTX 50 series) only, while warming the bench title's cache. We don't know yet whether the T3 shader form triggers it. A control run (head only) on a 50-series card is next.

    Where this points

    • A piece of v2 already landed in practice: a compute shader whose buffer descriptor is picked at run time from a large table is now served by reading the V# on the GPU and reaching the buffer by device address, instead of being skipped. Before, a title's own GPU BVH build was silently skipped, and the refit after it spun forever on unwritten data, hanging the GPU.
    • The bigger lesson is that Kyty bakes the bound resources, their formats and sizes into each translated shader. On a large title that means hundreds of variants per shader, so pipelines cannot be precompiled ahead: we measured ~1 % hits for compute and pixel shaders with guessed states. We think the mirror is the foundation for the next step. That step is generic shaders that read their resources at run time through the mirror, precompiled for every shader of a title, with a two-tier compile: the generic version is used immediately, and the specialized one is built in the background and swapped in. This also meets @teepean's E5 result: removing Execute work barely moves fps while the GPU is the wall.
  24. simnJS commented on Nov 26, 2026

    @simnJS
    OwnerAuthor

    Sorry for the silence these last two days. Several of you were waiting on an answer from us, so here they are.

    @teepean, E5 (images as data): yes, it's yours. Nobody had started it on our side. Your measurements answer most of the design questions already:

    • the per-load hash fails on the GPU, and the slot form costs nothing new in the shader, since kinds never change and only the slot contents move. So it's the slot form, with a GPU fill pass;
    • your CPU-side ceiling (−10.7 ms of Execute per frame for ~+1 % fps at full detail) says the same as our own ceiling: on this title the GPU is the wall, so E5 won't show in fps there. That's fine. E5's job is to delete the CPU slot fill (refresh, probe, intern on Execute), not to buy frames today.
    • So the PR should come with a deletion ledger: which CPU paths go away, and how many lines leave. It should also have one in-run KYTY_AB showing Execute ms per frame and GPU busy (it must not cost GPU), plus a second title where Execute is the wall. @mrfelek's profile below is exactly that kind of title.

    @Celegans12, E2 slice 2 gate: go with the gate off (conservative marks). Your verify legs are exact (1.55 M views matched, no miss, conflict or demotion), the arms are level on fps and GPU, and Execute saves 1.9 ms per frame on the dispatch side, which is the whole point of slice 2. The strict gate costs 4.6 % for a guarantee the verify leg shows we don't need. Keep the strict gate only as a debug check, not a second runtime mode. For the PR: rebase on feat/e7-5-t3 once the T3 gate passes (status in my comment just above), and keep the deletion ledger (the record-time V# reads and the CPU binding and marking of formed views).

    @mrfelek, thanks for both. The opposite-profile title (Execute as the wall through op count, ~11,600 ops per frame at ~3.6 µs, almost no GPU-written reads) is exactly what E4 needs next to our GPU-bound bench title. Your perf breakdown (ExecutePreparedDraw 46 %, PrepareGraphicsBindings 20 %) goes into the E4 plan. And yes, please run the strict gate against KYTY_E2_FORMED_GATE=0 for Celegans12 on the 3080 Ti and the 780M with validation on: the RADV numbers are the ones nobody else has.

    @relativespace2K, sorry, that usagebench pointer went nowhere: it stayed local and we dropped it. The E7.5 numbers it was meant to give came from the in-game runs instead. What would help now is the feat/e7-5 mirror shim tests (kyty_shim_mirror_shadow, kyty_shim_mirror_windows) on the RX 6800 XT under Windows, once T3 is pushed. I'll ping you here when it is.

  25. simnJS commented on Nov 26, 2026

    @simnJS
    OwnerAuthor

    A small change to what I wrote above: we'd like to land the whole v2 batch in one go, so we'll do the integration work on our side tonight, with your designs and data. Your branches and measurements are the basis, and the credit stays yours:

    • @Celegans12, E2 slice 2: we're rebasing your feat/e2-slice2 (23a914f22c) onto the T3 stack as it is, with your commits and your authorship, and making the gate-off form the only runtime mode. Please look over the result when it's up. If you have anything newer locally, push it and we'll take it instead.
    • @teepean, E5: we're implementing the slot form with the GPU fill pass exactly as you measured it, and your census, gate and ceiling numbers are the spec. The note and the PR will credit the design to you. Your review, and a run on your 3090 when the branch is up, would be the most useful thing.

    We'll post the branches here, along with the T3 gate result.

  26. simnJS commented on Nov 26, 2026

    @simnJS
    OwnerAuthor

    The T3 gate result, as promised above.

    The first T3 gate run failed. On an RTX 4080-class card with the same driver as our reference PC, the T3 form compiles fine, but it stops the GPU while our bench title loads, in its cloth solver compute shaders (the GPU has not reached tick N in 10 s … the GPU stopped). The head doesn't stop there any more. The summaries before the stop count reads of mirror blocks that are not bound yet, so the lead is a dispatch that reaches a block by device address before the block is resident. GPU time and fps could not be measured on that run, because of the stop.

    T3 is now fixed outside the title: no dispatch reads an unbound block, the mirror tests pass, and the replays reproduce the reference images. The in-title gate is running again on Vast.

    What it means for E2 slice 2 and E5: both are rebased onto the T3 stack on our side (@Celegans12's commits with their authorship, and @teepean's slot form with the GPU fill pass, credited to the design). They wait for T3. We'll post the branches here once the gate passes, so you don't review something that still moves.

    @teepean, about the Xid 109 on the loading screen at full detail: that is very likely the same solver hang. If it happens on the current AnyKyty, the line compute shaders of the unfinished tick … that follows the GPU stopped names the shaders; please post it here.

  27. teepean commented on Nov 26, 2026

    @teepean

    Thanks. On the Xid 109s: the one I still have a log for was in the world, not on the loading screen. It was 00:42 local, on the scale-0.15 exe, on our 7de61e3451-based tree with local switches. It logged:

    [kyty] the GPU has not reached tick 453736 (lane 0) in 10 s (it is at 453616, 15 ticks issued after it): the GPU stopped, look for an NVIDIA Xid in journalctl -k
    [kyty] lane 0: GPU at 453616, next tick 453744
    [kyty] compute shaders of the unfinished tick 453624, last first: none recorded
    

    The kernel logged Xid 109, CTX SWITCH TIMEOUT. The two loading-screen hangs at full detail (21:20 and 21:30) were overwritten by later runs, sorry. I'll post the line from the next one, on a build that records the shaders.

    AI-assisted: yes

  28. Celegans12 commented on Nov 26, 2026

    @Celegans12
    Collaborator

    @mrfelek thanks for the offer, and sorry it took me three days to answer.

    The gate only matters for dispatches that form a V# on the GPU, which means the V# words were written by the GPU but the CPU walk still knows their address. On Yōtei that's almost all Proxy Set Cull, about 280 dispatches a frame. In a title without that pattern, both modes run today's path, and the A/B would only show that nothing regresses. Before spending a whole session on it, I'd do a short run with KYTY_E2_GPU_FORMED=1 and look at the [kyty-e2f] line. If "gpu-formed dispatches" stays near 0, the title can't tell the two modes apart. ASTRO BOT will probably come out like that, given how few of its ahead reads touch GPU writes. A GPU-driven title is more likely to show something, for example one of the UE5 titles from the game tests (#222).

    For a title that does form views:

    • verify: KYTY_E2_GPU_FORMED=1 KYTY_E2_VIEWLOG_VERIFY=1, once with KYTY_E2_FORMED_GATE=0 and once without it. Check the matched/missing/extra view counts and the misses, conflicts and demotions on the [kyty-e2f] line, plus any VUID- lines.
    • A/B: KYTY_E2_GPU_FORMED=1 KYTY_AB=40:KYTY_E2_FORMED_GATE KYTY_AB_SETTLE=8 for about 600 s. On our laptop the strict gate cost a GPU drain of about 4.7 ms once a frame, which is the number worth checking on other GPUs.

    One timing note: simnJS is rebasing slice 2 onto the T3 stack with gate-off as the only mode. So the run that helps most is probably the strict-against-gate-off check on 23a914f22cd now, and later the integrated branch once it's posted, to see that it still verifies on the 3080 Ti and the 780M.

    AI-assisted: yes

  29. Celegans12 commented on Nov 26, 2026

    @Celegans12
    Collaborator

    @simnJS thanks, and no worries about the silence. We were away for a few days ourselves while our usage limits reset. Nothing newer on our side, so 23a914f22cd is the one to take. When the T3 stack with slice 2 is up, I'll review it and run it on Yōtei on the 3080 Laptop: a verify leg with KYTY_E2_VIEWLOG_VERIFY=1 and an in-run A/B. It'd also give you a second NVIDIA card for the cloth-solver stop.

    One heads-up for when our numbers come in: we rebuilt our setup after a disk cleanup and are now on Yōtei 01.512.000 instead of 1.008. Expect a fresh baseline from us, not a straight comparison with the earlier numbers.

    AI-assisted: yes

  30. mrfelek commented on Nov 26, 2026

    @mrfelek
    Contributor

    @Celegans12 @simnJS I ran the check from Celegans12's comment first, on 23a914f22cd (feat/e2-slice2), RTX 3080 Ti 12 GB, NVIDIA 615.71.09, Linux, headless. KYTY_E2_GPU_FORMED=1, one run per scene. Both titles are UE5.

    Scene gpu-formed dispatches ahead reads around GPU writes walker loads refused on GPU-written lines
    Star Wars (PPSA28416), title and logo phase, ~11 fps 0 in 21 windows 0 ~5,800 per 10 s
    Hot Wheels garage route, ~27 fps 0 in 17 windows 0 0

    So neither scene can tell the strict gate from gate-off, and I didn't run the verify and KYTY_AB legs there.

    The scene that could show something, Star Wars' Jakku race, doesn't run on this branch on the 3080 Ti. All four tries stop as the race loads, 10-30 s after the start, while AnyKyty 7de61e3451 (no mirror) runs the same race through:

    • with KYTY_E2_VSHARP_MIRROR=1 KYTY_E2_GPU_FORMED=1: [kyty-mirror] could not allocate 32 MiB for the mirror: ErrorOutOfDeviceMemory (guestMirror.cpp:508);
    • with no E2 variables at all: the same mirror allocation error;
    • with KYTY_E2_GPU_FORMED=1 only, and once more with full E2: the GPU has not reached tick ... in 10 s, then Not implemented (result != vk::Result::eSuccess) at masterSemaphore.cpp:111. No Xid in the kernel log.

    Just before it stops, the mirror has 1.9-2.1 GiB of 64 KiB blocks bound (56-68 chunks of 32 MiB), on top of what the game itself uses on a 12 GB card. So I think the mirror's bound memory runs the card out of device memory in the race. Is there a cap on how much the mirror may bind, or a way to run slice 2 without the mirror for the gate check? Otherwise I'll wait for the integrated branch.

    (The VA Space alloc failed lines in the kernel log at start are the mirror probe's own room checks, so I left them out.)

    AI-assisted.

  31. Celegans12 commented on Nov 26, 2026

    @Celegans12
    Collaborator

    @mrfelek thanks, that settles it for those two scenes: with 0 formed dispatches, neither one can tell the two modes apart, so skipping the verify and A/B legs was the right call.

    Slice 2 can't run without the mirror, I'm afraid. A formed view reads the V# words and the buffer through mirror_base + address, so the mirror is what the slice is built on. As far as I know feat/e7-5 at T1 has no setting that caps the blocks it binds. That 1.9-2.1 GiB of bound 64 KiB blocks on top of the game is the T1 mirror's own residency, not something slice 2 adds. T2/T3 change how blocks are bound and evicted, so the Jakku race OOM on a 12 GB card is probably worth checking on the integrated branch rather than on this one. @simnJS, this might be a useful data point for the T3 gate: a UE5 race on a 12 GB card that runs on AnyKyty but runs out of device memory with the T1 mirror. I'd wait for the integrated branch and run the race there.

    AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: executearea: gpu-memoryhardhelp wantedperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions