Skip to content

Trig-free sector decode for snyder_inv_xyz: 1.27x measured, held pending accuracy-envelope decision #68

Description

@asinghvi17

Status: prototyped and measured, deliberately NOT landed. On hold by decision 2026-08-21.

The closed-form azimuth solve for snyder_inv_xyz (branch claude/snyder-closed-form, commit e0ac311) has an optional follow-up: replace the input decode's atan2 + sincos(Azps) with half-plane sign tests plus an exact ROT_SECTOR rotation of w. It was fully prototyped and benchmarked, and held for the reasons below — recorded here so the decision can be revisited with evidence instead of redone.

Measured (real level-12 corpus, 120,060 (f,w) pairs)

kernel ns/call
Newton (superseded) 220.9
closed form (shipped on the branch) 120.5
+ trig-free decode, sqrt(x²+y²) for ρ 84.6
+ trig-free decode, hypot for ρ 94.9

Why it's held

  1. Exceeds the approved output-change envelope. Cumulative deviation from the Newton-era kernel is 1.255e-14 on real data, but 1.722e-14 on a full-circle sweep including fringe radii — past the ≤1.62e-14 envelope approved for the closed-form change. Adopting it is a new accuracy decision (propose re-approving the fringe envelope at 2e-14).
  2. Sector-ray sensitivity is structural. IGeo7 corner offsets are exact Eisenstein arithmetic, so real lattice points land exactly on ±120° sector rays; atan2 and the sign tests round a band of near-ray inputs into different sectors (20 mismatches in the 120,060-pair real corpus; 81/486 on exact rays). Measured to be benign — the sector fold is self-consistent, max ‖dxyz‖ across mismatching real points 9.37e-16 — but this equivalence should be pinned by a dedicated test if the decode lands, not just measured once.
  3. Underflow trap in the fast variant. The sqrt(x²+y²) form underflows for |w| < ~1.5e-162 → division by zero → NaN vector. Unreachable from current lattice scales, but a trap. The hypot form is immune and costs 10.2 ns of the 35.9 ns win.

If picked up later

Take the hypot variant (94.9 ns, 1.27× on top of the closed form), re-approve the fringe deviation envelope to 2e-14, and add a test pinning the on-ray fold equivalence.

Full measurements and the prototype code: regrid-notes/2026-08-21-snyder-impl.md §8 (workspace notes) and the scratch harness referenced there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AC7rbi9eqZypWseMjBGSJ2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions