Skip to content

Improve renderer failure handling - #645

Open
charlesstaats wants to merge 2 commits into
masterfrom
render-child-status
Open

charlesstaats wants to merge 2 commits into
masterfrom
render-child-status

Conversation

@charlesstaats

Copy link
Copy Markdown
Contributor

Title: Report a failed 3D render child instead of exiting 0, and add a 3D rendering test

The test is skipped when there is nothing to render with: if asy was built without Vulkan, or the Vulkan loader finds no devices. It then exits 77. ctest reports that as "Skipped" (SKIP_RETURN_CODE 77), and make check prints SKIPPED (reason) and carries on. CI runners without a Vulkan device skip it.

When asy renders a 3D scene in a forked child process, the parent waited for the child but ignored its exit status. If the renderer crashed or exited with an error, asy still exited 0 and simply wrote no image. Two examples: a Boehm GC abort ("Collecting from unknown thread") when gccpp is linked and lavapipe is used, or an uncaught vk::IncompatibleDriverError when no Vulkan driver is present.

  • picture.cc: if the render child is killed by a signal or exits non-zero, report an error. asy then exits 1 with a message such as runtime: 3D renderer terminated by signal 6 (Aborted). Interactive viewing, which doesn't wait for the child, is unchanged.
  • tests/test_render3d.py: renders a small 3D scene to PNG. The test fails if asy exits non-zero or doesn't write a valid PNG. It runs under both ctest (bundled.asy.render3d) and make check.

On a machine with a Vulkan device, the new test fails with the CMake build on master until the fix that stops linking gccpp outside Windows is merged.

Testing (Debian trixie, lavapipe):

  • CMake (linux/release, master, which links gccpp): render3d fails with the error above. With GC_DONT_GC=1, ctest passes 8/8.
  • Autotools: make check passes, including render3d.
  • No Vulkan driver (VK_ICD_FILENAMES pointed at a nonexistent file): the test is skipped under both ctest and make.
  • Python lint: black, isort and pylint pass, using the CI steps from misc-sanity-checks.yml.
  • macOS and Windows: not tested.

🤖 Generated with Claude Code

charlesstaats and others added 2 commits September 26, 2026 14:02
When rendering in a forked child, the parent waited for it but ignored
its status, so a crash or error exit in the renderer (e.g. a GC abort
or a missing Vulkan driver) left asy exiting 0 without writing an image.
Now a child killed by a signal or exiting non-zero is reported as an
error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_render3d.py renders a small scene to PNG and fails if asy
exits non-zero or writes no PNG. It exits 77 (skipped) when asy was
built without Vulkan or the Vulkan loader reports no devices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant