Paths, keys, shapes, dtypes, endianness, finiteness, row strides, and message timestamps
File counts/checksums, schema validators, and the first non-finite index
Engineering Implementation & Debugging
The costliest 6D-system errors often arise when two individually plausible modules assign different meanings to the same array. This topic turns implicit assumptions into machine-checkable contracts and uses independent evidence to locate the first failing layer.
01 · Artifact Contract
Do not transmit physical semantics through variable names and team assumptions. Use the same verifiable manifest for files, messages, caches, model inputs/outputs, and robot interfaces.
| Field group | Minimum declaration | Forbidden implicit assumptions |
|---|---|---|
| Identity | sample / scene / object / instance / camera / robot / task IDs | Strings and integers also need namespaces; array indices must not silently serve as object IDs |
| Transform | from/to frame, map direction, active/passive, column/row, handedness | `extrinsic`, `camera_pose`, and `T` are insufficient field names |
| Rotation | Matrix / quaternion / axis-angle / Euler; xyzw/wxyz; Euler sequence and intrinsic/extrinsic convention | Quaternion norm=1 or det=1 establishes numerical validity, not shared conventions |
| Translation | Unit, origin, reference point, scale policy, and valid range | Convert m/mm, CAD units, and normalized object scales once at interfaces |
| Camera | resolution, K/D/P, distortion model, raw/rectified domain, ROI/binning | Every image/tensor uses a camera model consistent with its own pixel domain |
| Image transform | Order, parameters, interpolation, and pixel conventions for crop/resize/pad/flip/rotate | Synchronize images, masks, keypoints, bboxes, flow, depth, normals, and pose labels |
| Depth / modality | encoding, unit/depth_scale, invalid/no-return, registered-to, timestamp/clock | Equal dimensions do not establish RGB-D alignment; never guess the semantics of 0, NaN, or ±Inf |
| Asset | CAD hash/version, unit, origin, axes, diameter, symmetry, mesh/texture/collision variants | Visualization, evaluation, and collision meshes and network templates may differ |
| Estimate | timestamp, source/model/config/checkpoint/preprocess hash, score/uncertainty/status | NaN, timeout, no-solution, and abstain are explicit states; do not disguise them as identity poses |
| Runtime | library/driver/device/precision, seed/determinism, latency, valid interval | A shared seed does not guarantee identical results across releases, CPU/GPU, or nondeterministic kernels |
Pose artifact manifest · Minimal executable example
pose:
map: object -> camera_optical # {}^C T_O
vector: column · active · right_handed
rotation: matrix3x3 · row_major_storage · projected_to_SO3=false
translation_unit: metre
timestamp: exposure_time · clock=camera_hw · valid_until=...
camera: image_domain=rectified · width/height · P_hash · preprocess_hash
asset: object_id · mesh_hash · unit=millimetre · origin_hash · symmetry_hash
producer: model/checkpoint/config/code hashes · dtype/device · status
quality: score_semantics · covariance_perturbation · failure_reason02 · Evidence Ladder & Differential Diagnosis
Change one factor at a time, save inputs and evidence, and propose at least two competing hypotheses for each symptom. Final optimizer logs cannot override earlier schema / geometry gates.
File counts/checksums, schema validators, and the first non-finite index
manifest diff, sentinel transform, unit/range assertions
RᵀR, det, T·T⁻¹, known point, Jacobian finite difference
project↔back-project, raw↔rectified A/B, depth histogram
matches overlay, per-point residual, static/dynamic and near/far slices
spectrum/condition, top-K solutions, seed/init sweep, held-out residual
fixed target closure, speed reversal, cold start, artifact atomic-load test
pose/grasp/motion oracle, hardware sentinel, failure-stage denominator
Check timestamps, clocks, rolling shutter, latency, robot interpolation, and compliance before static K.
Check focal/scale/depth models first; fixed pixel offsets suggest principal-point / crop / pad issues.
Check distortion/rectification and pixel domains first; a fixed global offset suggests K′/frame errors.
Check caches, partial deployment, configuration shadowing, device/precision, and nondeterminism first.
Interactive Lab
The first panel shows semantic errors in valid matrices. The second composes pixel affines, K, and depth back-projection. The third routes PnP, ICP, timing, NaN, reflection, and version issues through the first failing gate.
Executable diagnostics · fault injection
Schema contract
SO(3) invariants
Geometry
Independent overlay
Algebraic closure
Route
Target camera model
2D closure
3D closure
Depth / alignment
Route
Input / provenance
Data geometry
Numerical solver
Residual vs truth
Temporal shift
Release route
03 · Transform, Rotation & Numerical Hygiene
Rotation orthogonalization restores a numerical manifold constraint; it cannot repair frames, units, or labels. Count every automatic correction and gate its magnitude.
| Issue | Typical signature | Minimal isolation experiment / fix |
|---|---|---|
| m ↔ mm / deg ↔ rad | Translation differs by exactly 10³; angles jump periodically with input while R remains orthogonal | Use SI internally; include units in field names; range histograms + a known baseline |
| T_AB ↔ T_BA | Axes look plausible, but the object lies behind the camera or the robot moves the wrong way | Verify mapping direction with a known non-origin point, alongside T·T⁻¹ tests |
| Left ↔ right multiplication / row ↔ column vectors | One transform works, but composing two edges fails; translation is rotated incorrectly | Freeze the column-vector contract; test composition with noncommuting transforms |
| active ↔ passive | Values resemble an inverse/transpose; Euler signs are reversed throughout | State whether vectors rotate or bases change, and provide a physical-axis sentinel |
| right ↔ left handed | Mirrored overlays, reversed normals/triangle winding, det=-1, or det=1 after implicit axis flips | Represent every handedness conversion with an explicit matrix; check winding, normals, and image axes |
| xyzw ↔ wxyz | R remains valid, and some special rotations may even be correct by coincidence | Serialize named fields or scalar_first; test identity and an asymmetric sentinel quaternion |
| q ↔ −q | Elementwise quaternion loss / interpolation jumps while the rotation matrix is unchanged | Compare with |qᵀq̂| or an SO(3) geodesic; sequences may be canonicalized while retaining double-cover semantics |
| Euler order | The same three angles produce entirely different orientations; discontinuities near gimbal lock | Record sequence, intrinsic/extrinsic convention, and radians in the API; use Lie / quaternion variables for internal optimization |
| rotation drift | RᵀR drifts from I after long compositions; transposing no longer gives an accurate inverse | Monitor orthogonality and project to SO(3) when needed, while tracing integration / precision causes |
| SVD reflection | Low Umeyama/Kabsch/Procrustes residuals but det=-1 | R=U diag(1,1,det(UVᵀ)) Vᵀ; report whether correction was triggered |
| 4×4 bottom row | The last row becomes zeros, NaN, or perspective terms after deserialization / concatenation | Assert `[0,0,0,1]`, finiteness, shape, and contiguous-memory semantics |
| dtype / tolerance | Errors grow with float32 chains, tiny objects, or large coordinates; default allclose settings misclassify results | Choose atol/rtol by units and task; test shape/dtype and retain float64 for critical calibration and solving |
Prerequisite review: Coordinate systems and rigid transforms, Mathematics & Rigid Geometry, Rotation & Orientation Representations.
04 · Camera Preprocess, Distortion & RGB-D
Treat crop/resize/pad as pixel homogeneous transform A. Raw, undistorted, rectified, network-input, RGB, and depth images occupy different domains.
| Issue | signature | Fix / evidence |
|---|---|---|
| Raw K on a resized tensor | Error grows with pixel distance from the principal point | `p′=Ap, K′=AK`; generate K and the preprocessing manifest from the same source |
| Wrong crop / resize order | A fixed, scale-dependent principal-point offset | Compose pixel-affine transforms in execution order instead of scattering manual cx/cy patches |
| Nonuniform resize | x is largely correct, but y has a systematic offset | Maintain sx/sy separately and update fx/fy/cx/cy |
| Missing pad / letterbox offsets | All points have a fixed padding offset, including near the center | Include padding translation in A; share code between training labels and inverse inference transforms |
| Horizontal flip | 2D labels are flipped without synchronizing 3D pose / object symmetry | Specify image augmentation and its pose action; reflection is not an ordinary SO(3) rotation |
| Mixing raw / undistorted / rectified domains | Good at the center, with radial / tangential edge patterns | Record the distortion model and domain; use K/D or P/R as a consistent set |
| Pixel center / align_corners | Approximately 0.5 px bias after resize round trips, more evident at low resolution | Freeze sampling conventions and library/version; add impulse-grid regression checks |
| 16UC1 / 32FC1 depth | Point clouds are enlarged 1000-fold or drastically shrunk | Encoding + scale determines SI values; BOP depth = raw·depth_scale mm |
| Invalid depth | 0 is treated as the camera center; NaN silently contaminates SVD/ICP | Apply invalid masks before calculations; record valid fractions and the first bad index |
| Unregistered RGB-D | Persistent color/depth edge offsets, stronger on nearby objects | Reproject with depth K and RGB←depth extrinsics, or consume an explicitly registered product |
| Timestamp / rolling shutter | Correct at rest, biased in motion; errors vary along the row direction | Use exposure time, a readout model, and a shared clock; arrival time is insufficient |
| Channel / normalization | Network outputs degrade globally while geometric self-checks remain normal | Record RGB/BGR, range, mean/std, gamma/bit depth; save a checksum of the first-layer input |
Prerequisite review: Camera Models & Imaging Geometry, RGB, RGB-D & Multimodal Pipelines.
05 · CAD, Labels & Dataset Integrity
Version assets, labels, augmentations, splits, and symmetry together. A convincing overlay may simply mean the render mesh and labels share the same error.
A mesh stored in mm is rendered as meters; normalized category shapes are treated as metric
bbox/diameter/range gate + physical ruler sentinelSilhouettes align, but translation/rotation differs from published labels by a fixed transform
Version asset transforms separately; do not alter pose labels to absorb CAD-origin changesMixing render, evaluation, collision, or simplified meshes
Hash each purpose separately; specify the fixed model-to-variant transformVisually equivalent predictions are penalized, or task-critical keys are incorrectly merged
Proper symmetry group + task equivalence; version continuous/discrete samplingAbnormal point-to-plane ICP direction, rendering back-face culling, or reversed suction normals
Recompute / visualize normals; check orientation consistency and face windingSystematic color differences between synthetic templates and real inputs
Include ICC/gamma/linear-sRGB, tone mapping, and texture versions in the manifestImages are cropped/flipped without synchronizing masks/keypoints/poses/K
Apply the same typed transform to all annotations; test round-trip propertiesUnusually high validation scores collapse on new instances / scenes
Group by physical instance/scene/session, check duplicate hashes, and freeze split manifestsEngineering review: Real-world Annotation, Simulation and synthetic data, Symmetry, Ambiguity & Uncertainty.
06 · PnP, Registration & Optimizer Diagnosis
Save input support, inlier masks, candidate sets, initialization, condition spectra, termination reasons, and held-out evidence. Final R/t and one residual cannot reconstruct the investigation.
| Issue | signature | Must retain / isolate |
|---|---|---|
| PnP correspondence | Wrong or duplicate object/image-point indices, or inconsistent coordinate domains | Draw point connections and residual vectors first; check undistortion, K, and object units |
| PnP planar / collinear | Multiple low-reprojection solutions with depth / orientation jumps | Inspect the centered 3D spectrum, retain `solvePnPGeneric` multiple solutions, and add nonplanar / depth / temporal evidence |
| PnP cheirality / mirror | Points behind the camera, or occasional selection of a planar mirror solution | Positive depth for all control points + silhouette/depth/temporal validation |
| RANSAC | Wrong threshold units / pixel domain; high confidence with incorrect inliers | Record sampler/seed/threshold/iterations, inlier masks, and post-refinement residuals |
| Conditioning / scaling | Rotation/translation scale differences make normal equations ill-conditioned | Center/scale data, report singular spectra / κ, and choose appropriate parameterizations and robust losses |
| ICP initial basin | Low RMSE at an incorrect local surface | Global/coarse initialization, overlap/fitness, reverse checks, multiple starts, and independent keypoints |
| ICP correspondence gate | Large thresholds admit background; small thresholds yield 0 correspondences | Sweep thresholds against resolution/noise/initial error; report correspondence counts |
| Point-to-plane normals | Fast planar convergence with unconstrained tangential motion; incorrect normals misdirect updates | normal orientation/scale, Hessian eigenvalues, point-to-point cross-check |
| Symmetry / multi-mode | The solver jumps among equivalent modes; averaging poses yields an invalid intermediate | Output sets/distributions and evaluate in quotient/task space; do not average rotations directly |
| Termination | 'Converged' only because steps are small or iteration limits are reached, while residuals / independent errors remain large | Gate on finiteness, gradient/step, support, held-out evidence, physical closure, and task risk together |
Algorithm review: 2D–3D Correspondences & PnP, 3D–3D Alignment & Point Cloud Registration, Pose Evaluation & Error Analysis.
07 · Time, Runtime & Reproducibility
Throughput is not latency, arrival time is not exposure time, a seed does not ensure full reproduction, and hot updates are not atomic deployments. Every estimate has an age and valid_until.
Per-layer finite gates + sample/stage indices; use explicit status/null in JSON instead of nonstandard NaN
Typed dimensions and strict shape tests; do not let implicit broadcasting conceal errors
Record device/dtype/autocast; compare critical SVD/solves and reductions with float64/FP32 A/B tests
Lock versions/hardware/algorithms; use deterministic mode and repeated replay, accepting performance costs
frame_id + exposure timestamp + sequence; discard expired results and measure end-to-end age
Atomic manifest loading, content hashes, cache namespaces, and cold-start CI
Schema round-trip golden tests; do not depend on object-key ordering
Print resolved configuration + provenance at startup; reject unknown fields instead of silently ignoring them
Immutable messages / copy ownership, sequence assertions, synchronized timing, and race tests
Status enum + reason + valid_until; downstream consumers must explicitly handle abstain/stale/failure
Atomic deployment tuple
release_id = hash(
code_commit, resolved_config, model_arch, checkpoint,
preprocess, camera_intrinsics, distortion/registration,
CAD/eval/collision assets, symmetry metadata,
robot URDF/kinematics, hand-eye, TCP, controller,
libraries/drivers, device/precision, schema version
)
estimate.status ∈ {ok, abstain, no_solution, timeout, stale, invalid_input, runtime_error}System review: Robot Coordinate Transforms & System Calibration, Robotic Grasping & Manipulation.
08 · Debug Views Are Measurement Instruments
Visualization should support investigation as well as demonstration. Enable drill-down to samples, points, edges, stages, and versions. Share data with machine-readable residuals while independently implementing critical projections.
Direction, K, distortion, crop, and coarse pose; cannot reveal all depth-unit / occluded-geometry problems
Depth scale, z translation, occlusion, and RGB-D registration; affected by sensor bias / missing depth
Indices, pixel domains, local bad regions, and RANSAC; mean RMSE hides structure
Scale, origin, handedness, and registration; label the viewer's up/forward conventions too
Wrong frames, stale transforms, duplicate broadcasters; a connected tree does not establish extrinsic accuracy
Narrow the responsible layer from signatures; global means are insufficient
Offset, jitter, stale results, and confusion between throughput and latency
Breaks shared-source data loops; must be independent of the artifact and solver under test
If offsets stay fixed as depth, view, and speed change, check constant edges and pixel offsets first.
Small at the center, large at edges: plot residuals by radial direction.
Separate near/far and pixel/mm domains to avoid projection-induced confusion.
Three A/B comparisons: static–dynamic, forward–reverse, and light–heavy payload.
09 · Test Pyramid, Logging & Regression
Golden truth is independent of the pipeline under test; reduce every production incident to a minimal regression sample. CI runs schema, numerical, static-build, runtime, and representative real-data checks together.
Asymmetric numerical cases, nonzero translations, noncommuting transforms, and failures
Fixed seeds with varied scales / boundaries; shrink counterexamples and add regressions
File hashes + human-reviewed snapshots; ground truth is independent of the current pipeline
Equivariance / invariance tests catch contract bugs better than a single expected number
Align conventions first; retain per-sample evidence of differences alongside means
Real files/message schemas, timestamps, cache cold starts, and failure states
Begin safely at low speed; static/dynamic A/B isolates calibration/timing/control
Derive gates from the deployment envelope; alerts include the owner and a minimal reproduction
Minimum debug record per estimate
sample/instance/task IDs · raw file/message checksums image/depth/K/D/P/preprocess + asset/symmetry hashes all frame edges with timestamp/clock/age/source candidate poses, scores, covariance, inlier/correspondence masks solver method/init/thresholds/iterations/termination/spectrum projection/depth/closure/held-out/task residuals runtime stage timestamps, device/dtype, resolved config/release_id status + first_failure_stage + owner + recovery/action
10 · Incident Playbook & Release Gate
Before release, inject unit, inverse, quaternion, K, depth, reflection, degeneracy, NaN, timing, and cache faults. Confirm that the system blocks them and identifies the correct owner.
Release gate · Before poses enter evaluation or a robot
Preserve the original data without further overwrites.
Establish the deterministic envelope.
Use contracts / invariants / sentinels.
Assign the owner and contain patching to the cause.
Fix the root cause and verify rollback.