Skip to content

startup: a mesh request can miss the exit drain after #3664 (startup_indirect_mesh_cache_heap_wide_warp flaked) #3822

Backlog

Description

@lukaslw-lab

Since #3664, mesh pipeline requests are written by RequestPublisher on a background thread. In one CI run the request file was never written, and the fixture failed:

x2w-render stream pipeline -> placeholder: slot86 mesh request 2c820f987671b4fc pending
...
  File "tests\startup_indirect_mesh_cache_check.py", line 205, in run_heap
    marker, = work.glob('req_*.m86')
ValueError: not enough values to unpack (expected 1, got 0)
Run Tree startup_indirect_mesh_cache_heap_wide_warp
PR #3712, Windows job 1620be9d merged with main 0dd65da1 failed, as above
main 0dd65da1 (run later cancelled) passed
PR #3707 (edadb494, includes #3664) passed

#3712 does not touch request publishing. I could not reproduce it locally: on this Windows 10 host the WARP variant skips with no mesh shaders, and the hardware variant fails before the draw.

One path that fits, from reading src/startup_stubs/request_publisher.h at 0dd65da1:

  • At exit, ExitProcess ends the writer thread before MeshRequestDrain runs (d3d12_draw.inl:651-654). drain() then writes what is still queued, but only after TryAcquireSRWLockExclusive(&lock_). If that fails, it returns 0 and writes nothing (:135, :143).
  • The writer thread holds lock_ outside the file writes: on entry to run() (:209) and while it pops each written request (:190). If the thread is ended in one of those windows, the lock stays held, and the queued request is dropped without a message.
  • A writer thread that starts late on a busy runner widens the first window.

Possible fixes, for the owner of #3664 to choose:

  1. Make the exit path reliable without waiting on a lock the writer may still hold. For example, at the end of a fixture's draw, flush() before returning, or have the drain report a skipped queue instead of returning 0 silently.
  2. Test-only: run the fixtures that read req_* files immediately with X2W_SYNC_MESH_REQUESTS=1. This loses their coverage of the background path, which startup_request_publisher_check still covers.

AI-assisted.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions