# Tube-sort contact experiments — 22 September 2026

Status: experimental; no contact profile has passed all required situations.
Production contact defaults remain unchanged. The inactive-tube stash reset was
corrected to clear the shelf with the upright tube's axial extent.

## Environment and method

Canonical `mjlab_gs` / MJLab task, MuJoCo 3.11.0 + MuJoCo Warp 3.11.0 GPU
physics. These are not Superdex recordings. Free 16 g Hazel boxes and 10 g hollow
PLA tubes retain source geometry and inertia. No box welds, mass inflation,
automatic resets or state pinning during the tests. Initial conditions are set
once per test. Control period stays 50 ms (20 Hz).

Eight controlled situations per profile: 4/10-tube piles, tube drop, rim drop,
aligned/offset box drop, box push/release, and force-driven tube pull/drop stress.
Every physics substep contributes to peak active-object penetration. Inactive
parked tubes are excluded. Reported ordinary maxima cover box–box, box–tube,
box–room and tube–tube; robot interactions are reported separately in raw data.
The stress pulse lofts a tube roughly 1.2 m above the table and is deliberately
outside normal expert motion; it must not be conflated with an ordinary placement.

The experimental allocation is 8,192 contacts and 32,768 constraints per world.
Early attempts at 8,192 constraints overflowed and were discarded; completed
baseline/hard2 runs are the `_v2` directories. Capacity is held fixed across
completed comparisons. Hard-contact profiles set both sides of contact, including
robot pads and table, to avoid mixing a hard object with a soft counterpart.

## Controlled matrix (40 situations)

| Profile | Step | Contact time constant | Impedance | Ordinary peak | Stress peak | Finite |
|---|---:|---:|---:|---:|---:|---|
| Baseline | 1 ms | Original/mixed | Original | 2.825 mm | 1.661 mm | 8/8 |
| Half timestep | 0.5 ms | Original/mixed | Original | 3.318 mm | 1.756 mm | 8/8 |
| Hard 4 ms | 0.5 ms | 4 ms | 0.99 | 1.417 mm | 1.770 mm | 8/8 |
| Hard 2 ms | 0.5 ms | 2 ms | 0.99 | 0.614 mm | 1.759 mm | 8/8 |
| Hard 2 ms, condim 3 | 0.5 ms | 2 ms | 0.99 | Invalid | 1.757 mm | 6/8 |

The condim-3 profile
removes rotational friction globally while keeping sliding friction; tube-drop
and offset-box-drop become nonfinite, so this profile is rejected regardless of
its finite-case depths. Raw failed-run JSON contains NaN; the summary uses null.

The authored walls are 0.9 mm and floor 1 mm. Hard 2 ms reduces ordinary peak
penetration by about 78%, but high impacts still exceed shell thickness. Its
controlled suite took about 393 s versus 91 s baseline on this machine; this is
instrumented test runtime, not camera-enabled training throughput.

## Extraction tests

Applied force acts only on the upper object, with no robot grasp: compression
0.2 N for 0.25 s, then upward 0.4 N for boxes / 0.2 N for a tube for 0.2 s.
The lower boxes remain free. Extraction rise is measured over the first 0.5 s from pull start. The separate
1 s window includes return impacts; it is not evidence of attachment.

| Situation | Baseline lower-box rise | Hard 2 ms lower-box rise |
|---|---:|---:|
| Aligned nested boxes | 68.47 mm | 68.46 mm |
| Offset nested boxes | 77.60 mm | 0 mm |
| Pressed tube extraction | <0.001 mm | 0 mm |

Harder contacts resolve offset-box coupling, but not aligned nesting. The tube
releases in both profiles. Its baseline 8.09 mm box rise occurs later, on return
impact; the original one-second metric incorrectly grouped that with extraction. During
aligned extraction, live GPU contacts exert approximately 0.20 N downward on the
upper box. A read-only collision query at its recorded 3 s pose finds lower-rim /
upper-wall contacts with about 0.0015–0.0016 mm overlap, and normals about 12.3°
above horizontal. This supports investigating frictional wedging separately from
large penetration. Box sliding friction is 0.6 and is not measured calibration.
The collision model's thickness, radii and panel footprint are estimates, not
manufacturer CAD. Coupling is not by itself proof of a solver defect.

### Lower-friction diagnostic

Keeping hard-2-ms contacts and geometry, lowering only box friction to
`0.1 0.00001 0.000001` releases aligned and offset boxes: lower-box rise is zero
at reported precision over the first 0.5 s, versus 68.46 mm for aligned nesting
at the original friction. The tube control case also releases. This supports
frictional wedging in the aligned case, but the coefficients are uncalibrated.
During the later return collision the offset case launches the lower box
238 mm within the one-second window, with peak box–box depth 2.302 mm and
box–room depth 2.709 mm over the full run. This is not an acceptable production
fix. All three end states are finite.

## Unchanged expert comparison (four 25-second windows)

| Profile | Tube count | Sorted at 25 s | Peak box–tube overlap |
|---|---:|---:|---:|
| Baseline | 4 | 1 | 3.369 mm |
| Baseline | 10 | 2 | 4.750 mm |
| Hard 2 ms | 4 | 1 | 0.999 mm |
| Hard 2 ms | 10 | 1 | 1.050 mm |

All four end states are finite; none completes the sort within this window.
These are matched-seed, unchanged-policy tests, not full-episode success rates.
Hard 2 ms substantially reduces penetration but still reaches/exceeds the
0.9 mm wall thickness during expert actions. It also sorts one fewer tube in the
ten-tube window. Thus the passive-suite improvement does not certify the expert
interaction, and no production contact settings are promoted from this study.
Videos replay the actual recorded poses at 4 Hz; no new physics is integrated.

## Decision and remaining work

Keep the profiles opt-in and retain the explicit failures. The matrix rules out
halving the timestep alone as a sufficient fix and rejects global condim-3
contacts. Stiffer contacts are useful, but require further impact/contact-geometry
validation and robot-motion tests before adoption. Measure box–box friction and
check the estimated rim/wall geometry against the physical asset; do not tune
friction solely to make nested boxes release. A future smaller-step experiment
should target the high-speed impacts and expert contact peaks specifically.
The box masses/free joints must remain intact throughout that work.

Validation: 46 existing targeted tube-sort/bin-pick tests passed; the extended
profile configuration suite passed 7 tests after adding the friction diagnostic.
The only production reset fix clears inactive upright tubes from the stash shelf.

## Backend comparison

At six identical saved failure poses, CPU MuJoCo and Warp collision depths agree
to about 0.0001 mm. This does not validate full dynamic equivalence, but does not
support blaming a GPU-specific collision-detection error in those samples.
See backend_comparison.json and ../tubesort_contact_audit/RESEARCH.md for evidence
and official MuJoCo documentation/forum references. NoSlip is not supported by
the installed Warp backend; enabling it is not a runnable fix here.

## Reproduction

From /home/sudhir/mjlab_gs, source env.sh before commands:

```sh
python scripts/test_tubesort_contacts.py --profile hard2 --device cuda:0 --output reports/new_contacts
python scripts/test_tubesort_contact_release.py --profile hard2 --device cuda:0 --output reports/new_release
python scripts/test_tubesort_expert_contacts.py --profile hard2 --steps 500 --device cuda:0 --output reports/new_expert
python scripts/render_tubesort_contact_comparison.py --run reports/new_expert --output reports/new_expert/media --device cuda:0
```

Each run saves results.json and poses.npz. Controlled/release runs additionally
save timelines; release runs save sampled GPU contact loads. Videos are rendered
from recorded poses without integrating new physics.
