Skip to content

fix(kyty): serve the named walks of a shader that also walks an untraced tree - #372

Merged
simnJS merged 1 commit into
simnJS:AnyKytyfrom
Raghav314:fix/kyty-rt-untraced-walks
Nov 27, 2026
Merged

simnJS merged 1 commit into
simnJS:AnyKytyfrom
Raghav314:fix/kyty-rt-untraced-walks

Conversation

@Raghav314

@Raghav314 Raghav314 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Source derivation refused a whole compute program when any of its intersections lay outside every walk over a named TLAS. Some shaders unroll two copies of a walk: one over a TLAS header from user data, one over a TLAS pointer loaded from memory, which the derivation cannot name. The second copy made the derivation refuse the first, so both ran empty.

Now only a program with no walk over a named TLAS is refused. Walks over a named TLAS are answered from the host query. Intersections outside them are marked empty by the same final pass as before, so their handling doesn't change.

Tested

Arch Linux (CachyOS), GTA VI (PPSA38500) pipeline cache, offline with kyty_rt_probe:

head of #366 this PR
Host-query sites, wave32 128 131
Host-query sites, all 124 variants (wave32 + wave64) 172 178
Empty sites, wave32 12 9
Empty sites, wave64 18 15
Empty sites, all variants 30 24
5d64274527a66d21 wave32, host / empty 0 / 6 3 / 3
5d64274527a66d21 wave64, host / empty 0 / 6 3 / 3
SPIR-V variants changed 2 of 97 (only 5d64)
Variants serving fewer sites 0
New invalid SPIR-V 0
UntracedWalk() fails passes
kyty_shim_rt_* tests, check_conventions.py pass pass

The 3 5d64 intersections that stay empty read their TLAS through a pointer loaded from memory. UntracedWalk() builds one walk over a named header and one over a header loaded from memory, and checks that the first is answered from the host query and the second stays empty. A Masked variant of the test walk's descriptor high word mirrors the mask the real shader applies.

Not tested in game.

Programs found only in the code cache have no recorded dispatch inputs, and the survey compiles them at both wave sizes. Reading each program's wave size from its code (the width of the instructions that write exec), the 12 manifest programs are wave32, as the manifest records, and the 56 code-only programs split into 43 wave32 and 13 wave64; 5d64 is wave64 code. Counting each program once at its own wave size:

head of #366 this PR
Host-query sites (68 programs) 128 131
Empty sites 12 9

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 620.73.04, Arch Linux (CachyOS kernel 7.3.6)
  • AI-assisted: yes

…ced tree

DeriveOracleWalks refused a whole program when any intersection lay
outside every walk over a named TLAS. A shader with one walk over a
named header and another over a TLAS pointer loaded from memory was
therefore refused, and both walks ran empty.

Only a program with no walk over a named TLAS is refused now. The walks
over a named TLAS are answered from the host query; intersections
outside them keep running empty, as before.
@Raghav314
Raghav314 temporarily deployed to repository-maintenance November 27, 2026 15:00 — with GitHub Actions Inactive
@simnJS

simnJS commented Nov 27, 2026

Copy link
Copy Markdown
Owner

@claude Review

@github-actions

Copy link
Copy Markdown

I checked the diff. The per-site refusal is replaced by a refusal only when no top-level walk over a named TLAS exists. The new UntracedWalk test covers both outcomes: the named walk is answered from the host query, and the walk over a TLAS loaded from memory stays marked empty. The Masked descriptor variant is generic and the test adds no title-specific data. I did not run the tests. The CI results and the reported offline survey still need to confirm that the final empty-marking pass behaves as described.

@github-actions github-actions Bot added the automerge Merge after maintainer approval and CI label Nov 27, 2026
@simnJS
simnJS changed the base branch from Brainrot to AnyKyty November 27, 2026 16:07
@simnJS
simnJS merged commit b7c6773 into simnJS:AnyKyty Nov 27, 2026
12 checks passed
@simnJS

simnJS commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix and the regression test. The patch applies cleanly on the multi-TLAS base. The named walk uses the host query and the walk through the untraced pointer stays empty. In-game rendering still needs verification.

Merged into AnyKyty in 17da676.

@simnJS simnJS added area: ray-tracing Native and emulated ray tracing, BVH walks bug Something isn't working medium A few days of work; needs some knowledge of the code needs: game Needs a PS5 title you dumped yourself, to reproduce or to test labels Nov 27, 2026

This branch was previously deployed

1 inactive deployment
repository-maintenance — 3d2666ce Deployed Nov 27, 2026 by Raghav314 via review #341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ray-tracing Native and emulated ray tracing, BVH walks automerge Merge after maintainer approval and CI bug Something isn't working medium A few days of work; needs some knowledge of the code needs: game Needs a PS5 title you dumped yourself, to reproduce or to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants