The materializer repeats the exact score work for a tiny survivor set so the fast gate never becomes the source of record endpoints.
warp lane 0 1 2 … 30 31
sequence base p p+1 p+2 … p+30 p+31
prefix score ───────── inclusive scan ─────────
running max ───────── prefix maximum ─────────
X-drop ballot first set lane ends this direction
endpoint earliest lane attaining the winning maximum E.1 — Restore each surviving anchorStep 1 of 5
WHAT GOES IN: Stable survivor IDs, packed raw anchors, and encoded sequences. WHAT HAPPENS: One warp resolves each survivor ID back to its original reference/query anchor. WHAT COMES OUT: An ordered stream of anchors for the exact materializer. INVARIANT: The materializer sees the same anchor coordinates as the score gate, in the same relative order.
Readable journey
E.1 — Restore each surviving anchor
- what goes in
- Stable survivor IDs, packed raw anchors, and encoded sequences.
- what happens
- One warp resolves each survivor ID back to its original reference/query anchor.
- what comes out
- An ordered stream of anchors for the exact materializer.
- invariant
- The materializer sees the same anchor coordinates as the score gate, in the same relative order.
- Survivor IDs → Packed anchors: original hit index
- Packed anchors → Materializer warp: reference + query anchor
E.2 — Extend right in warp tiles
- what goes in
- One anchor, the substitution matrix, and X-drop.
- what happens
- Thirty-two lanes score consecutive bases, scan prefix sums and maxima, and ballot the first lane beyond X-drop.
- what comes out
- The right maximum score and earliest position where it occurs.
- invariant
- An equal later maximum never replaces the earliest winning endpoint.
- Anchor → 32-base tile: next right tile
- 32-base tile → Prefix scan: substitution scores
- Prefix scan → X-drop ballot: running score + maximum
- X-drop ballot → Right maximum: first drop or sequence edge
E.3 — Extend left with the same rule
- what goes in
- The same anchor and scoring state reset for the left side.
- what happens
- Lanes walk bases before the anchor, tile by tile, until the first X-drop or sequence boundary.
- what comes out
- The left maximum score and earliest left extent.
- invariant
- Right and left use the oracle's duplicated direction-specific coordinate rules.
- Anchor → 32-base tile: next left tile
- 32-base tile → Prefix scan: reverse offsets
- Prefix scan → X-drop ballot: running score + maximum
- X-drop ballot → Left maximum: first drop or sequence edge
E.4 — Recover the closed HSP interval
- what goes in
- Anchor coordinates plus left and right winning extents.
- what happens
- The left extent shifts both starts; both directional extents combine into one inclusive length field.
- what comes out
- Candidate `ref_start`, `query_start`, `len`, and total score.
- invariant
- `SegmentPair.len` is an extent, so the printed interval covers `start..=start+len`.
- Anchor → SegmentPair: anchor coordinates
- Left extent → SegmentPair: shift both starts
- Right extent → SegmentPair: close the inclusive extent
E.5 — Store only accepted records
- what goes in
- Candidate interval, score, and the entropy-adjusted decision.
- what happens
- Lane zero writes one aligned 16-byte SegmentPair and a done flag, or writes rejection status.
- what comes out
- Materialized HSP/status arrays ready for stable compaction.
- invariant
- Every active output slot is fully overwritten before the host or another kernel reads it.
- Candidate HSP → Entropy decision: total score + closed interval
- Entropy decision → SegmentPair store: accepted 16-byte record
- Entropy decision → Done flag: 1 accepted or 0 rejected