feat(g4): accept valid alternate physical rest in pose_tolerance (SEMANTICS change — USER sign-off)#41
Open
KE7 wants to merge 1 commit into
Open
feat(g4): accept valid alternate physical rest in pose_tolerance (SEMANTICS change — USER sign-off)#41KE7 wants to merge 1 commit into
KE7 wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary — g4
pose_tolerancealternate-rest acceptance (net-add scoring change)Closes the
living_roommetastable §6pose_toleranceresidual via the RCA-surfacedOption §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 fixedpoint 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:
pos_err ≤ 5 mm AND rot_err ≤ 1°(unchanged); ORposition below tol), upright (env-settled vs canonical ≤ 1°), on its support
(
|Δz| ≤ ¼·object height), in its region (xy drift ≤ object planar half-extent, capped5 cm). Class checked separately; the alt-rest path scores the same body_id.
Acceptance is
STRICT ∪ ALT-REST→ a strict superset → net-add by construction. Everythreshold 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 10living_room / butter(69/73 → 73/73)STRICT OR ALT; empirically confirmed over 1360)pos_err6.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.
tipped(settled orientation > 1° from canonical — a slide-with-tilt,conservatively left flagged). Raising
upright_tol_degwould close more at the cost ofredefining "upright"; kept at 1° = the strict definition (maximally defensible default).
not-converged all rejected (1360/1360 each); converged-valid control accepted (1360/1360).
Implementation
consistency.py—assert_pose_tolerancereportsstrict_pass+ alt-rest verdict/reason;accept_alt_rest=Falserecovers the exact legacy gate (used by the A/B OLD arm).simulator.py— captures a non-contaminating settle-tail convergence signal (net drift ofthe 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— exposessettle_conv_lin/ang+canonical_orientation(theScenic object's own orientation does not coerce for real objects, so upright is measured
env-settled-vs-canonical).
Guards honored
no strict-gate widening. xy bounded to the object footprint.
fixtures = 7.Verification (green from first run)
fall-through, out-of-region, tipped, moving, missing-signal, canonical-upright path).
src/tests/.New g4 definition (crisp, for USER sign-off)
Full write-up:
docs/g4-alt-rest-semantics.md.🤖 Generated with Claude Code