Repository navigation
Conversation
a_released_targets_copy_goes_when_its_memory_is_used_again compared the placed view's resource before and after the title's new texture with assert_ne!(now, shown), a pointer compare of a resource that was queued for release. The queue (RELEASED) is the process's, and five other tests drain it with release_waiting(ZERO) at any moment: that frees `shown` before the check, and the next resource made can get the same heap address, so the compare failed now and then in the parallel run (#54). The test takes a reference on `shown` and gives it back at the end, so the address cannot be reused. No production code changes: the 2 s grace is only drained early by tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This pull request now conflicts with its base branch. Please rebase it on |
|
Other open pull requests change the same files. Check that they do not do the same work, and agree with their authors on which lands first: the other one will then need a rebase.
This comment is kept up to date automatically and removed when the overlap ends. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Part of #54.
resource::tests::a_released_targets_copy_goes_when_its_memory_is_used_againfailed now and then in the parallel run. The cause is in the test, not a production race.The test makes a placed view (
shown), releases its target, then makes a texture at the same address. That putsshownin the process-wide release queue, to be freed 2 s later, and the test then checksassert_ne!(now, shown), a raw pointer compare. Five other tests drain that whole queue withrelease_waiting(Duration::ZERO). If one runs between the queueing and the compare,shownis freed, and the next resource made bytexture_atcan get the same heap address, sonow == shownand the assert fails. Production only drains after the 2 s grace, so it is unaffected.The test now takes its own reference on
shownand gives it back at the end, so the address can't be reused, andnow != shownchecks what it was meant to. No sleep or retry.Area
gpu: the test module ofresource.rsonly (+11 lines).Tests
cargo xtask pr-checkpasses on my machineNew or changed behaviour has tests that need no game files, or I explain below why it cannot
Evidence: a natural failure in run 32 of 40 parallel runs (
left != right, both the same pointer). Draining the queue on purpose right beforetexture_atreproduced it in 1 of 3 runs of the test alone.Parallel
XTP_TEST_ADAPTER=warp cargo test -p xtp-gpu --locked --lib: before, this test failed 1 of 40 runs; after, 0 of 40; with the forced drain kept in, 0 of 15.The debug-layer suite passes, and the full WARP
pr-checkpasses.Not fixed here, also seen while looping:
draw::tests::textures_the_hashing_budget_left_out_come_first_nextfailed in 4 of 80 parallel runs.watch::tests::a_view_gone_before_the_index_forgets_it(gpu: two unit tests fail now and then in parallel runs #54) did not fail in those runs; it is being looked at separately.Provenance
AI assistance: Claude Code (Sonnet, as a Hangar worker) found the cause and wrote the fix; Claude Code (Opus 5.5) reviewed it. No external code was copied or translated. I answer for every line.
Checklist
<area>: <summary>; one topic; under 400 changed lines, or the reason is above🤖 Generated with Claude Code