• Andrey Filippov's avatar
    CLAUDE: DP rung D2 - device measure chain from ONE parent entry · 39534100
    Andrey Filippov authored
    PoseMeasureChain descriptor (tp_lma.h) = the rung-B3 per-scene pcyc_*
    union + the resident buffer pointers the granular stage functions launch
    with - the DP parent's marshalling, consumed verbatim. Geometry buffers
    stay opaque (void*) so the header remains host-compilable; tp_lma.cu
    casts at the launch sites (one NVRTC translation unit).
    
    pose_measure_dp tail-enqueues the EXACT B3 host stage sequence:
    task_update -> [slot0 rot-deriv + tile offsets + erase(NaN) + convert
    SET] -> [slot1 rot-deriv + tile offsets + convert SUBTRACT] ->
    consolidate -> inter-corr -> normalize -> peak. Payload kernels are the
    UNMODIFIED production ones (most already single-thread CDP parents -
    the pre-JNA top-DP pattern), so the chain is byte-identical BY
    CONSTRUCTION; only the interior host syncs and the mid-chain 4-byte
    count readbacks disappear. Mid-chain counts (MB pairs / surviving tiles
    / corr rows) are read by self-chaining launchers (the D1 pattern) that
    run tail-enqueued BEHIND the counting kernel and check the LIVE count
    against the descriptor's provisioned capacity (device count guards;
    static over-provisioned shapes per the ratified D2 rule). New helper
    kernels only move bytes: gather/scatter of the per-cam CLT slices and
    the 0xFF NaN-poison fill (the host DtoD memcpys/memsets).
    
    Wrapper tp_proc_exec_pose_measure_cycle_dp (B3-signature drop-in):
    host keeps the rung-C2 nullable uploads (pose_task_upload split out of
    exec_pose_task_update, same bytes), the per-sequence reverse-distortion
    build, consolidate/peak capacity provisioning (no device-side malloc),
    the B4 bayer fence, ONE parent launch, ONE end-of-chain 5-int status
    D2H (rc/pairs/surviving/misaligned/corr rows). Peaks/corr indices stay
    resident for the unchanged fetch calls.
    
    Gate: test_pose_measure_dp_jna (cases.list 'measure_dp', rides the
    captured pose_corr case for real images/kernels/geometry/center-TD;
    task template txy/centers extracted from the captured production task
    stream; camera pair synthetic per the B1/D1 two-instance rule). Three
    poses, B3 entry vs DP chain, ORDER-INDEPENDENT KEYED BY PACKED INDEX:
    counts/stats equal, index sets equal, raw-TD (256) + FZ-normalized PD
    (225) + peak (8) rows ALL memcmp-equal (300 corr rows, 150/150 tiles).
    run_cases.sh ALL PASS (pose_corr @tol 0, peak, peak_recenter, avg_td,
    avg_td_oob, bayer_staged, dp_cycles, measure_dp); DP spike test still
    PASS; compute-sanitizer 12.8 memcheck 0 errors.
    Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
    39534100
tp_lma.h 18.3 KB