Repository navigation
Description
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
- Use a known build with the compile audit. Set
KYTY_PIPELINE_COMPILE_AUDIT=1andKYTY_SHADER_VARIANT_LOG=1in the environment used to launch the title. Keep the route, settings, and capture window the same across runs. - Save the baseline stderr locally. Identify the exact module or pipeline key and the first
createevent markedcompile_requiredafter guest entry. A lookup reportingcompile_requiredis a failed lookup. A background creation still counts as runtime work when it happens after guest entry. - 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.
- 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.logFor 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
c47855735df8f7dbandc2e8f32209404666were rebuilt before launch from shipped inputs and an empty Vulkan cache. The second validates the mixed storage-image candidate path. - Native graphics keys
779e7a26dc65ba27andd1602963a0a355d5were captured with their table shader stages. Both were restored before guest entry on a subsequent run, and Vulkan accepted both without compilation.
Activity
simnJS commentedon Nov 26, 2026
Additional observed variant keys
The Linux run at
638fb7979eecompleted its startup preparation gate before guest entry. On an NVIDIA GeForce RTX 4080 SUPER with driver 595.99.02, the post-entry audit logged 83create / compile_requiredevents 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)
Graphics pipelines (18)
Graphics pipeline libraries (18)
Replay follow-up
35ffbf0532e1da28, at a post-entry create requiring compilation. The corresponding shader module was captured for the next seed.0f7342058c984557from 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.6684255b6fcb6062was independently recreated in a cold Vulkan run from a trace-guided sampler-table capacity adjustment and the corresponding shift in the following image table.a85346d4bc7dd2b4. The cold standalone Vulkan audit reproduced that key and created the pipeline.710562dd2afb551e, one of the CPU predictions frozen before replay.Independent follow-up
b588d83506693ad0,6037e1a290217a8e, anda7522f19b3a5069b.5cd13e33d273641cbefore 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)
Graphics pipeline keys (4)
Graphics library keys (4)
github-actions commentedon Nov 26, 2026
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.
github-actions commentedon Nov 26, 2026
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?
github-actions commentedon Nov 26, 2026
The merged-seed replay makes
35ffbf0532e1da28eligible for the runtime registry: it was observed at a post-entry creation that required compilation. The standalone CPU/Vulkan match fora85346d4bc7dd2b4validates the recipe’s key prediction, but does not yet establish a runtime miss. In the next matched-cache replay, does the new seed resolve35ffbf0532e1da28before guest entry without a post-entry compile-required creation for that key?ShootanoJumper commentedon Nov 26, 2026
Measurements from a 16 GB host, no PR yet.
Brainrot3f41812126, 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 plusKYTY_SHADER_VARIANT_LOG=1, no input during the runs.KYTY_PIPELINE_COMPILE_AUDITandtools/kyty_precook_audit.pyare not onBrainrotorAnyKytyyet, so the counts below come from the[kyty-startup] runtime_pipelinelines and[kyty-variant] buildrecords.Startup preparation stops at the 900 s cap on this host, held to one job by the memory pause.
manifest_releasetimed out elapsed_s=900.10 jobs_finished=1181timed out elapsed_s=900.19 jobs_finished=2981ManifestMemoryPausepauses belowmin(12 GiB, total / 2)(8 GiB here) and resumes abovemin(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:
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
github-actions commentedon Nov 26, 2026
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.
TideOPL commentedon Nov 26, 2026
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.
Brainrotat3f41812. Run withKYTY_NATIVE_RT=0, because native ray tracing makesvkCreateDevicefail on this driver (a separate issue). Each run starts from an empty_PipelineCacheand 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'sResourceSpecialization::Imagefields to thebuildrecord. The modules of each(stage, shader)were grouped and compared field by field.What makes the extra variants
table_arrayimage root is first built in heap mode byMaterializeImageTableHeap. A later draw or dispatch of the same shader builds it in table mode withMaterializeImageTable, so the specialization has a different number of images and adds a table entry (table_capacity32768).view.kinds.size() != 1uinMaterializeImageTableHeap). 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.Compute: the generic variant path never serves these
KYTY_GENERIC_COMPUTE_VARIANTis on, but the run logged noserve,widenorspecializeevents. All 22 affected compute shaders have an image table entry.AlignResourcesreturns false whensnapshot.image_tablesis not empty, andImageShapesrefusestable/table_capacityentries. So each new shape of these shaders goesroute=sync(2–3 synchronous creations per shader).Experiment: table mode from the first draw
I added a local switch that skips
MaterializeImageTableHeap, sotable_arrayroots 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.route=syncRun-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?
table_arrayroots from the first draw (by default, or when the root's profile admits more than one kind).AlignResourcesandWidenSpecializationhandle 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.
github-actions commentedon Nov 26, 2026
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_requiredevents 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.