Skip to content

feat(perf): zc_confirm_reject counter — perf struct v3#28

Merged
AlexKlimaj merged 1 commit into
ark-releasefrom
feat/zc-confirm-reject-counter
Jul 6, 2026
Merged

feat(perf): zc_confirm_reject counter — perf struct v3#28
AlexKlimaj merged 1 commit into
ark-releasefrom
feat/zc-confirm-reject-counter

Conversation

@AlexKlimaj

Copy link
Copy Markdown
Member

The instrumentation salvaged from #23 (per its bench verdict), without any of the blanking: a monotonic counter on the zero-cross confirm loop's reject path, giving live visibility into the #21 glitch-tolerant confirm. Δreject/Δzc_count over a window = rejected comparator edges per accepted commutation — rare in clean running, balloons under real noise — so "the tolerance is working" becomes a measurement instead of an inference.

Contents

  • Firmware: hwci_perf struct v3 (84 B) — one u32 (zc_confirm_reject, offset 80) appended after the v2 jitter block, host_cmd frozen at 60 per the versioning contract. HWCI_PERF_CONFIRM_REJECT() fires on the F051 tolerant loop's early-out and the generic strict-loop reject; compiles to nothing without HWCI_PERF. Production builds byte-identical.
  • Host: v1/v2/v3 decode (with a compiled v2-ELF regression fixture, same pattern as v1's), perf_zc_confirm_reject CSV column, confirm_rejects_per_zc per steady point (report-only, None on pre-v3 firmware), sim support.
  • 131 offline tests pass (6 new); instrumented + production ARK_4IN1_F051 builds clean.

Version bookkeeping

⚠️ This claims v3 at offset 80 (size 84). PR #24 (demag compensation) also drafts a v3 at offset 80 — after this merges, #24 should rebase its fields to offset 84+ and bump to v4.

Not bench-tested per @AlexKlimaj — instrumentation-only, no behavioral change, and the identical counter ran on the bench inside #23's builds during the A/B session without issue.

🤖 Generated with Claude Code

Salvaged from the refuted PWM-blanking PR (#23): a monotonic counter on
the zero-cross confirm loop's reject path, the live monitor for the F051
glitch-tolerant confirm (#21). delta(reject)/delta(zc_count) over a
window = rejected edges per accepted commutation - rare in clean
running, balloons under real comparator noise, so it turns 'the
tolerance is working' from an inference into a measurement.

Struct v3 (84 B): one u32 appended after the v2 jitter block; host_cmd
stays frozen at offset 60. Host decodes v1/v2/v3 (compiled v2-ELF
regression fixture included); confirm_rejects_per_zc reported per steady
point (report-only). Counter increments on both the F051 tolerant
early-out and the generic strict-loop reject, compile-gated to nothing
in production builds.

Co-Authored-By: Claude Fable 5 <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