fix(tests): stop a failed recorder test without unwinding through objects its open batch still records #10684
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10684"
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 fma-rc on 2026-10-24T17:41:24Z.
What
When a check fails in
agc_driver_recorder_tests, the message never reaches the log on lavapipe: the test segfaults. On RADV it prints[gpu] recorder teardown: AGC graphics: vkQueueSubmit recorder: Vulkan result -4first.main()wrapped every test intry { ... } catch (const std::exception&). A failedRequireunwinds the test function, which destroys its locals (TextureDetiler,SampleProgram, textures) while the recorder's open batch still records their pipelines and descriptor sets: texture uploads stay in the open batch by design. Thenmain()'sRecorderis destroyed,~RecorderrunsSync(), and submits that batch. The driver's own teardown order is right (the device resets its recorder before its detiler), so this is only the test binary.This drops the outer catch and installs a terminate handler through libc's
set_terminateexport, astests/Graphics.cppdoes. An uncaught exception reaches it before any unwinding, so nothing is destroyed or submitted. The handler flushes stdout, prints the exception's message (or a line saying there was none, or that it was not astd::exception), and ends throughLibcTerminate_nid_no_patch(1), the same exit the Windows test wrapper uses. Exit code 1 and the message are unchanged; skip paths still return 77. The rest ofmain()keeps its indentation inside a plain block, so the change stays off the lines other open PRs edit there.I found it with a texture upload test whose red run crashed on lavapipe instead of failing with its message. Moving the 40 test-local detilers into the shared test device would not cover it: 5 of those tests build their detiler from a context they changed, and other locals than the detiler can be in the open batch.
Tested
New test
agc_recorder_failed_check: one texture upload into the open batch, then a failing check. It passes when the message is printed andrecorder teardownis not.recorder teardown ... Vulkan result -4ctest -R '^agc_recorder'passes on RADV and lavapipe with the fix. Full ctest on RADV shows no failure that the merge base lacks (agc_driver_tessellationfails on both). Windows (MinGW GCC): build, ctest, tools tests and conventions show no failure that the merge base lacks; the VM has no GPU, soagc_recorder_failed_checkskips there. Arch Linux.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T19:22:19Z.
Review: APPROVED
Reviewed
agc_recorder_failed_checkat head18d170c1636d2c9d923fe3adce8da3564f3bcc1f. The termination-handler change is narrowly scoped and matches the test's lifetime hazard: the failure path exits without unwinding objects referenced by the recorder's open batch, and the regression check verifies the failure message while ensuring recorder teardown does not run. The targetagc_driver_recorder_testsbuilt successfully locally. I also ranctest --test-dir /tmp/anyps5-10694-build -R '^agc_recorder_failed_check$' --output-on-failure; it aborted during host CPU feature validation (this Xeon lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA), before reaching the regression assertion. Hosted product tests are skipped by repository policy; the PR reports successful runs on RADV/lavapipe/NVIDIA and Windows. Intake, conventions and labels checks are green, and the PR is mergeable.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T20:24:09Z.
Review: APPROVED
Reviewed the functional diff at
18d170c163(the large remainder of Recorder.cpp is indentation-only). The terminate handler prints the active exception and exits without unwinding test-local objects referenced by an open recorder batch;agc_recorder_failed_checkexercises a texture upload followed by a failed Require and rejects the old teardown failure. The author reports the regression passing on RADV and lavapipe, with the prior code failing on both, plus no newly introduced full-suite Windows failures. Hosted eligibility, conventions, labels and report pass; product jobs were skipped by repository policy.