Skip to content

feat(g4): accept valid alternate physical rest in pose_tolerance (SEMANTICS change — USER sign-off)#41

Open
KE7 wants to merge 1 commit into
mainfrom
fix/g4-alt-rest-scoring
Open

feat(g4): accept valid alternate physical rest in pose_tolerance (SEMANTICS change — USER sign-off)#41
KE7 wants to merge 1 commit into
mainfrom
fix/g4-alt-rest-scoring

Conversation

@KE7

@KE7 KE7 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary — g4 pose_tolerance alternate-rest acceptance (net-add scoring change)

Closes the living_room metastable §6 pose_tolerance residual via the RCA-surfaced
Option §3c (a scoring change), NOT a data/gate/resampler hack. This changes what g4
certifies for the paper
, so it is intentionally scoped for USER sign-off before merge
EA can verify mechanically but must not merge on verification alone.

Chosen semantics (definition b — physical-rest validity), and why

The strict gate pos_err ≤ 5 mm AND rot_err ≤ 1° demands the settled pose be an exact fixed
point
of the emitted pose. RCA (g4_fixed_point_settle.md §3, g4_metastable_residual.md §6)
showed a deterministic tail of tall/multi-face objects settling into a genuine second energy
minimum
— upright, on-support, in-region, but a few mm past the 5 mm gate; iterating the
settle does not relax them. "Placed correctly" is a statement about the rest configuration,
not about the settle being a numerical fixed point of the emitted xy.

A settled object now passes iff EITHER:

  • STRICTpos_err ≤ 5 mm AND rot_err ≤ 1° (unchanged); OR
  • ALTERNATE REST — all of: at rest (net drift of the vibration-averaged settle-tail
    position below tol), upright (env-settled vs canonical ≤ 1°), on its support
    (|Δz| ≤ ¼·object height), in its region (xy drift ≤ object planar half-extent, capped
    5 cm). Class checked separately; the alt-rest path scores the same body_id.

Acceptance is STRICT ∪ ALT-REST → a strict supersetnet-add by construction. Every
threshold is anchored to the object's own measured geometry (asset-registry dims) or the
existing rotation tol — none tuned to the tail.

Rejects (never a mask), each with an explicit reason: fall-through/wrong-support
(off_support), out-of-region (out_of_region), tipped (tipped), moving (not_converged),
missing data (conservative decline → strict only).

OLD-vs-NEW A/B — scripts/ab_g4_altrest.py, 1360 objects, 4 arenas, position+object, seeds 10

metric value
OLD (strict) pass 1348 / 1360 (99.12%)
NEW (strict ∪ alt-rest) pass 1352 / 1360 (99.41%)
FAIL→PASS (closed tail) 4 — all living_room / butter (69/73 → 73/73)
PASS→FAIL 0 (guaranteed by STRICT OR ALT; empirically confirmed over 1360)
  • Closed tail: butter (multi-face stick) settling on a secondary flat face ~7 mm lower —
    pos_err 6.9–7.4 mm, all on z (dz ≤ 10 mm ¼-height band), xy ≤ 1 mm, upright 0.001–0.48°,
    converged (2.3 mm / 0°). A textbook valid alternate physical rest.
  • 8 residual fails all tipped (settled orientation > 1° from canonical — a slide-with-tilt,
    conservatively left flagged). Raising upright_tol_deg would close more at the cost of
    redefining "upright"; kept at 1° = the strict definition (maximally defensible default).
  • Injected-bad rejection (per object, 1360×): fall-through / out-of-region / tipped /
    not-converged all rejected (1360/1360 each); converged-valid control accepted (1360/1360).

Implementation

  • consistency.pyassert_pose_tolerance reports strict_pass + alt-rest verdict/reason;
    accept_alt_rest=False recovers the exact legacy gate (used by the A/B OLD arm).
  • simulator.py — captures a non-contaminating settle-tail convergence signal (net drift of
    the vibration-averaged body position over the last 10 settle steps; a live qvel read is vacuous —
    velocities are zeroed after settle). Scored pose byte-identical to before.
  • gym_env.get_object_state — exposes settle_conv_lin/ang + canonical_orientation (the
    Scenic object's own orientation does not coerce for real objects, so upright is measured
    env-settled-vs-canonical).

Guards honored

  • NET-ADD only — 0 pass→fail over 1360 objects. No resampler change, no data forcing,
    no strict-gate widening. xy bounded to the object footprint. fixtures = 7.

Verification (green from first run)

  • Tier-1 pytest 194/194 (incl. 30 consistency tests: closed-tail + explicit negatives —
    fall-through, out-of-region, tipped, moving, missing-signal, canonical-upright path).
  • validation-smoke G0–G3 6/6 pass. ruff + ruff-format + black clean on src/ tests/.

New g4 definition (crisp, for USER sign-off)

A settled object passes g4 pose_tolerance if it matches the emitted pose within 5 mm / 1°
(unchanged), or if it is a valid alternate physical rest — at rest, upright (≤ 1° from
canonical), on its intended support (Δz ≤ ¼ of its own height), and within its own footprint of
the sampled xy — while rejecting fall-through, out-of-region, tipped, wrong-object, and
still-moving settles with explicit reasons. It changes what g4 certifies from "the settle is an
exact fixed point of the emitted pose" to "the object came to rest, correctly placed on its
support, in its region, upright."

Full write-up: docs/g4-alt-rest-semantics.md.

🤖 Generated with Claude Code

…antics change, net-add)

Close the living_room metastable §6 pose_tolerance residual with a SCORING
change (RCA-surfaced Option §3c): admit a settle that is a genuine, deterministic
SECOND energy minimum — upright, on its support, in its region, converged — even
when it misses the strict 5mm/1° exact-fixed-point gate.

New semantics (accept iff EITHER):
  * STRICT  — pos_err ≤ 5mm AND rot_err ≤ 1°  (unchanged), OR
  * ALT-REST — all of: AT REST (net drift of the vibration-averaged settle-tail
    position below tol), UPRIGHT (env-settled vs CANONICAL ≤ 1°), ON SUPPORT
    (|Δz| ≤ ¼·object height), IN REGION (xy drift ≤ object planar half-extent,
    capped 5cm). Class checked separately; same body_id ⇒ never a wrong object.

Because acceptance is STRICT ∪ ALT-REST it is a strict superset ⇒ guaranteed
NET-ADD (0 pass→fail). Every threshold is anchored to the object's own MEASURED
geometry (asset registry dims) or the existing rotation tol — none tuned to the
tail. Rejects (each with an explicit reason): fall-through/wrong-support
(off_support), out-of-region (out_of_region), tipped (tipped), moving
(not_converged), missing data (conservative decline → strict only).

Implementation:
  * consistency.py: assert_pose_tolerance reports strict_pass + alt-rest
    verdict/reason; accept_alt_rest=False recovers the exact legacy gate.
  * simulator.py: capture a non-contaminating settle-tail convergence signal
    (net drift of the vibration-averaged body position over the last 10 settle
    steps — a live qvel read is vacuous, velocities are zeroed) — scored pose
    byte-identical to before.
  * gym_env.get_object_state: expose settle_conv_lin/ang + canonical_orientation.

A/B (scripts/ab_g4_altrest.py, 1360 objects, 4 arenas, position+object, seeds 10):
  OLD 1348/1360 → NEW 1352/1360; FAIL→PASS=4 (living_room butter secondary flat
  rest, 69→73/73); PASS→FAIL=0; 8 residual correctly rejected as tipped (>1° from
  canonical). Injected fall-through/out-of-region/tipped/not-converged all
  rejected (1360/1360 each); converged-valid control accepted (1360/1360).

No resampler change, no data forcing, no strict-gate widening; fixtures=7. New
tests pin the closed tail + explicit negative tests (fall-through, out-of-region,
tipped, moving, missing signals) and the canonical-upright path. Tier-1 pytest,
validation-smoke, ruff+black all green. Semantics + A/B in
docs/g4-alt-rest-semantics.md — USER sign-off required before merge (this changes
what g4 certifies for the paper).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant