Skip to content
This repository was archived by the owner on Oct 18, 2026. It is now read-only.

soc: apple: sep: expand enrollment capture budget to 36 - #17

Merged
chriskearney merged 1 commit into
chriskearney:custom/sepfrom
JJRPF:custom-sep-budget
Oct 4, 2026
Merged

chriskearney merged 1 commit into
chriskearney:custom/sepfrom
JJRPF:custom-sep-budget

Conversation

@JJRPF

@JJRPF JJRPF commented Oct 4, 2026

Copy link
Copy Markdown

Summary

On Apple Silicon M2 Pro (T6020 / J414s), biometric template generation covers edge, center, and tip stages that require 16 to 22 captures to reach 100% template completion.

In 11.32, ENROL_MAX_CAPTURES was left hardcoded to 12 (sep.rs:383). When enrolling on J414s, touches 1 through 11 succeed with enroll-stage-passed, and on touch 12 counter >= 12 triggers ENROL_STATUS_TOO_MANY (sbio.rs:1585), failing the enrollment with enroll-unknown-error.

Changes

  1. Raised ENROL_MAX_CAPTURES from 12 to 36 in drivers/soc/apple/sep.rs.
  2. Added an explicit dev_warn! in drivers/soc/apple/sbio.rs if counter >= ENROL_MAX_CAPTURES ever aborts before completion.

Hardware Validation on J414s (26.0 / iBoot-13822.1.2 / 13.5 key store)

Tested live on MacBook Pro 14" (2023, J414s / apple,t6020 / Mac14,9):

  • Enrolment: Advanced cleanly past touch 12 to 100% completion (enroll-completed).
  • Verification: Instant match on first touch (verify-match).
  • Cold Boot Persistence: Touch ID: restored 1 enrolled identity/identities; enrolment survived reboot.
  • Multi-Finger & Deletion Persistence: Enrolled 2nd finger (right-middle-finger), deleted it via fprintd-delete, and rebooted. Cold boot restored 1 identity; the deleted finger was permanently gone while the primary finger continued to match.
  • s2idle Suspend Cycle: Cycled sleep/resume (PM: suspend entry (s2idle) -> PM: suspend exit), sensor re-registered cleanly at stage 2, instant verification post-wake with zero timeouts.

On M2 Pro (T6020 / J414s), biometric template generation covers edge,
center, and tip stages that require 16 to 22 captures to reach 100%
completion. The previous limit of 12 captures prematurely triggered
ENROL_STATUS_TOO_MANY (reported in userspace as enroll-unknown-error)
after 11 successful touches.

Raise ENROL_MAX_CAPTURES from 12 to 36 and add a warning message if the
budget is exhausted before completion.

Reported-by: Justin Pfister <[email protected]>
Signed-off-by: Justin Pfister <[email protected]>
@chriskearney

Copy link
Copy Markdown
Owner

Thanks @JJRPF, great find, and thank you for all the J414s testing behind it. The 13.5 key store for older firmware, the deletion persistence and the sleep fix in 11.32 all came from your reports on #69 too. Merging.

Root cause, for the record: the driver started with 8 stages and a 12-capture budget. The stage count went to 16 for J414s on Sept 25, but the budget stayed at 12, so it advertised 16 stages and gave up after 12 captures, with partial-contact retries counting against them.

Two follow-ups on top, going into 11.35:

  • ENROL_STAGES 16 → 24, above the 22 captures you measured. Our libfprint driver only reports enroll-stage-passed when the stage number goes up, and with the stage held at 15 until completion, touches 16 to 21 gave no feedback at all. With 24, every accepted touch moves the bar.
  • A static assert tying the budget to the stages: captures ≥ 1.5 × stages, the driver's original ratio, so 24 stages gives your 36. The two can't drift apart again.

If you get a chance, an enrolment on your J414s with 11.35, to confirm the bar moves on every touch, would be great.

@chriskearney
chriskearney merged commit 8125e61 into chriskearney:custom/sep Oct 4, 2026
chriskearney added a commit that referenced this pull request Oct 4, 2026
The previous commit reported 24 stages and asserted that the capture
budget stays at least half again the stage count. Review found that the
assert guards only one direction: it rejects raising the stages alone,
as cdacd96 did, but not raising the budget alone, as #17 did, which
is what left the stage count behind. And with 24 stages and a budget of
36, accepted captures 24 to 35 would again show no progress; 24 is one
more than the most a J414s has needed so far, on one Mac.

Derive the stage count from the budget instead, so every capture the
budget allows can raise the stage and the two cannot drift. An enrolment
that completes sooner, as on the M1, still jumps to the total, from a
smaller fraction. fprintd-enroll, which aurora-touchid-setup and Omarchy
use, prints each touch and draws no bar.

Log an exhausted budget at warning level again, like the no-finger
timeout: both usually come from how the finger is placed. Include how
many captures were accepted, how far the template got and how many were
retried, so a report shows whether the enclave needed more captures or
the contact kept failing.

Link: #17
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
Signed-off-by: Chris Kearney <[email protected]>
@chriskearney

Copy link
Copy Markdown
Owner

@JJRPF this is live in 11.35: https://github.com/iconidentify/aurora-linux/releases/tag/sep-7.1.12.aurora2-11.35

One change from what I said above. Review found that the static assert only guarded one direction, so it would have passed your budget-only bump too, and 24 stages would have stalled again after 23 accepted captures. So the stage count now comes from the budget: 36 stages for 36 captures, one per capture, and the two can't drift apart. If the budget does run out, dmesg now says how many captures were accepted, how far the template got and how many were retries.

If you get a chance, an enrolment on your J414s with 11.35 would be great: fprintd-enroll should print enroll-stage-passed on every accepted touch through to completion. Thanks again for this one, and for everything on #69.

@JJRPF

JJRPF commented Oct 4, 2026 •

Copy link
Copy Markdown
Author

Verification report on J414s (M2 Pro, firmware 26.0 / iBoot-13822.1.2, kernel 11.35)

All tests pass:

Test Case Result
Enrolment (36 captures) enroll-stage-passed on every accepted touch through 100% completion
Verification verify-match immediate on first touch
Cold-boot persistence Touch ID: restored 1 enrolled identity/identities; enrolment survived reboot
Multi-finger & deletion Enrolled 2nd finger, deleted it, rebooted - deleted finger did NOT resurrect; primary still matches
s2idle suspend/wake Clean suspend -> wake, sensor re-registered at stage 2, zero timeouts, verify-match immediately

@iconidentify One small fix was needed in sbio.rs: after CLEAR_STATE during sensor re-registration (bring-up stage 2), the sensor falls back to STATE_NEEDS_PATCH (9). The wake_sensor() path was reading status before registration, so it missed the need to re-apply the patch. Added a post-registration status read + patch re-application; verification now works on first wake after cold boot and after s2idle.

The 36-stage budget (one stage per capture) is perfect - the progress bar advances smoothly on every touch with no silent gaps.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants