1. 16 Jul, 2026 6 commits
    • Andrey Filippov's avatar
      CLAUDE: rung C1 - resident prepareLMA (assemble + serial normalize on-device) · 7db7cf60
      Andrey Filippov authored
      Design 3-A4i rung C1: the LMA measured inputs never leave the GPU.
      - pose_lma_assemble (grid over resident corr rows): peaks {dx,dy,str,e0x,
        e0y,l0,l1,valid} + packed corr indices -> per-tile y offsets, raw strength
        weights, eigen 2x2 transform (setEigenTransform math, float; identity when
        use_eigen==0) and the fx selection mask. Parameterized contract (counts,
        slot, shift, components, policy scalars) - CUAS specifics stay host policy.
      - pose_lma_prepare_norm + pose_lma_prepare_finish: SERIAL one-thread tails
        (sample normalize + pull rows; y+=fx, H diagonal in Java getWJtJlambda
        order, regularization weights, full-weight normalize + pure_weight) -
        serial by design so the Java/C++ float clones gate BIT-EXACT.
      - tp_proc_exec_pose_lma_prepare_resident: camera/pose/centers/policy H2D,
        assemble -> norm -> pose_fx_jacobian(current, NO readback) -> finish;
        D2H = 8-float compact result (+optional capture of y/weights/eigen for
        the one-shot oracle). Same scratch bookkeeping as the step so a following
        no-H2D step never regrows.
      - tp_proc_exec_pose_lma_resident_step: all-NULL weights/y/eigen = use the
        resident prepared buffers (skip H2D); mixed NULLs rejected.
      Gates: direct CUDA prepare 5120/159 BIT-EXACT vs serial float oracle
      (y/weights/eigen/selection/scalars all 0 mismatches); resident + 19-float +
      fx_jacobian NVRTC PASS; pose_corr bit-exact @tol 0; compute-sanitizer 0
      errors on both binaries.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      7db7cf60
    • Andrey Filippov's avatar
      CLAUDE: rung B - device-visible pose current/candidate set index (no host swap) · 5f473261
      Andrey Filippov authored
      Design 3-A4i rung B (imagej-elphel-internal 2026-07-16 handoff), DP-readiness:
      - gpu_pose_* / gpu_pose_candidate_* become FIXED physical slots; the CURRENT
        set is selected by a device-authoritative int flag.
      - pose_lma_reduce_rms gains a final int* current_set arg and flips it on
        accept DEVICE-SIDE (NULL = no flip, standalone tests); rejection leaves it
        unchanged so the prior current raw pose remains the fallback.
      - tp_proc_exec_pose_lma_resident_step: host std::swap removed; launch
        pointers come from cur_*/cand_* accessors; the host mirror syncs with a
        4-byte D2H after each step. exec_pose_fx_jacobian uploads/reads via the
        CURRENT set. The candidate-base DtoD invariant (ref rows pose-independent)
        is now documented at the copy site.
      - test_pose_lma_step: pass + assert the no-flip side (not-accepted case).
      C API unchanged. Gates: direct CUDA 5120/150 PASS (products 0.000244141,
      candidate 9.69e-08, same as session-40); NVRTC resident accept-carryover +
      worsened-rejection PASS (flip proven behaviorally); 19-float bit-exact PASS;
      fx_jacobian PASS; compute-sanitizer(12.8) 0 errors; test_pose_corr_jna
      bit-exact @tol 0.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      5f473261
    • Andrey Filippov's avatar
      CODEX: Keep pose LMA acceptance state resident · d9b7afdb
      Andrey Filippov authored
      Co-authored-by: 's avatarCodex <codex@elphel.com>
      d9b7afdb
    • Andrey Filippov's avatar
      CODEX: Evaluate pose LMA candidate RMS on GPU · a9688cbc
      Andrey Filippov authored
      Co-authored-by: 's avatarCodex <codex@elphel.com>
      a9688cbc
    • Andrey Filippov's avatar
      CODEX: Add resident CUDA pose LMA preparation · 702c2f76
      Andrey Filippov authored
      Co-authored-by: 's avatarCodex <codex@elphel.com>
      702c2f76
    • Andrey Filippov's avatar
      CODEX: Add float CUDA pose LMA candidate · 31f70553
      Andrey Filippov authored
      Co-authored-by: 's avatarCodex <codex@elphel.com>
      31f70553
  2. 15 Jul, 2026 6 commits
  3. 14 Jul, 2026 6 commits
    • Andrey Filippov's avatar
      CLAUDE: peak kernel precision two-step - templated body, float instantiation... · 4bcc5195
      Andrey Filippov authored
      CLAUDE: peak kernel precision two-step - templated body, float instantiation corr2D_peak_eig_f (Andrey's methodology)
      
      Step 1 (double vs double Java oracle) was the validated state; the body is
      now a template on the accumulator type with two extern-C instantiations:
      corr2D_peak_eig (double, the oracle-matched reference) and corr2D_peak_eig_f
      (float, ~64x cheaper FLOPs + half the shared footprint - kept adequate for
      full-frame, Andrey's ruling). tp_proc_exec_corr2d_peak grows a use_float arg;
      NVRTC module = 25 kernels. All three tests run BOTH and report float-vs-double
      grouped stats (dx/dy px, strength rel, eigvec abs, lambda rel).
      
      Step 2 measured:
      - synthetic: dx/dy <= 4.8e-7 px, lambda <= 9.4e-7 rel; eigvec 0.031 ONLY on
        the (near-)isotropic tiles where the direction is ill-defined (float can't
        fire the oracle's e=1e-12 branch) AND unused (setEigenTransform degenerates
        to isotropic weighting when lambda0~lambda1) - documented in tp_peak.cu.
      - REAL case (4 iterations x 150 tiles): dx/dy <= 7.2e-7 px, strength
        IDENTICAL, eigvec <= 8.9e-5, lambda <= 1.2e-6 rel - 4+ orders below the
        ~0.01 px measurement noise. Float is adequate for production; double stays
        as the validation/oracle tier. Double regression unchanged (synthetic 0 /
        9.6e-17; real case ALL PASS).
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      4bcc5195
    • Andrey Filippov's avatar
      CLAUDE: peaks compare - dual criterion (abs floor OR 4 float ULP at operand scale) · 02508a82
      Andrey Filippov authored
      First rung-2 real case (Andrey's 07/14 export) measured the predicted tier
      precisely: tasks + corr_td + corr_pd ALL BIT-EXACT @tol 0 (the in-place
      FZ-norm is production-identical); peaks ~14% of elements flip by 1-2 float
      ULP at their own magnitude (double-math FMA contraction vs Java, absorbed
      except at float cast boundaries) - a flat absolute tol cannot cover 1 ULP
      of lambda~40 (3.8e-6) while staying meaningful for dx~0.01. Criterion now:
      pass if within --peak-tol ABSOLUTE (near-zero floor, default 1e-6) OR
      within 4 float ULP of the operand (measured max 2 ULP; near-zero relative
      outliers ~21 ULP are 3e-9 absolute = caught by the floor). Verdict on the
      fresh case: ALL PASS, viol=0.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      02508a82
    • Andrey Filippov's avatar
      CLAUDE: scene list points at the test manifest - SET casesFile support · edc6c4ab
      Andrey Filippov authored
      The scene-sequence .list is the single source of truth: it now carries
      SET casesFile lists/cases.list (relative to rootDirectory, the
      EyesisCorrectionParameters rule). run_cases.sh discovery order: -c arg ->
      the scene list's SET casesFile (when -x/-l provides the list; explicit
      pointer, missing target = hard error) -> convention lookup under
      rootDirectory -> repo-local gitignored link. Verified: -l, -x and bare
      modes all resolve to the same manifest/model.
      
      Java companion (imagej-elphel): casesFile added to KEY_DIRS (index 12,
      file-exempt from the auto-mkdirs) so the SET parses cleanly.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      edc6c4ab
    • Andrey Filippov's avatar
      CLAUDE: cases.list -> data root (repo keeps template + code only) · 5b8f2f7a
      Andrey Filippov authored
      Andrey's rulings 07/13/2026: data directories are not git-controlled; the
      repo is shared across computers with different data sets, so it carries
      code, generators and a heavily-commented TEMPLATE (linux-config style) -
      everything data-specific lives under the data root:
      
      - cases.list -> cases.list.tmpl (tracked; install by copying to
        <dataRoot>/lists/cases.list next to the scene lists; SET listFile may
        then be a bare filename - resolved relative to the manifest's directory).
      - /cases.list gitignored: optional repo-local symlink into the data root
        so a bare ./run_cases.sh works.
      - run_cases.sh: manifest lookup order -c arg -> ./cases.list link ->
        via -x/-l through the scene list's rootDirectory (<root>/lists/,
        <root>/, next to the scene list). -x corr-xml alone now finds
        everything (list, version, manifest) from the entries the Java run uses.
      
      Verified live: installed at /home/elphel/lwir16-proc/LV/lists/cases.list;
      bare run ALL PASS via the symlink; -x corr-xml discovery ALL resolved with
      the symlink removed.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      5b8f2f7a
    • Andrey Filippov's avatar
      CLAUDE: manifest-like tests top - cases.list + run_cases.sh (Andrey's design),... · 72e2caf1
      Andrey Filippov authored
      CLAUDE: manifest-like tests top - cases.list + run_cases.sh (Andrey's design), de-hardwire test defaults
      
      The scene-sequence .list is the human single source of truth (SET header +
      body lines selected by uncommenting; commented lines document the setup).
      The tests now follow the SAME convention one level up:
      
      - cases.list: SET header (listFile, version - the version deliberately kept
        out of the scene list, mirroring CORRECTION_PARAMETERS.x3dModelVersion vs
        .sourceSequencesList) + case lines selected by uncommenting; commented
        cases stay as documentation. gen lines map synthetic cases to generators.
      - run_cases.sh: resolves ${MODEL} through the scene list's SET
        rootDirectory/x3dDirectory + its UNCOMMENTED sequence lines + the version
        (the *-CENTER dir carries the DERIVED center timestamp -> matched as the
        smallest center ts >= the sequence's first-scene ts containing <version>/);
        -x <corr-xml> reads sourceSequencesList/x3dModelVersion directly = the
        same two sources that drive the Java run. No args = all uncommented cases;
        named cases run even when commented; missing synthetic data triggers the
        generator.
      - test_proc_consolidate: hardwired absolute case/repo paths -> standard
        --data/--src/--devrt interface (legacy positional kept).
      - test_pose_corr_jna: srcdir default de-hardwired (repo-relative 'src').
      
      Verified live: ./run_cases.sh ALL PASS (pose_corr real-scene tol-0 resolved
      through the list+version, 4 synthetic cases); named-commented case
      avg_td_oob_jna PASS bit-exact via the new interface; gen-on-missing works.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      72e2caf1
    • Andrey Filippov's avatar
      CLAUDE: 3-C rung 2 - corr2D_peak_eig (frozen 15-arg getMaxXYCmEig contract) +... · 7ecab008
      Andrey Filippov authored
      CLAUDE: 3-C rung 2 - corr2D_peak_eig (frozen 15-arg getMaxXYCmEig contract) + checkpoint-2 replay + synthetic numpy gate
      
      Andrey's ruling 07/13/2026: the GPU peak contract = the 15-arg superset -
      closed-form 2x2 eigen, recentering as a runtime param, envelope de-bias as
      an optional array pointer (NULL = off).
      
      - src/tp_peak.{h,cu}: corr2D_peak_eig, one block/tile - parallel load/NaN/
        argmax(first-occurrence)/8-connected grow, thread-0 serial DOUBLE centroid/
        covariance/eigen/recentering in the Java oracle's exact summation order.
      - jna/tp_jna.cpp: kernel in the NVRTC module (24 kernels) +
        tp_proc_exec_corr2d_peak / tp_proc_get_peaks / tp_proc_set_peak_debias.
      - test_pose_corr + test_pose_corr_jna: checkpoint-2 replay (in-place
        corr2D_normalize -> corr_pd tol tier, peaks vs the double Java oracle at
        --peak-tol) when the case carries it; pre-rung-2 cases skip with a note.
      - make_peak_case.py + test_peak: synthetic gate vs an INDEPENDENT numpy
        float64 port (8 adversarial tiles + refine/debias case) - PASS at
        max|diff| 0 / 9.6e-17.
      - Regressions: test_pose_corr_jna bit-exact @tol 0 on the existing v013 case,
        avg_td / avg_td_oob / convert_direct PASS.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      7ecab008
  4. 13 Jul, 2026 2 commits
    • Andrey Filippov's avatar
      CLAUDE: test_pose_corr_jna - the tol-0 verdict binary (NVRTC production... · fc6f5245
      Andrey Filippov authored
      CLAUDE: test_pose_corr_jna - the tol-0 verdict binary (NVRTC production module); direct test = stepping companion
      
      RUNG 1 VALIDATED on the first real v013 case (scene 1773135467_917220,
      4 LMA iterations, 150 tiles/set, 300 corr tiles/iter): test_pose_corr_jna
      PASS BIT-EXACT @tol 0 - tasks (calculate_tiles_offsets) and raw TD
      correlation (correlate2D_inter) both max|diff|=0, every iteration.
      
      The offline-nvcc direct-launch binary (src/tests/test_pose_corr) cannot be
      bit-exact vs the NVRTC JIT (FMA/codegen divergence), measured: -G -O0 ->
      tasks off by 2^-13 px; RELEASE=1 -> tasks BIT-EXACT, corr within ~1 ULP at
      operand scale (max|diff| 128..256 vs amplitudes ~2e9, float spacing 256).
      Role split documented in both headers (same pairing as test_avg_td_oob /
      test_proc_consolidate): direct binary for cuda-gdb stepping, _jna binary
      for the production-equivalence verdict. Build line in the _jna header.
      Co-authored-by: 's avatarClaude Fable 5 <noreply@anthropic.com>
      fc6f5245
    • Andrey Filippov's avatar
      CLAUDE: test_pose_corr - lean pose checkpoint-1 replay (roadmap 3-C rung 1) · e09e873d
      Andrey Filippov authored
      Standalone per-iteration replay of the CuasPoseRT.leanMeasure GPU chain
      against the PoseCorrExport case (imagej-elphel curt.kernel_test=pose_corr):
      calcReverseDistortionTable + calc_rot_deriv + calculate_tiles_offsets (NEW
      under test; GPU-filled tasks compared bit-exact vs the oracle post-offsets
      streams, header+xy fields - the disp_dist tail is not round-tripped by the
      Java flatten), erase_clt_tiles(NaN) + convert_direct for both MB sets,
      the v1 consolidation chain into the cam-0 slot (inputs = the oracle
      post-offsets streams, the exact bytes production flattens), then
      correlate2D_inter vs the resident center TD from gpu_clt_ref cam 0 (NEW
      under test). Raw-TD compare is ORDER-INDEPENDENT (corr slot placement is
      atomicAdd-nondeterministic): tiles matched by packed index, tol 0 goal;
      results/corr_td_it<k> saved in oracle order for the Java round trip. All
      four LPF/HPF __constant__ tables overwritten from the case via extern
      __constant__ + cudaMemcpyToSymbol (correlate2D_inter reads LoG_corr and
      lpf_rb_corr). Built by build_tests.sh (auto-discovered), cuda-gdb steppable.
      Co-authored-by: 's avatarClaude Fable 5 <noreply@anthropic.com>
      e09e873d
  5. 12 Jul, 2026 13 commits
  6. 10 Jul, 2026 3 commits
  7. 03 Jul, 2026 1 commit
    • Andrey Filippov's avatar
      CLAUDE: self-documenting comments: MCLT overview, quad algebra conj/no-conj,... · 004f2020
      Andrey Filippov authored
      CLAUDE: self-documenting comments: MCLT overview, quad algebra conj/no-conj, tp_task bridge, GPU geometry chain
      
      Comment-only. From Andrey's explanation: MCLT perfect-reconstruction overview
      (TileProcessor.h, with blog ref); convolveTiles = quad product WITHOUT
      conjugation, kernels DTT-II/III family vs type-IV image tiles;
      correlateAccumulateTiles = conj(T1) x T2, order-sensitive; shiftTileHor/Vert
      = lossless fractional-shift phase rotators (differential rectification);
      struct tp_task bridge role + composed-offset semantics; calc_rot_deriv /
      calculate_tiles_offsets = GPU side of historic getPortsCoordinates().
      Pre-existing dirty jna/tp_jna.cpp intentionally NOT included.
      Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
      004f2020
  8. 27 Jun, 2026 3 commits
    • Andrey Filippov's avatar
      CLAUDE: tp_dnn GPU_CHUNK sub-batching - fix full-res OOM · 6c9c2486
      Andrey Filippov authored
      tpdnn_infer processed the whole `count`-scene request in one shot; at full res
      (512x640) a 64-scene field tensor is ~10GB (64x124x512x640) + decode p ~10GB ->
      CUDA OOM on a 16GB card. The 64x80 synthetic smoke didn't expose it.
      
      Now loops in GPU_CHUNK-sized sub-batches (== infer_server's GPU_CHUNK), writing each
      chunk straight to the host output buffers so GPU tensors stay bounded (~3-4GB/chunk
      at CHUNK=8). L2 hidden/age/sprev carry across chunks; reset only at the first chunk
      when l2_reset (matches the server). Env TPDNN_GPU_CHUNK (default 8).
      
      Validated: parity vs server oracle still EXACT (0.0) at CHUNK=8 (8+4) and CHUNK=4
      (4+4+4) - L2 carry across chunk boundaries is correct.
      Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
      6c9c2486
    • Andrey Filippov's avatar
      CLAUDE: publish_libtorch_mirror.sh - libtorch -> mirror maven layout (piece 4B) · ea9c117a
      Andrey Filippov authored
      Server-side copies the already-uploaded libtorch zip into
      mirror.elphel.com/maven-dependencies/org/pytorch/libtorch-cxx11-cu128/2.7.1/ (maven
      layout: .zip + .pom + .sha1/.md5, no 3.8GB re-upload) so imagej-elphel's -Plibtorch
      profile can dependency:unpack it. Pairs with fetch_libtorch.sh (direct download).
      Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
      ea9c117a
    • Andrey Filippov's avatar
      CLAUDE: native LibTorch L1+L2 inference shim (libtpdnn.so) for JNA · 9202dd30
      Andrey Filippov authored
      Piece 2 of the native-JNA DNN path. tp_dnn.cpp is a C-ABI port of infer_server.py's
      hot path so the Java client can run L1+L2 in-process instead of over TCP:
        tpdnn_init/upload/infer/free  (+ num_levels/level_frames)
      faithfully reproducing build_pyramid, the 16x shift-and-stitch full-res recovery,
      decode (ghostbuster + velocity centroid), and the L2 ConvGRU recurrence + track-age.
      Loads the TorchScript models from imagej_elphel_dnn (export_torchscript /
      export_l2_torchscript). Disables the TorchScript JIT fuser at init (nvrtc element-wise
      fusion fails on Blackwell; production wants no runtime nvrtc).
      
      Validated: native vs the running Python server (same CUDA) max|diff| offset5=0,
      roi=0 — bit-for-bit. (Oracle dump_ref.py + driver tpdnn_test.cpp, scratch.)
      
      Built standalone via build_dnn.sh (g++ + libtorch 2.7.1+cu128, ABI=1), separate
      from the nvcc-built libtileproc.so; fetch_libtorch.sh pulls the pinned libtorch.
      Context unification + zero-copy kernel<->tensor sharing is a later step.
      Co-Authored-By: 's avatarClaude Opus 4.8 (1M context) <noreply@anthropic.com>
      9202dd30