Skip to content

gpu: two unit tests fail now and then in parallel runs #54

Backlog

Description

@fogydes

What

Two xtp-gpu unit tests fail now and then on current main in the parallel workspace run (cargo test --workspace --locked, WARP), and pass on a rerun:

  • watch::tests::a_view_gone_before_the_index_forgets_it
  • resource::tests::a_released_targets_copy_goes_when_its_memory_is_used_again

Each was seen once or twice today across many pr-check runs on branches that don't touch the code they test. It looks like a dependency on timing or on shared state with tests running alongside.

Impact

cargo xtask pr-check and CI's test job fail at random.

No game files are needed.

Activity

  1. added
    bug
    area/gpu
    on Nov 25, 2026
  2. fogydes commented on Nov 25, 2026

    @fogydes
    CollaboratorAuthor

    One more, seen once in a serial debug-layer run on WARP (passed alone and on the full rerun): descriptor::host::tests::placed_texture_slots_follow_their_replacement (crates/xtp-gpu/src/descriptor/host.rs ~3902).

  3. simnJS commented on Nov 25, 2026

    @simnJS
    Collaborator

    Thanks for tracking these. Each flaky test is now with the task that currently owns its file: the watch.rs test with the write-watch work (N4), the resource.rs test with the R9G9B9E5 decode work, and the descriptor/host.rs one (plus placed_unordered_texture_views_are_made_over_their_memory, which failed the same way on #26's debug-layer run) with the next descriptor task. The goal is to remove the shared state or timing dependency, not to retry. I'll update this issue as each lands.

  4. fogydes commented on Nov 25, 2026

    @fogydes
    CollaboratorAuthor

    The draw byte-budget timing flake is isolated in PR #73 (head 749233d). The test now disables the elapsed-time deadline only on its own thread, retaining its byte budget and restoring nested overrides with RAII; production deadlines are unchanged.

    Both target tests passed all 40 original parallel WARP runs. Complete suites passed 27/40; the other 13 had 15 failures in three unrelated tests:

    • descriptor::host::tests::raw_views_a_submission_in_flight_may_read_stay_until_it_has_run (2)
    • draw::tests::views_written_after_a_lists_last_pick_are_made_as_it_closes (1)
    • rt::tests::rt_tlas_rebuilds_reuse_a_result_nothing_holds (12)

    After an unchanged rebase, fresh strict WARP diagnostics passed 633 unit + 3 integration tests and the full six-stage default-thread PR check passed. The initial full-check process was interrupted during compilation; the complete resumed run passed. This PR covers only the draw timing dependence, not all flakes in this issue. Evidence remains local; no title data was used or uploaded.

    AI assistance: Codex implemented and reviewed the fix and ran the synthetic checks.

  5. AliceWood commented on Nov 25, 2026

    @AliceWood
    Contributor

    I am taking the TLAS result-reuse test reported in the 40-run WARP comparison. I will check it on current main, isolate the cause of interference, and compare parallel runs with the generation-reuse and ray-hit assertions in place. AI assistance: Codex is investigating and testing this change.

  6. Lewandox commented on Nov 25, 2026

    @Lewandox

    I am taking descriptor::host::tests::raw_views_a_submission_in_flight_may_read_stay_until_it_has_run from the parallel WARP list above.

    Reproduced on current main (9b822f5) in 1 of 30 parallel WARP runs (--test-threads=8): crates/xtp-gpu/src/descriptor/host.rs:6603 (assert_eq!(dst.words()[..64], old[..], "the old window, untouched")) read 0xdead_beef. gpu_caught_up(host) checks host.completed() < ticket against the D3D12 GPU fence and returns without draining when the fence has already advanced while xtp-gpu-finisher has not yet finished write-back into dst. In addition, the Gate::close tests in descriptor/host.rs and resource/pool.rs hold the shared host queue without host::submissions::serial(), unlike host::submissions and draw.rs.

    I will fix this by settling reader before reading dst.words() and serializing the Gate::close tests with host::submissions::serial(), then verify with repeated parallel WARP and hardware runs and cargo xtask pr-check.

    AI assistance: Antigravity assisted with investigating, reproducing, and testing this change.

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

    area/gpuarea/testsbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions