Fix nine runtime faults a tester's report named: a stack overrun on mesh draws, lost YMM halves on preemption, and seven more.

- The mesh stage's storage table starts 0x90 bytes before the end of the 2 KiB constant bank, and all sixteen slots
  were written: 0x6C bytes past a stack buffer on every mesh draw. It holds the nine slots that fit.
- The prebuilt runtime is compiled without AVX, so its preemption stub saved only XMM0-15 while the lifted code of
  an AVX2 processor keeps data in the upper YMM halves, which the stub's callees may clear. Both bodies are built
  now and the one for the processor is chosen at the start.
- After an FSR 3.1 frame generation error the window's swapchain was still AMD's object but went to the plain Vulkan
  calls. Swapchain calls follow whose swapchain it is, and a failure takes it down as a switch in the menu does.
- A movie is paced at its own 60 fps under a lower limit too: at 40 fps it ended 25 s behind its sound.
- A lost device left the wait for an upload spinning for good; it ends the run with the device's report.
- The compute pipeline key had four bytes of padding that were hashed and compared, so a prebuilt pipeline could be
  missed and built again.
- A thread's TLS pointer was published before the TLS was allocated, so the slot was always 0.
- A fatal exit puts RivaTuner Statistics Server's profile back, and an ini saved as UTF-16 is read.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 21:54:32 -05:00
parent ed3db71485
commit 00f06e669e
10 changed files with 290 additions and 200 deletions

View File

@@ -4267,7 +4267,7 @@ static struct {
VkPipeline vk_pipeline_compute(const GfxShader *cs, const VkPipeInfo **info) {
if (info) *info = NULL;
if (!cs || !ensure_init()) return VK_NULL_HANDLE;
struct { const GfxShader *cs; uint32_t compute; } k = {cs, 1};
struct { const GfxShader *cs; uint64_t compute; } k = {cs, 1}; // no padding: the key is hashed and compared as bytes
uint64_t h = key_hash(&k, sizeof k);
plat_mutex_lock(&P.lock);
Pipe *p = pipe_find(&k, sizeof k, h);
@@ -4487,7 +4487,7 @@ static void bg_main(void *arg) {
plat_mutex_unlock(&LB.stat);
if (!have) break;
const uint8_t *iid = idbuf;
struct { const GfxShader *cs; uint32_t compute; } k = {cs, 1};
struct { const GfxShader *cs; uint64_t compute; } k = {cs, 1}; // no padding: the key is hashed and compared as bytes
uint64_t h = key_hash(&k, sizeof k);
Bindings B = {0};
const char *why = NULL;
@@ -4567,7 +4567,7 @@ static void bg_start(void) {
}
static void lb_compute(const GfxShader *cs, const uint8_t iid[32]) {
struct { const GfxShader *cs; uint32_t compute; } k = {cs, 1};
struct { const GfxShader *cs; uint64_t compute; } k = {cs, 1}; // no padding: the key is hashed and compared as bytes
uint64_t h = key_hash(&k, sizeof k);
Bindings B = {0};
const char *why = NULL;