Skip to content

docs: de-DICE refactoring plan for the shared audio layer#77

Open
mhellevang wants to merge 3 commits into
mrmidi:mainfrom
mhellevang:docs/dedice-refactor-plan
Open

docs: de-DICE refactoring plan for the shared audio layer#77
mhellevang wants to merge 3 commits into
mrmidi:mainfrom
mhellevang:docs/dedice-refactor-plan

Conversation

@mhellevang

@mhellevang mhellevang commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What

A written plan (DEDICE_REFACTOR.md) for the boundary-leakage problem: DICE leaking into OXFW/BeBoB paths through the shared audio layer. No code changes — plan only, so we can agree on the approach before renames land.

Baseline update

The first version was written against main; it turns out a good chunk of the cleanup already exists on branches that haven't landed (no open PRs against main, so not visible from a plain pull). Rebased the plan on that work:

  • codex/fw-73-neutral-duplex-rename (incl. PR FW-73b Neutral rename of the restart/session vocabulary #67 / FW-73b) already neutralizes the restart/session vocabulary (DuplexRestartReason & co. in Duplex/DuplexRestartSession.hpp, alias veneer gone, AVCAudioBackend clean). Note: FW-73b Neutral rename of the restart/session vocabulary #67 merged into the fw-73 branch, not main — the branch itself hasn't landed.
  • refactor/BeBoB implements the BeBoB_REFACTOR.md plan.
  • The two branches don't include each other, and fw-73 is based on main as of 2026-07-11, so landing both means resolving mechanical conflicts in AudioDuplexCoordinator/AVCAudioBackend.

Phase 0 of the plan is now: land those two branches. Everything else is scoped to what remains after that.

What remains (the actual plan)

  1. Finish recovery/restart cleanup — raw DICE register words (notification/status/extStatus) on the neutral result structs become a protocol-opaque diag struct; DiceRecoveryPolicyStreamRecoveryPolicy (RecoveryPolicyReason/RecoveryDisposition).
  2. TX engineDiceTxStreamEngineAmdtpTxStreamEngine, neutral namespace (it's a generic AMDTP engine in all but name).
  3. Neutral recovery dispatch — new BackendRecoveryEvent + IAudioBackend::HandleRecoveryEvent; the DICE branches in AudioCoordinator move into DiceAudioBackend. Scoped to recovery only, not full lifecycle.
  4. Profile contract — hoist the neutral part of IDiceDeviceProfile (Apogee/BeBoB profiles stop inheriting it); DefaultAmdtpProfile fallback with byte-identical geometry to GenericDiceProfile.
  5. Family homes + enforcementDiceAudioBackend moves into the DICE family; CI boundary check with an explicit composition-root allowlist (factory/coordinator/registry may know all families; shared machinery may not).

Three recovery types fall out: DuplexRestartReason (session cause — done on fw-73b), RecoveryPolicyReason (policy explanation), BackendRecoveryEvent (external events).

Zero wire-observable change intended; only the recovery-dispatch phase carries real regression risk and gets the HW smoke test.

Happy to adjust phases/naming — that's what this PR is for.

Plan for extracting DICE names/types out of the shared audio layer so
device families (DICE, BeBoB, OXFW) stop inheriting DICE plumbing
transitively. Covers restart-vocabulary ownership, mechanical renames
of shared machinery, neutral profile contract/fallback, recovery
dispatch via IAudioBackend, and a CI family-boundary check with an
explicit composition-root allowlist.
FW-73b (codex/fw-73-neutral-duplex-rename) already neutralizes the
restart/session vocabulary, and refactor/BeBoB implements the BeBoB
plan — neither is in main yet. Drop the completed work from the plan,
make landing those branches Phase 0, and rebase the remaining leak
inventory and phases on that baseline.
@mrmidi

mrmidi commented Jul 18, 2026

Copy link
Copy Markdown
Owner

some nice catches here on unfinished work.

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.

2 participants