-
Notifications
You must be signed in to change notification settings - Fork 773
NanoVDB: correctness and determinism fixes #2249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
swahtz
merged 17 commits into
AcademySoftwareFoundation:master
from
swahtz:tranche-1-correctness-determinism
Aug 8, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c3cde0f
NanoVDB CUDA: correctness and determinism fixes
swahtz 42afea5
Fix up comments
swahtz fb1c692
comment fix
swahtz 992aace
NanoVDB CUDA: scope IndexToGrid zero-init to the output it actually n…
swahtz 465599d
NanoVDB CUDA: null-terminate over-long grid names; query current devi…
swahtz 0e5fbf3
NanoVDB CUDA: only sync SignedFloodFill root pass on a non-default st…
swahtz 5bb2eba
NanoVDB CUDA: track DeviceBuffer free stream per device (multi-GPU fix)
swahtz 3cdaa03
NanoVDB CUDA: drain default stream after NonBlockingStreamDilate busy…
swahtz 04c16f9
NanoVDB CUDA: update DeviceBuffer free-stream on every up/download
swahtz bbb19a9
NanoVDB CUDA: include <algorithm> for std::min; fix DeviceBuffer stre…
swahtz f20dd2a
NanoVDB: add pending CHANGES entries for the CUDA correctness fixes
swahtz 59fcab4
Comment fix
swahtz e335180
NanoVDB: order DeviceBuffer device frees after every stream that used…
swahtz 5b5e936
NanoVDB: update the DeviceBuffer entry in pending changes
swahtz f951153
NanoVDB: add a regression test for DeviceBuffer multi-stream free ord…
swahtz 111b12f
NanoVDB: guard DeviceBuffer self-move and document clear()'s stream a…
swahtz 457b671
NanoVDB: public DeviceBuffer::recordUse, per-device frees, and strong…
swahtz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All four points from this review (the comment above plus the three suppressed ones) evaluated and addressed in 457b671. For the humans following along:
Raw-pointer uses are untracked (this comment) — correct, and the most important of the four. The event only covers
deviceUpload/deviceDownload; kernels launched againstdeviceData()'s raw pointer are invisible to it. Two clarifications on scope: work on blocking streams is still covered (the free is issued on the default stream, which is implicitly ordered after them — the same coverage master provided), and the uncovered case — raw-pointer work on a non-blocking stream — was equally uncovered on master, where no API could even express the dependency. Fixed as suggested by making the contract explicit:recordUse(device, stream)is now public, anddeviceData()documents that raw-pointer work on non-blocking streams must either be registered through it or synchronized before the buffer is cleared/destroyed.Test's
userstream is blocking (suppressed, TestNanoVDB.cu) — deliberate, but the observation exposed a gap. The blocking scenario is what discriminates the last-used-stream revision this thread started with; simply flipping it to non-blocking would create a test no implementation can pass, because the late write never goes through the buffer's API. WithrecordUsepublic, the constructive version exists, so the test is now two scenarios, verified per revision:recordUseOne stream for every device's free (suppressed, DeviceBuffer.h) — agreed in principle. A stream belongs to one device, and nothing in the SOMA documentation blesses freeing one device's pool allocation on another device's stream ("deallocation can be performed in any stream" is stated in a same-device context).
freeDeviceBuffersnow frees each allocation on its own device — the caller's stream for the current device, the owning device's default stream otherwise, switching devices as needed. Honesty note: master's loop had the same single-stream shape, and this machine has one GPU, so the multi-device path is verified by inspection and compilation only.SignedFloodFill test coverage (suppressed, SignedFloodFill.cuh) — agreed, added as
NonBlockingStreamSignedFloodFill, mirroring the dilation regression (occupied default stream, non-blocking run, readback on the producing stream, identical output required). One scope caveat, verified rather than assumed: it locks the cross-stream contract and would catch node passes escaping to the default stream, but it cannot discriminateprocessRoot's internal ordering on constructible inputs — I swapped the pre-fix header in and it passes (3/3), because that path only does work when interior root-level tiles exist (a level set thousands of voxels across) and the pre-fix code was accidentally host-synchronous otherwise via its blocking legacy-stream memcpy. The test comment says so.Goldens unchanged (46/46), full test file compiles, self-move check still passes.