Skip to content

Add manual seam positioning + a seam debug line - #426

Open
RufanMelfor wants to merge 1 commit into
reco-project:mainfrom
RufanMelfor:feat/seam-positioning
Open

Add manual seam positioning + a seam debug line#426
RufanMelfor wants to merge 1 commit into
reco-project:mainfrom
RufanMelfor:feat/seam-positioning

Conversation

@RufanMelfor

@RufanMelfor RufanMelfor commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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 the current codebase.

Core addition: Topology::seam_offset (f32, default 0.0, bounded to
±SEAM_OFFSET_RANGE = 0.3), following the codebase's established pattern
of homing render-affecting rig state on the Calibration document
(alongside blend_width) rather than on ViewportConfig. It shifts only
the 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 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 with no interactive preview to draw a debug
overlay onto).

Wiring: StitchCore::set_seam_offset/set_show_seam_line
StitchSessionStitchJob::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 --check clean; 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.

Seam

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

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

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants