AMD Windows: since #4152, 47 AGC tests crash in amdvlk64.dll because library shader modules are destroyed before the background link #4435
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-12T11:15:14Z.
On AMD's Windows driver, 47 of the 431 AGC tests fail on
mainsince #4152. Run one at a time on a Radeon 860M (RDNA 3.5, driver 32.0.13058.8001,driverInfo24.30.58.08), Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, with the shader cache emptied first:ctest -R '^agc_' -j 1maine7c70a2dfmaine7c70a2dfwithAPS5_NO_PIPELINE_LTO=19bc362351, the merge before #4152, only the 47 that fail onmainA first-parent bisect over
f60923bf5..origin/main, two runs per step, ends at the merge of #4152 (2979ae37a): its parent passes 2/2, it fails 2/2. The crashes are inside the driver, for example:This is the fault that #3173 fixed for #2755. AMD's driver still reads a library part's shader modules during the background link-time-optimized link that
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXTrequests, afterPipelinehas destroyed them. Destroying them is legal Vulkan, so this works around a driver bug. #3173 kept those modules in the device's library store untilClearPipelineLibraries. #4152 reworkedLinkPipelineFromLibrariesfor parts prebuilt at registration and dropped that store (DeviceLibraries::modulesand itsmodulesparameter).Pipeline.cppagain destroys_modulesright after the parts are created, also on the new prebuild path.#4363 changes the same function for the depth format but doesn't restore the modules: with it merged the two tests I tried still fail 3/3.
A fix that puts the module store back on the current code, including the prebuild path, follows as a PR: with it all 431 pass.
The 47 tests
agc_driver_alpha_to_coverageagc_driver_conservative_rasterizationagc_driver_depth_bias_per_faceagc_driver_depth_fast_clearagc_driver_depth_fast_clear_submitagc_driver_draw_cache_reuseagc_driver_draw_offset_indicesagc_driver_dual_source_blendagc_driver_exec_host_lanesagc_driver_image_plane_address_on_line_implicit_lodagc_driver_interpolation_f16agc_driver_meshagc_driver_msaa_enable_single_sampleagc_driver_ngg_vertex_wave_infoagc_driver_packed_unorm_color_targetagc_driver_pipeline_optimized_readback_color32agc_driver_pipeline_optimized_readback_color64agc_driver_pipeline_optimized_readback_d16agc_driver_pipeline_optimized_readback_d32agc_driver_pixel_barycentric_emulationagc_driver_pixel_fixed_point_positionagc_driver_pixel_helper_lanesagc_driver_pixel_interlockagc_driver_pixel_ldsagc_driver_pixel_lds_lane_slotsagc_driver_pixel_uint16_exportagc_driver_pixel_valid_maskagc_driver_pixel_wave_reductionagc_driver_prepared_exportsagc_driver_prepared_shadersagc_driver_prepared_shaders_debugagc_driver_prepared_shaders_indirectagc_driver_prepared_shaders_uncachedagc_driver_provoking_vertexagc_driver_recorded_kept_bytesagc_driver_relative_stage_inputsagc_driver_scalar_swappc_fetchagc_driver_srgb8_color_targetagc_driver_stencil_ref_exportagc_driver_swap_alt_blendagc_driver_tessellationagc_driver_uint8x4_color_targetagc_driver_vertex_fetchagc_driver_zero_position_vertexagc_driver_zero_stride_vertex_fetchagc_pipeline_cacheagc_pipeline_librarycc @adriadam10 (#4152)
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-12T15:24:50Z.
Additional device/current-main reproduction: on Windows 11 Enterprise 26200, AMD Radeon(TM) Graphics (
1002:13c0, AMD driver32.0.21036.18), WinLibs GCC 15.2.0 r7 / Release, unchanged maind592d54e11ecce022abd62635a58bf2d048f3a2calso crashes inamdvlk64.dllinagc_driver_draw_cache_reuse.Commands (one test at a time,
ANYPS5_GPU="AMD Radeon(TM) Graphics",ANYPS5_NO_SHADER_CACHE=1):ctest --test-dir <build> --output-on-failure --parallel 1 --repeat until-fail:20 -R '^agc_driver_draw_cache_reuse$'stopped on its first execution with0xc0000005, insideamdvlk64.dll.APS5_NO_PIPELINE_LTO=1: the same test passes five consecutive executions.This confirms another AMD Windows device/current-main reproduction and the LTO-off control. I have not tested unchanged #4445, bisected this device, or independently proved the shader-module-lifetime cause. No new issue or duplicate implementation is proposed.
Additional array/color1555 controls
The same AMD device also failed
agc_driver_array_layer_targetandagc_driver_color1555_targetduring #4318's current-main rebase validation. A subsequent control used stock main fixture sources and matching headers, with the native test executable from our centroid checkout and frozen unchanged-maind592d54eruntime DLLs (not another whole-main rebuild):amdvlk64.dllThe extended candidate array's normal-LTO failure is not claimed to be reproduced by the original R_X-only fixture. This adds the color1555 reproduction and diagnostic controls; it still does not validate #4445 or prove the module-lifetime cause independently. The full NVIDIA rebase suite passes (965 passed, seven skipped, zero failures /972). No diagnostic switch was added to #4318's implementation.
Current-main retest after the lifetime fix merged
On main
2a5eca11plus our unchanged centroid-only patch, with ordinary LTO andANYPS5_NO_SHADER_CACHE=1, ten relevant groups pass five times each on both this AMD device and RTX5080. In particular, draw-cache reuse, array-target and color1555 no longer crash in the selected AMD retest. Full NVIDIA suite:967 passed/0 failed/7 skipped of974. The base includes merged #4445 and other changes; this reports current-main behavior, not an isolated cause bisect or a test of unchanged #4445 head. The older failures/control results above remain scoped to their stated base.AI-assisted: yes (Codex).
Follow-up on main
2f4cc8983(2026-10-13)The earlier crash/recovery findings above remain scoped to their stated commits. This follow-up is not a reproduction of the original shader-module-lifetime cause and does not ask to reopen this resolved issue.
Our latest rebase validation exposed a harness error:
APS5_NO_GPLis presence-based, so setting it to0also disables GPL. Corrected runs leave it unset for GPL on and use1for off. Recorder-based helper tests independently select NVIDIA; they are not AMD coverage.On the same AMD device/driver, #4318 at
b6f1a4a69passes eleven selected groups five times in the corrected default/GPL-on campaign. Two groups fail:agc_driver_graphicsreports the previously recorded host-exclusion fixture signature; the extendedagc_driver_array_layer_targetreads0xdeadbeefinstead of0x3e800000after its draw. Stock main's original R_X-only array fixture is not evidence that the extended D_X fixture's failure is reproduced on main. Full NVIDIA suite: 989 passed, 0 failed, 7 skipped of 996. #4318 was subsequently merged; this AMD residual remains unresolved.An earlier frozen D_X runtime reproduced four off-path tiled-render mismatches. Stock production-source/header-matched main runtime controls passed those four cases five times on both devices. Recompiling the driver/compiler from unchanged tracked source clears matched color1555/packed-tail failures in crossed-executable controls. The old DLL and failed logs are retained; the exact artifact discrepancy is unconfirmed.
For #4451 at
3040cd741, the corrected campaign passes all ten selected groups on AMD with GPL off, but actual GPL on fails dithered alpha coverage, existing undithered alpha coverage and wave32 subgroup. NVIDIA passes both modes and its full suite passes 990/0/7 of 997. Stock main runtime controls of undithered coverage and wave32 pass with GPL on, fail with GPL off, and pass with GPL on plus the existing no-pipeline-LTO diagnostic. This different control pattern does not establish a shared cause. The fresh driver/compiler and full-target rebuild retains these same three GPL-on failures. Each also fails its first execution with the existing no-pipeline-LTO diagnostic; the fresh full NVIDIA suite passes 990/0/7 of 997. No production workaround was added.Current evidence and updates are maintained in #4318 and #4451. Any confirmed distinct defect will be checked for duplication before a separate issue is opened. AI-assisted: Codex.
Same-build and relocation follow-up: stock main production/headers and the original undithered/wave32 fixtures rebuilt in #4451's build directory reproduce the same AMD on/off pattern as that candidate. Moving byte-identical executables reverses the result even with the original libraries and the same current directory. This was not isolated by the earlier different-runtime control. The distinct reproduction, SHA-256 identities and limits are now consolidated in #4768; it does not claim recurrence of this issue's resolved lifetime crash. Candidate sources were restored exactly and rebuilt.