Add manual seam positioning + a seam debug line - #426
Open
RufanMelfor wants to merge 1 commit into
Open
Conversation
|
All contributors have signed the CLA. Thank you! |
Reimplemented from scratch against the current architecture (post "stitch unification" / "executor spine" refactors) - the original implementation predates both, and neither seam_offset nor a debug-line concept exist anywhere in this codebase currently. Core addition: Topology::seam_offset (f32, default 0.0, bounded to +/-SEAM_OFFSET_RANGE=0.3), following this codebase's established pattern of homing render-affecting rig state on the Calibration document (alongside blend_width) rather than on ViewportConfig. Shifts only the alpha-crossfade threshold within the coverage the calibration already guarantees - never the plane geometry itself, so it cannot open a black gap the way moving `intersect` could. Threaded through both render paths that must agree by construction: - GPU: fisheye.wgsl's previously-unused lens_preview.z slot now carries seam_offset; lens_preview.w carries show_seam_line (a debug line drawn by reusing the exact same edge_dist the alpha blend computes, so it can never disagree with where the blend actually sits). - CPU: BlendRule::Smoothstep gained an `offset` field (was a bare width). This is the software stitcher that must mirror the shader exactly for the agreement-oracle tests - added cpu_and_gpu_backends_agree_with_seam_offset (a real end-to-end GPU test on real hardware, not just a compile check) alongside a focused BlendRule::alpha unit test proving the offset shifts the curve without changing its shape. show_seam_line is deliberately NOT calibration state (lives on StitchPipeline directly, GPU-executor-only - the CPU executor is a headless correctness oracle / GPU-less render path with no interactive preview to draw a debug overlay onto). Wiring: StitchCore::set_seam_offset/set_show_seam_line -> StitchSession::set_show_seam_line (seam_offset flows through Calibration directly, matching blend_width) -> StitchJob::seam_offset()/ show_seam_line() builders -> `reco stitch --seam-offset/--show-seam-line` -> reco-gui "Seam position" slider + "Show seam line" checkbox (Stitching panel and export, mirroring the existing Seam blend slider's wiring exactly, including calibration-load/reset sync). Verified: cargo fmt --check clean; cargo test -p reco-core (153 passed, including both new tests; only the 2 pre-existing CUDA hardware-gap failures, unrelated); cargo check clean across the whole workspace (reco-obs excluded, pre-existing unrelated OBS-SDK build gap). clippy blocked by the same 4 pre-existing issues on upstream's own current main fixed in the separate fix/d3d11-stage-frame-unsafe branch - not caused by this change (confirmed identical on a clean origin/main checkout before any of this branch's commits). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
RufanMelfor
force-pushed
the
feat/seam-positioning
branch
from
July 16, 2026 10:36
a012695 to
ce23f49
Compare
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Reimplemented from scratch against the current architecture (post
"stitch unification" / "executor spine" refactors) — the original
implementation predates both, and neither
seam_offsetnor a debug-lineconcept exist anywhere in the current codebase.
Core addition:
Topology::seam_offset(f32, default0.0, bounded to±
SEAM_OFFSET_RANGE= 0.3), following the codebase's established patternof homing render-affecting rig state on the
Calibrationdocument(alongside
blend_width) rather than onViewportConfig. It shifts onlythe alpha-crossfade threshold within the coverage the calibration already
guarantees — never the plane geometry itself, so it can't open a black
gap the way moving
intersectcould.Threaded through both render paths that must agree by construction:
fisheye.wgsl's previously-unusedlens_preview.zslot nowcarries
seam_offset;lens_preview.wcarriesshow_seam_line(adebug line drawn by reusing the exact same
edge_distthe alpha blendcomputes, so it can never disagree with where the blend actually sits).
BlendRule::Smoothstepgained anoffsetfield (was a barewidth) — this is the software stitcher that must mirror the shader
exactly for the agreement-oracle tests. Added
cpu_and_gpu_backends_agree_with_seam_offset(a real end-to-end GPUtest on real hardware, not just a compile check) alongside a focused
BlendRule::alphaunit test proving the offset shifts the curve withoutchanging its shape.
show_seam_lineis deliberately not calibration state (lives onStitchPipelinedirectly, GPU-executor-only — the CPU executor is aheadless correctness oracle with no interactive preview to draw a debug
overlay onto).
Wiring:
StitchCore::set_seam_offset/set_show_seam_line→StitchSession→StitchJob::seam_offset()/show_seam_line()builders →reco stitch --seam-offset/--show-seam-line→ reco-gui "Seam position"slider + "Show seam line" checkbox, mirroring the existing "Seam blend"
slider's wiring exactly (including calibration-load/reset sync).
Verified:
fmt --checkclean;cargo test -p reco-core(153 passed,including both new tests; only the 2 pre-existing CUDA hardware-gap
failures, unrelated); full workspace build clean.