Skip to content

Contributing new shader and pipeline variants to precook #343

Backlog

Description

@simnJS

Part of #338. The goal is to discover shader and pipeline variants before their first use and to reduce runtime compilation without dropping work or changing rendering.

Pick a useful contribution

Start with a variant that still requires compilation after guest entry. A known guest shader hash can produce new variants when image views, buffer descriptors, sampler mappings, render targets, or pipeline state change. The interesting evidence is the missing variant and which input made it different.

PRs are especially useful when they do one of the following.

  • Discover an unseen variant offline from a validated creation record, effect pass, reflection entry, executable binding, or other input available before launch. Keep a runtime witness aside to check whether offline discovery predicted its exact key.
  • Make a proven-compatible shader or pipeline cover more resource states. Keep the existing exact fallback and justify why the reused shader sees equivalent descriptors and produces equivalent results.
  • Capture a previously unrecorded kind of pipeline in a portable recipe format, then show that a fresh precook loads that recipe and resolves the same request before guest entry.

A single exact recipe can help equivalent workloads. A general discovery rule or compatibility fix covers more tests and configurations. The portable recipe describes what to prepare. Each machine creates its own driver cache from its local copy of the title.

Reproduce and verify

  1. Use a known build with the compile audit. Set KYTY_PIPELINE_COMPILE_AUDIT=1 and KYTY_SHADER_VARIANT_LOG=1 in the environment used to launch the title. Keep the route, settings, and capture window the same across runs.
  2. Save the baseline stderr locally. Identify the exact module or pipeline key and the first create event marked compile_required after guest entry. A lookup reporting compile_required is a failed lookup. A background creation still counts as runtime work when it happens after guest entry.
  3. Compare against a prepared candidate using the same starting cache conditions. Show where the new recipe came from or which compatibility check covers it. Verify the target key is resolved before guest entry or served by a verified compatible pipeline. Report any remaining misses and unverified audit events.
  4. When changing matching logic, add a small synthetic regression that accepts the proven compatible case and rejects an incompatible case. Verify rendering or dispatch output when the change affects execution. Report the operating system, Vulkan driver, build, and results.
python3 tools/kyty_precook_audit.py before.log
python3 tools/kyty_precook_audit.py after.log

For more options, see docs/dev/THIRD_PARTY_KYTY.md. Depending on the build, the queued graphics capture and compute dispatch origin tools can help explain a miss. Keep raw captures, executable addresses, title details, assets, original or translated shader binaries, and driver caches local. Use generic names in code, fixtures, filenames, and public discussion.

Copyable prompt for an LLM

Work on AnyPS5 shader and pipeline precook. Read AGENTS.md and follow the repository's publication rules. Use the user's local assets and a local validation session.

Find one genuinely new shader or pipeline variant whose creation requires compilation after guest entry. Record the build, path through the title, settings, and starting cache state. Use the compile audit to identify the exact failing key. Explain which input was unknown or different, such as an image view, a buffer shape, a sampler mapping, an attachment format, or another pipeline parameter.

Look for an offline source for that input. If possible, synthesize a small candidate family using only evidence available before launch, then compare it against a held-out runtime witness. Distinguish a measured discovery from a guess. If you propose reuse, show why the live descriptors fit the prepared layout and preserve the exact path when the check fails.

Use existing precook and pipeline code where possible. Keep the change narrowly scoped and use a synthetic test for both a compatible and an incompatible case. Compare the same route and initial cache conditions before and after. Count compile-required events after guest entry and show whether the target was prepared before launch or served by a verified compatible pipeline.

Draft a PR linked to this issue. Describe why the variant was missed, how the implementation finds or serves it, the validation performed, and the remaining gaps. Keep title names, title identifiers, proprietary bytes, raw logs, machine-specific caches, and secrets in the local workspace. Use generic names and sanitized evidence in the PR.

Registry of already observed variant keys

This snapshot deduplicates 379 driver keys from 5 audited runs that completed their startup preparation gate. These are opaque pipeline or module keys from after-guest compile-required events. A key can change with the build, layout, or device options, so compare the pipeline kind and condition as well.

Search for your exact 16-digit key here before opening a PR. For a listed key, a PR can still contribute a new offline discovery method, a reusable fix, or validation on a different configuration. Candidate recipes enter this list only once a runtime audit observes their exact key.

Compute pipeline keys (317)
00d778b22331fae2  01a5481d721a2bc3  01b2fb8541da2fc0  020656a5d74c23c6
0251c8e57290298a  025fc1c2a3f63795  0311b2f2c4abb7b9  0397baa30ce5d02e
051cb9b7a81bdb69  0550fa21d27eff6b  0606285b453c45de  090e3212b305042d
0a208f3d1e87392f  0a2fa341fc3896ac  0b93d16cd95be22d  0cd0e3622d4e2187
0d19d673fe083bf9  0d8d0260a0dd2591  0dab899cef931a09  0e9b91485eea576b
101d67e75f69149d  1037fea20b8facf1  10826f3b707cdfaa  1107960aa96f639c
11a7f091998d2633  11bfc52c450f53c4  13a50223273c7ba5  1443697643f240c6
147c4e6575f4733e  15318f044ad4a5f4  15ba42d01f92fdd9  16bf1bdf89c52df8
1797de3efe3ae651  17fd47a11f729d86  1894d1db41da8270  19966346ebbf4727
1a84796ac0917896  1c1a16eacb873190  1dcd5c6092d7f11b  1f30af57fde8fd83
1f52bac14a53e7dc  1ffda20f480a6ae9  202fc89f8c7f1621  205157f8b363d082
239c31f5643092cb  24c9cadb0b97f422  2619245b8079442c  261c0cd5176a3f74
26c7711e7d5991ce  271b494f4a463505  279a93ebf2501661  283fae7666f93394
29302de40beb898f  294d8568e1739d28  29633bc00b763292  29c4d97b11cd926f
2afd29c5f7b2051f  2baa1df29a22ee47  2bd2de5950023583  2c03e0798f732bad
2ca8e01f90cbb28a  2d33f5bbb0beaa0d  2dfc10834647e73c  2e2a692a475d3e31
2f42c14ca3a2b2b2  2f512d566374fa2a  2ff53d307905290e  304bbee900f5708b
3135192e0b714471  313d1350b4162ce3  333968e404958742  33ac5cab2bbb7920
35ed27891382a291  38c3a9d0dc1d37c7  3a05efaa3b545e0e  3acd7d877ba605e8
3b8fdf36dc7e426d  3d373e79feae9cbd  3f5ae4bfdb9f8754  4124d972fdd0fbff
415b61bce0c364e7  416251471e013401  4173a80909ea4506  4284d2d7b29979a9
431aee3f0376f892  44750c3f668320d3  45004aee0ff1ae01  4506a20e5ddd0cc6
456bfc6c887971c2  46155b2ee78c7f58  46f60487b3e95c7d  47905c2d5ac8b729
47b1b0dc16073628  47ee11bee008cf85  4934cd24aedb6723  49f0f9636ad9d2f9
4a703755eeb23192  4be911d4d683f738  4c1016bc94db9982  4cca505000023487
4cfbad21ae39b633  4d6708d7bbb912b1  4f7e4350233db8f7  4faf981f933bfb03
5024291624202a41  508ad7d609be4c7d  51cb96330a16f18c  524211a94f954953
5318707cff013519  53c544674a267787  5565c40a189c9356  55a777b126bb4e49
578bf07c8bf5e581  5897e34836de3cdf  599798cc04825190  59fbf8b87a723f3f
5b158e01d1f3d046  5cc95307364406d4  5cd13e33d273641c  5da11c7daa5fcad8
607b092752aa1c8d  616e111552050acf  62f1dbda6ccfed96  6384d800d8450b38
642251bccf926cfc  64735c03e04b6275  64fb1331e2f9361e  64fc5ed6fc7d79be
67ca44052cd7fa23  6800d56f874674f6  682af536ef84d7f3  683ea5ced6c08828
69ec74a2a230a9c4  6a1ba7623c0fa79f  6c2a430f086456fd  6e8bcbc06c3f33d8
6fbdbf39594dc8cc  711573ac4c95569d  7182f30aff344836  731ced6a3938dbdc
740dc8bcb6730876  743ed94e24603af8  756057cf93172d87  767f2d75d614f823
77aa0889ddef8324  7822c298e470f886  78c30f58e4303868  78e4cbea66b2b058
7926fb3002adc3e9  7b165203086b9f0f  7e6b14f8f3f4e4d0  7f0ce1655de77310
804c1b32e759d357  8097d4653cebadd3  80e635c64ae43f1f  80f821dfb8ab3dbe
819704602254513e  83217af6050e505f  834b55e2d7c1f45f  836056eef5758275
849c591b43caf9b4  85de9135383454d5  878564fb550e1b50  8887721bf39071f1
89f9e83e3117eb32  8c5d30a52f02b12b  8c75cba11d58deb3  8c7ad3e55be56b0a
8c9259f7a0680e3b  8cb7c359ba7c756d  8cbe97cd85e17905  8dd8f5df03400d3c
8e89177fcc7d2661  902b5ae11f38b7c0  912226494399ec2b  914f56361718b2bc
9360273b59a34c90  94af8e77e20a93fa  94ba432471b06d02  94f4e7c2e260fe16
95267a47478b5aee  9560e14a6652fa49  95a56f55b635dd28  97772beedb59e0e0
98332103fdf0018d  983677ccc0dcd3fa  98c3760e585421b1  98c70f6e08245c29
99bb39e3a952aed4  9a49d4c0f1e758e1  9a8d7050800b01df  9c4fa6dabfae3fd5
9db26061d9af5b07  9f1b27c926bde2ba  a14cb2f728926b79  a34453e44f8b3556
a4493c67411f4f36  a4b159aa4615ce6b  a51f67c0020622d8  a5a27c4a3e2b79e8
a7016c81ea82ede2  a7b83e974407bed2  ab1c9ca22dc5c31d  ab2ce9bb9109eb37
ab94521c244f42be  acca46d3038339c7  acda37f70413a9d2  adf73f6d662da316
ae2c1febb0e45f3a  ae941d6363555011  aef0ac24027079fb  b0992d04e9723f27
b0ed2f0e24a594c0  b2662bc30126465a  b52bc6335a799606  b5a726beab0b45c4
b7ad7747e83472e1  b84198e8d64170f5  ba4731f9b0df5a7a  bad26755f4c2224a
bb9966ac2a9c6fc1  bbce61db943fd2e5  bcc5146f9d7c1455  bdb09dd66b80015d
c0339c7e54785fdb  c13a3e8bcf6c2c2e  c21cd84b093a9132  c2755e7682ccf4a3
c2875c948b85ddb3  c2a384b0cf0d762b  c2e8f32209404666  c341e24250ec9c50
c47855735df8f7db  c5473aa9ebe57ee9  c5a3c8eacbd05633  c640fcb2945d07c9
c6d29891fda7e428  c8474efa619fca21  c89f71b5baec58f0  c97026d846d3c6c1
c9f8ca6380ec1715  cced9537f7b6055b  cd09971fe6556c67  cdb8626f5d411332
ce059c6abaa4b37a  cebdb53d26a20bc4  cfd097479fe2bde8  d006938289936ca6
d031f27e7a7a514d  d0a35753d4326176  d1372056f02c4370  d2bb905022f1cede
d2dd5e0c489a20bd  d2ed8af640b2e09b  d3ae7ab93516e997  d42ce1485b8e761a
d4db8b7f4e7baea4  d55a92da49a49b73  d5cd46febd95f183  d62a42b3db2dc4db
d8b4d98184afb9a0  d8c6871907dba355  da8f72ff646d836d  db6cb6cc279643cc
dc16c2b67e00f77c  dda057c7a4830a8e  de064bcebee8a55c  deb330ea50516d72
debff87151a58fb0  decf10c764349e4d  deda5e2bef9cf3ce  dfc4ea32cd47cf64
e11f034aae2e5a2b  e1820969a3d62f70  e1f7fe6d8a3d112f  e1fa3d92c90588fc
e40fbe0d0663941b  e4bb6335478725fb  e54412ada9555b9b  e708438915983283
e8d9f84629470804  e8f213516728dc54  e99e4f6e5a953847  e9dc6e19296dcb4a
ebca77f2b0a3fc11  ec29bfeb8cf2e664  ec92b1626e18d83e  ee32e08171c5b182
eedd0ce236998ccb  eef0c4b69a24ca60  f0708ab2f1bfd41a  f0d9fde48a27d661
f15444f8c63d0aac  f1d6f5a912cf90e6  f27038becf8b1b5a  f348f98111cedd82
f34b62f181ad8309  f3d55212c3ac7e31  f3e2e3c22858d097  f45edc7fb0c2b6b5
f4b2d174e7b8881c  f524bb5bcdf33405  f5e7459aa1c37cf9  f6420f8b8404e16f
f70d22c2ffcaad3f  f7a0cf637d60b24c  f7efc18a02356aad  f93037b4c5ecfed8
f97f08dc75c8f955  fa20462cacde5aff  fa44b1252634e055  fc1875859166a1ca
fc191058f4020089  fc359a18df32e597  fcd5aef527ab96b3  fcdf94cc88376409
fe673fdde4e97341
Graphics pipeline keys (26)
06a1b5a8ce9cc6cb  14bbb5e08b5513c7  1fdba7217c27cd58  2820392a30097f2f
2fd2f7da45c2ca98  2feee717fcc4777c  3b43602d2e07c9e9  49e6297c9ecce8a1
4a10cfbf439d7530  60f2f8350ad533e7  6c11890b425b7787  779e7a26dc65ba27
7b145777bdbc6b77  7b4a26532a4cb4a3  8650e599611501f2  890a0c84de7ed5bd
958bbf046b1cecd6  a1caac817f929a8a  b8937a5e9691933a  cbed38e4fc41e6d9
d1602963a0a355d5  dd225e77115e47d8  e197ebc9c478a0ed  f89814a2b7efdf87
fa576858278b9366  fc6705eb1f671920
Graphics library keys (36)
06a1b5a8ce9cc6cb  14bbb5e08b5513c7  1fdba7217c27cd58  2052f7b96c339b6b
2820392a30097f2f  2fd2f7da45c2ca98  2feee717fcc4777c  3b43602d2e07c9e9
3c510c7683059216  47e69fe7fd03a537  49e6297c9ecce8a1  4a10cfbf439d7530
52562ed13724910c  5bfec89d747c968d  60f2f8350ad533e7  6db986d77508977c
6fed893722f4c7e4  779e7a26dc65ba27  7b145777bdbc6b77  7b4a26532a4cb4a3
86c0a6d9f54335a5  890a0c84de7ed5bd  90fb50b969f94b92  a1caac817f929a8a
ac8e43083c844e5d  b8937a5e9691933a  d1602963a0a355d5  e197ebc9c478a0ed
e3c8d2655b006c2f  e77246511358f3e0  f27f674724757a37  f75841731dd61a90
f89814a2b7efdf87  fa576858278b9366  fc60ca1e8001a5e7  fc6705eb1f671920

Independent validation

  • Exact compute keys c47855735df8f7db and c2e8f32209404666 were rebuilt before launch from shipped inputs and an empty Vulkan cache. The second validates the mixed storage-image candidate path.
  • Native graphics keys 779e7a26dc65ba27 and d1602963a0a355d5 were captured with their table shader stages. Both were restored before guest entry on a subsequent run, and Vulkan accepted both without compilation.

Activity

  1. simnJS commented on Nov 26, 2026

    @simnJS
    OwnerAuthor

    Additional observed variant keys

    The Linux run at 638fb7979ee completed its startup preparation gate before guest entry. On an NVIDIA GeForce RTX 4080 SUPER with driver 595.99.02, the post-entry audit logged 83 create / compile_required events and zero unverified driver probes. The window ended when the GPU watchdog stopped the session.

    The entries below were absent from the registry snapshot. Counts are by kind, so a graphics pipeline and a graphics library can share a printed key. These are observed runtime keys.

    Compute pipelines (40)
    00594e200623a1a9  0580a2e88b1ce3f1  0c60d4de0fd11cdd  0d634e51a2da28f1
    1a4559a9743ec10f  241de7ec6ad9e909  2581ced75c69cfbe  33cf6e564c0c5f95
    3438b1bfcb6c461f  37261b73378ade04  40a5984c18419025  440ae9b864fd8467
    4f471a4719926513  541b986478c1cb72  6d8e47f2aec507e2  6ff4b0ccb28787f3
    74fa456e87884f9c  7773beaf7ddaaf59  8072658dc69dabac  8b0b8062d5a6a02d
    8b8e7745870ec5ff  8dbba99e8c23b899  8fe297cd601fce3e  903fe9b38695e1de
    9b927ca705a384a2  9c34a2db88058c90  9f9d3e81511e27c6  a3a691a2326c2bbf
    a4400d5ffd7211af  aca2284af18cc953  bc16bb6ae89de07c  c34f237261d49c00
    c700cfd818430482  c8c0501ea2dd2ffc  d0df627417e20994  d8804d57de0e07d5
    d96d93cd66011110  e19ef9514145e9d9  e663cdf93c7fc704  e6696d0d40a7b40b
    
    Graphics pipelines (18)
    01c583c5a73932d8  0da71abe1981e2d3  15750a5fe95725ae  432a23e05202f273
    5699792be8b06779  6684255b6fcb6062  6a35e13ab821abaa  72536ae7f8c60ac1
    7979c8b786e0ba00  7fcad5c600ecc52c  8873a1577adcb913  9053dddbd50a9d0d
    96723dde5e8d8a02  9dc3d73ff35abd47  a8a533df46ea7b41  aefa29be124870db
    b3aa56f4cdd0a623  e10c67c38c8e40ff
    
    Graphics pipeline libraries (18)
    01c583c5a73932d8  152647412ce45fb8  15750a5fe95725ae  432a23e05202f273
    5699792be8b06779  6684255b6fcb6062  6a35e13ab821abaa  72536ae7f8c60ac1
    7979c8b786e0ba00  7fcad5c600ecc52c  8873a1577adcb913  9053dddbd50a9d0d
    96723dde5e8d8a02  9dc3d73ff35abd47  a8a533df46ea7b41  aefa29be124870db
    b3aa56f4cdd0a623  e10c67c38c8e40ff
    

    Replay follow-up

    • The merged-seed replay observed one further compute key, 35ffbf0532e1da28, at a post-entry create requiring compilation. The corresponding shader module was captured for the next seed.
    • Independent offline validation created compute key 0f7342058c984557 from a shipped 3D pass and its native descriptor constructors. A CPU prediction made before the cold Vulkan run matched the audit key. The pass was absent from this gameplay capture.
    • The observed graphics key 6684255b6fcb6062 was independently recreated in a cold Vulkan run from a trace-guided sampler-table capacity adjustment and the corresponding shift in the following image table.
    • A second native recipe specified a direct 8×8×1 workgroup and two RGBA16F 2D-array views, sampled then storage. CPU serialization predicted a85346d4bc7dd2b4. The cold standalone Vulkan audit reproduced that key and created the pipeline.
    • A third native recipe used a direct dispatch with a 32×32×1 workgroup and an RGBA16 UNorm 3D storage view. Its cold standalone Vulkan replay created key 710562dd2afb551e, one of the CPU predictions frozen before replay.

    Independent follow-up

    • Three more recipes selected using shipped code and descriptor constructors matched their Vulkan keys, b588d83506693ad0, 6037e1a290217a8e, and a7522f19b3a5069b.
    • The native analysis also selected 5cd13e33d273641c before consulting the archived audit containing its after-entry compile. A standalone run with both caches empty created the same pipeline. This key is already in the registry.

    A further warm replay on the same executable observed these additional runtime keys in its first 100 seconds after guest entry.

    Compute pipeline keys (5)

    13ed2642bc31d7b3  7acd178a0afa8578  bac6aa9f814482de  e0fc9f29da3e494b
    feb0a1354bfeeabc
    

    Graphics pipeline keys (4)

    2216b1ddc931abd7  4bb39dcc5ad072c9  c004f144c6e6fc42  c4a9a2b75fe98734
    

    Graphics library keys (4)

    2216b1ddc931abd7  4bb39dcc5ad072c9  c004f144c6e6fc42  c4a9a2b75fe98734
    
  2. github-actions commented on Nov 26, 2026

    @github-actions

    Thanks for the audit. The 83 post-entry creations are a useful baseline for the window before the watchdog stopped the run. For a precook contribution, pick one miss and report which input distinguished it from the prepared variant, then check whether that input can be recovered before guest entry. Compare the exact key and pipeline kind against the runtime witness, and keep raw captures local.

  3. github-actions commented on Nov 26, 2026

    @github-actions

    The offline compute result is a useful lead: the predicted key matched the cold Vulkan audit, but the pass wasn't exercised in the gameplay capture, so it isn't a runtime registry entry yet. The graphics replay confirms the key can be recreated, but not that the sampler-table layout can be inferred before launch. Is there a pre-launch input that supplies the sampler capacity and lets you derive the following image-table offset without the trace?

  4. github-actions commented on Nov 26, 2026

    @github-actions

    The merged-seed replay makes 35ffbf0532e1da28 eligible for the runtime registry: it was observed at a post-entry creation that required compilation. The standalone CPU/Vulkan match for a85346d4bc7dd2b4 validates the recipe’s key prediction, but does not yet establish a runtime miss. In the next matched-cache replay, does the new seed resolve 35ffbf0532e1da28 before guest entry without a post-entry compile-required creation for that key?

  5. ShootanoJumper commented on Nov 26, 2026

    @ShootanoJumper
    Contributor

    Measurements from a 16 GB host, no PR yet. Brainrot 3f41812126, Windows 11 23H2, Ryzen 7 5700X (8 cores), RTX 4060 8 GB on NVIDIA 616.56, 16 GB RAM, one large open-world title, default settings plus KYTY_SHADER_VARIANT_LOG=1, no input during the runs.

    KYTY_PIPELINE_COMPILE_AUDIT and tools/kyty_precook_audit.py are not on Brainrot or AnyKyty yet, so the counts below come from the [kyty-startup] runtime_pipeline lines and [kyty-variant] build records.

    Startup preparation stops at the 900 s cap on this host, held to one job by the memory pause.

    first start (store rewritten: stamp changed) second start (warm)
    restored 0 modules 2253 modules, 1237 pipeline handles
    startup jobs 2299 2983
    available RAM when paused 5.3 GiB 3.2 GiB
    manifest_release timed out elapsed_s=900.10 jobs_finished=1181 timed out elapsed_s=900.19 jobs_finished=2981
    single-job resumes logged 1060 135

    ManifestMemoryPause pauses below min(12 GiB, total / 2) (8 GiB here) and resumes above min(14 GiB, total / 12 * 7) (9.3 GiB). With the desktop and the title's own reservations, available memory on this host stays between 1 and 5 GiB from launch on, so it never resumes: the whole window runs on the one admitted worker. On the warm start, the last 82 modules took from 46 s to the cap. I think a threshold relative to the memory available at launch, or a floor of more than one worker while the title has not entered yet, would help 16 GB hosts, but I have not tried either.

    Runtime work after guest entry, warm start, 15 min after entry:

    runtime_pipeline compute  route=sync     99   (57 guest shaders)
    runtime_pipeline graphics route=queued  365   (185 guest shaders, 365 variants)
    runtime_pipeline graphics route=skipped 374
    runtime_pipeline graphics route=linked    2
    runtime_pipeline graphics route=whole     1
    [kyty-variant] build                    465
    [kyty-gpl] stalls 100 total 761.754 s max 65.041 s >=0.1s 89 >=0.5s 88; driver pipelines 1507
    

    The first start had 23 sync compute, 5 queued and 41 skipped graphics after entry, before it ended 7 min after entry with an access violation in title code (a write to address 0). The warm start did not repeat it in 15 min after entry, and I have no evidence that it comes from precook.

    Peak process private bytes: 20.0 GiB on the first start, 17.8 GiB on the warm start (16 GB host, heavy paging on both).

    Cosmetic: on the warm start the progress line reads 1591/1673 modules, 488/2 pipelines, so the pipeline total looks like it counts only the jobs left while the finished count includes restored ones.

    I have not yet traced which input differs for any of the missed variants; that is next.

    🤖 Generated with Claude Code

  6. github-actions commented on Nov 26, 2026

    @github-actions

    The 16 GB measurements are useful for a separate startup memory-policy follow-up. If you test a change there, compare matched warm-cache runs and report gate completion time and paging, so a faster startup doesn’t hide increased memory pressure.

    For precook, the runtime counters show work after guest entry, but they don’t establish which driver creations required compilation. Can you pick one recurring variant and report which input differs from the prepared variant? A sanitized description of the differing input is enough; keep raw logs and captures local.

  7. TideOPL commented on Nov 26, 2026

    @TideOPL

    Runtime variants on an open-world title: bindless image table roots flip from heap to table mode

    Setup. Windows 11, NVIDIA GeForce RTX 5070, driver 610.88. Brainrot at 3f41812. Run with KYTY_NATIVE_RT=0, because native ray tracing makes vkCreateDevice fail on this driver (a separate issue). Each run starts from an empty _PipelineCache and goes from boot through the opening shader-building phase with no input. Each run ends on the same unrelated guest crash (an unmapped read), 12–19 minutes after guest entry. All variants below are built after guest entry.

    Method. I used KYTY_SHADER_VARIANT_LOG=1, plus a local-only patch that adds each image's ResourceSpecialization::Image fields to the build record. The modules of each (stage, shader) were grouped and compared field by field.

    What makes the extra variants

    • 1,162 modules were built for 970 shaders. 172 shaders have more than one module, giving 192 extra modules.
    • 141 of the 192 extra modules (73%) come from one cause. A table_array image root is first built in heap mode by MaterializeImageTableHeap. A later draw or dispatch of the same shader builds it in table mode with MaterializeImageTable, so the specialization has a different number of images and adds a table entry (table_capacity 32768).
      • It happens in 124 shaders: 98 PS, 25 CS, 1 VS.
      • The order was always heap first, then table (124 of 124).
      • Every heap build had seen exactly one heap kind. Table mode appears once the table's live descriptors span more than one kind (view.kinds.size() != 1u in MaterializeImageTableHeap). In other words, the input that differs is the mix of descriptor kinds in the bindless table at the time of the draw. Streaming fills the table over time, so nothing available before launch predicts this order.
    • Remaining image-only differences: numeric class (10 shaders), binding count without a mode flip (8), mip count (1). Buffers and static state account for the rest.

    Compute: the generic variant path never serves these

    KYTY_GENERIC_COMPUTE_VARIANT is on, but the run logged no serve, widen or specialize events. All 22 affected compute shaders have an image table entry. AlignResources returns false when snapshot.image_tables is not empty, and ImageShapes refuses table/table_capacity entries. So each new shape of these shaders goes route=sync (2–3 synchronous creations per shader).

    Experiment: table mode from the first draw

    I added a local switch that skips MaterializeImageTableHeap, so table_array roots always use table mode. All three runs are compared over the same window, the first 705 s after guest entry. The first two are on the default code.

    default, run 1 default, run 2 table mode only
    extra modules (beyond one per shader) 149 of 951 (19%) 181 of 1141 (19%) 73 of 1057 (7%)
    draws skipped by Kyty for a missing pipeline 261 202 17
    longest pipeline stall 23.4 s 16.9 s 10.9 s
    stalls of 0.5 s or more 92 87 74
    compute route=sync 208 268 310 (more compute shaders reached: 984 vs 960 shaders in total)

    Run-to-run noise is large: the two default runs reached different numbers of shaders and frames. The extra-modules ratio and the skipped draws are the stable signals.

    Not measured: the steady-state GPU cost of table mode compared with heap mode. Every run stops before gameplay. Rendering output was not compared either.

    Question for the direction

    Which approach would you take?

    1. Use table mode for table_array roots from the first draw (by default, or when the root's profile admits more than one kind).
    2. Let a table heap hold several kinds, so that a new kind adds an arm instead of switching modes. This still adds a variant per new kind unless a module can be served wider.
    3. Let AlignResources and WidenSpecialization handle image tables, so the generic compute variant can serve these dispatches. This covers compute only.

    I can turn whichever you prefer into a PR with a synthetic test (a table that gains a second descriptor kind after the first draw: one variant expected, and output checked). The control case would be the existing behaviour, which logs the second build.

    AI-assisted: yes.

  8. github-actions commented on Nov 26, 2026

    @github-actions

    I’d test table mode from the first draw as the next experiment, not make it the default yet. It removes the observed heap-to-table transition without first expanding the generic compute compatibility rules. The lower extra-module ratio and skipped-draw count are promising, but the runs reached different amounts of work, and the variant logs don’t establish how many driver creations required compilation.

    Can you replay one matched segment that exercises the transition, starting both runs from equivalent caches? Check rendering or dispatch output and GPU time for that segment, and, on a build with the compile audit, check whether the post-entry create / compile_required events for the affected keys actually go away. If table mode has a meaningful GPU cost, that’s a reason to investigate a narrower rule that keeps heap mode where it can be proven sufficient.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions