Make QuadSurface gen safe for parallel rendering#1054
Open
LubuSeb wants to merge 1 commit into
Open
Conversation
|
@LubuSeb is attempting to deploy a commit to the scroll Team on Vercel. A member of the Team first needs to authorize it. |
7feaa08 to
ebd5c31
Compare
This was referenced Jun 29, 2026
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.
Fixes #1046.
Summary
QuadSurface::gen()safe whenvc_render_tifxyzcalls it from parallel tile workersQuadSurface::gen()regression test that requests normals from multiple worker threadsReproduction / Root Cause
Issue #1046 reports SIGSEGVs in
vc-render-tifxyzafter updating from an April build. The posted stack trace lands in:vc_render_tifxyzrenders tile columns inside an OpenMP loop, and each tile callsgenTile(), which callsQuadSurface::gen()on the sameQuadSurface.The recent optimized
gen()path reused mutable destination scratch buffers on the surface object:_genCoordsScratch_genValidScratch_genNormalsScratchThose are written by each
gen()call, so parallel tile workers could write and resize the samecv::Matstorage concurrently. The lazy_normalCachebuild was also unguarded, so first-use normal generation could race.Scope / Minimality
This patch is limited to:
volume-cartographer/core/include/vc/core/util/QuadSurface.hppvolume-cartographer/core/src/QuadSurface.cppvolume-cartographer/core/test/test_quadsurface_components.cppIt does not change surface-normal orientation policy,
vc_render_tifxyzcommand-line options, renderer output semantics, or scheduling.Issue / Artifact Binding
LubuSeb:codex/villa-1046-threadsafe-genValidation
Run in the project Docker builder:
Results:
vc_render_tifxyzbuilt successfully.test_quadsurface_componentspassed, including the new concurrentQuadSurface::gen()regression.97/97tests.git diff --checkpassed; only Windows LF-to-CRLF warnings were emitted by Git.Known Limits
I did not have the private/large segment dataset that produced the original backtrace, so I validated the failure mode with a focused concurrency regression and the full Dockerized test suite rather than a direct data replay.
This is also a normal GitHub PR contribution. It may be relevant for Vesuvius monthly progress-prize review, but this PR does not claim or guarantee an award.