From a9335928c7e978fb0b7d82ec5d1240789d9cb5a8 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Mon, 27 Jul 2026 01:48:44 -0400 Subject: [PATCH] docs(twitter): add 1858715434436227544 corpus (NOTimothyLottes NV front-buffer bringup + 'cart file' origin) 8-post thread on NV-specific 1-deep swap with IMMEDIATE presentation, after previous AMD-tuned impl stopped working. One descriptor set always bound (resources static after init). Dropped VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT ('god awful naming length') to avoid NV indirection perf hit. 2700 lines of engine, embedded headers, one-file compile. 0.25 sec hot-load on NV dGPU: 4 MiB 'cart' file from pagecache, 512 MiB GPU buffer, all PSOs, image alloc, command buffer copy+clear. Load-time parallelism: {instance create, cart map, TLB warming by walking pages, window bringup} = 0.08 sec. After VK device, signal background SPIR-V load while building descriptor set layout, then PSO compile parallel. Earliest documented use of 'cart file' term - 9 months before the Aug 2025 public announcement. --- docs/twitter/1858715434436227544/thread.md | 47 ++++++ .../1858715434436227544/thread_data.json | 134 ++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 docs/twitter/1858715434436227544/thread.md create mode 100644 docs/twitter/1858715434436227544/thread_data.json diff --git a/docs/twitter/1858715434436227544/thread.md b/docs/twitter/1858715434436227544/thread.md new file mode 100644 index 00000000..c64d13fe --- /dev/null +++ b/docs/twitter/1858715434436227544/thread.md @@ -0,0 +1,47 @@ +--- +title: "After VK device is open, I signal a background thread to load the SPIR-V module," +author: "NOTimothyLottes" +handle: "@NOTimothyLottes" +post_url: "https://x.com/NOTimothyLottes/status/1858715434436227544" +post_id: "1858715434436227544" +timestamp: "2024-11-19 03:34:27" +post_count: 8 +reply_count: 0 +repost_count: 0 +like_count: 2 +view_count: 424 +--- + +# @NOTimothyLottes — After VK device is open, I signal a background thread to load the SPIR-V module, + +## Post 1 (2024-11-19 03:10:28) + +Working towards a new bring up of front-buffering on NV via VK. My last implementation had been tuned on AMD and didn't work on NV any more. NV does seem to accept a 1-deep swap with IMMEDIATE presentation at least on latest drivers, so that is a good start. + +## Post 2 (2024-11-19 03:13:21) — reply to Post 1 + +Since my image resources are static after init time, only swap images change when the driver kills the swap chain (which once upon a time seemed to happen on ALT+TAB maybe). So it's one descriptor set always bound. + +## Post 3 (2024-11-19 03:15:43) — reply to Post 2 + +Stopped using VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT (god awful naming length people), because I think it could be a perf hit on NV due to extra indirection. NV driver is free to bake down the single set now before the command buffer is sent over. + +## Post 4 (2024-11-19 03:21:26) — reply to Post 3 + +At this stage, to the point of having everything loaded and swap chain created, it's 2700 lines of engine code. That includes embedding headers (no external includes), so it's a one file compile. People claim rolling your own engine is hard? Not really if you keep it focused. + +## Post 5 (2024-11-19 03:26:46) — reply to Post 4 + +So far it's a 0.25 sec hot load time on this NV dGPU laptop. Includes mapping a 4 MiB 'cart' file from pagecache, doing a 512 MiB buffer for GPU usage, hits on all PSOs, allocating some images, and kicking the command buffer that copies in the cart, and clears everything. + +## Post 6 (2024-11-19 03:29:11) — reply to Post 5 + +Everything at load-time is multi-threaded to try to minimize start to in-game time. This is in sharp contrast to runtime where the only multi-threading being used is to separate things that are blocking. + +## Post 7 (2024-11-19 03:32:22) — reply to Post 6 + +I get some utility on parallelizing {vulkan instance creation, mapping the cart file, warming the TLBs by walking all the pages, bringing up the window} it's about 0.08 seconds in at that point + +## Post 8 (2024-11-19 03:34:27) — reply to Post 7 + +After VK device is open, I signal a background thread to load the SPIR-V module, while building the descriptor set layout, which then unblocks PSO compile on background threads. And the rest of the VK setup runs in parallel. Working towards swap creation. diff --git a/docs/twitter/1858715434436227544/thread_data.json b/docs/twitter/1858715434436227544/thread_data.json new file mode 100644 index 00000000..78bb3c8e --- /dev/null +++ b/docs/twitter/1858715434436227544/thread_data.json @@ -0,0 +1,134 @@ +{ + "root_post_id": "1858715434436227544", + "posts": [ + { + "post_id": "1858709400791261630", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "Working towards a new bring up of front-buffering on NV via VK. My last implementation had been tuned on AMD and didn't work on NV any more. NV does seem to accept a 1-deep swap with IMMEDIATE presentation at least on latest drivers, so that is a good start.", + "timestamp": "2024-11-19 03:10:28", + "media_urls": [], + "reply_to_id": null, + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 2, + "view_count": 686 + } + }, + { + "post_id": "1858710122727391666", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "Since my image resources are static after init time, only swap images change when the driver kills the swap chain (which once upon a time seemed to happen on ALT+TAB maybe). So it's one descriptor set always bound.", + "timestamp": "2024-11-19 03:13:21", + "media_urls": [], + "reply_to_id": "1858709400791261630", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 0, + "view_count": 86 + } + }, + { + "post_id": "1858710719018979651", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "Stopped using VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT (god awful naming length people), because I think it could be a perf hit on NV due to extra indirection. NV driver is free to bake down the single set now before the command buffer is sent over.", + "timestamp": "2024-11-19 03:15:43", + "media_urls": [], + "reply_to_id": "1858710122727391666", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 0, + "view_count": 105 + } + }, + { + "post_id": "1858712158004994552", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "At this stage, to the point of having everything loaded and swap chain created, it's 2700 lines of engine code. That includes embedding headers (no external includes), so it's a one file compile. People claim rolling your own engine is hard? Not really if you keep it focused.", + "timestamp": "2024-11-19 03:21:26", + "media_urls": [], + "reply_to_id": "1858710719018979651", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 2, + "view_count": 101 + } + }, + { + "post_id": "1858713499716694264", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "So far it's a 0.25 sec hot load time on this NV dGPU laptop. Includes mapping a 4 MiB 'cart' file from pagecache, doing a 512 MiB buffer for GPU usage, hits on all PSOs, allocating some images, and kicking the command buffer that copies in the cart, and clears everything.", + "timestamp": "2024-11-19 03:26:46", + "media_urls": [], + "reply_to_id": "1858712158004994552", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 0, + "view_count": 98 + } + }, + { + "post_id": "1858714108415119495", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "Everything at load-time is multi-threaded to try to minimize start to in-game time. This is in sharp contrast to runtime where the only multi-threading being used is to separate things that are blocking.", + "timestamp": "2024-11-19 03:29:11", + "media_urls": [], + "reply_to_id": "1858713499716694264", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 3, + "view_count": 105 + } + }, + { + "post_id": "1858714908516381114", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "I get some utility on parallelizing {vulkan instance creation, mapping the cart file, warming the TLBs by walking all the pages, bringing up the window} it's about 0.08 seconds in at that point", + "timestamp": "2024-11-19 03:32:22", + "media_urls": [], + "reply_to_id": "1858714108415119495", + "quote_of_id": null, + "metrics": { + "reply_count": 1, + "repost_count": 0, + "like_count": 1, + "view_count": 443 + } + }, + { + "post_id": "1858715434436227544", + "author": "NOTimothyLottes", + "handle": "NOTimothyLottes", + "text": "After VK device is open, I signal a background thread to load the SPIR-V module, while building the descriptor set layout, which then unblocks PSO compile on background threads. And the rest of the VK setup runs in parallel. Working towards swap creation.", + "timestamp": "2024-11-19 03:34:27", + "media_urls": [], + "reply_to_id": "1858714908516381114", + "quote_of_id": null, + "metrics": { + "reply_count": 0, + "repost_count": 0, + "like_count": 2, + "view_count": 424 + } + } + ], + "source_url": "https://x.com/NOTimothyLottes/status/1858715434436227544" +} \ No newline at end of file