[cuda.compute]: Fix segmented sort selector race - #10024
Conversation
The selector state is now per-call (stack-local), so the build-owned selector ops carry state=nullptr. Drop the now-dead std::free(op.state) calls in the destructor, cleanup path, and deserialize error handlers (free(nullptr) is a harmless no-op but misleads readers into thinking the build op still owns state), and fix the two comments accordingly. Every op.code free is preserved.
|
/ok to test 33c0a35 |
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesSegmented sort selector state
Suggested reviewers: Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
c/parallel/src/segmented_sort.cu (1)
269-320: 🩺 Stability & Availability | 🔵 TrivialConfirm regression test coverage for the fixed race.
The PR comments note testing was requested for the commit fixing this race. No test changes are included in this file/batch. Given the C API path instructions call for coverage of public C parallel APIs, and this is specifically a concurrency fix (hardest class of bug to regress-test), it's worth confirming a test exercising concurrent
cccl_device_segmented_sortbuilds/dispatches on a shared build result exists (e.g. under a ThreadSanitizer-enabled CI job), per the referenced.agent/skills/cccl-test/SKILL.mdguidance for this file type. Happy to help draft such a test if none exists yet.As per coding guidelines, "When writing, updating, reviewing, or validating tests, follow the applicable guidance in
.agent/skills/cccl-test/SKILL.md" and per path instructions, "Focus on ... coverage for public C parallel APIs" forc/**/*.Also applies to: 904-925
Sources: Coding guidelines, Path instructions
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 91076c03-f3f8-49c8-a1be-ea379b940949
📒 Files selected for processing (1)
c/parallel/src/segmented_sort.cu
🥳 CI Workflow Results🟩 Finished in 2h 44m: Pass: 100%/20 | Total: 6h 03m | Max: 49m 14s | Hits: 98%/1515See results here. |
Description
This separates the race fix found by TSan in #9986 into it's own PR (and removes some redundant std::free calls)