Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
f424bce
Update README to clarify systemextensionsctl usage
mrmidi Nov 9, 2025
302c2d7
Clean up README by removing question
mrmidi Nov 12, 2025
dccafe6
Public snapshot: bing-bang refactor, git repo structure update, etc
mrmidi Nov 20, 2025
eb45050
Delete AGENTS.md
mrmidi Nov 20, 2025
69827e7
Compact logging refactor and AT descriptor-block handling fixes
mrmidi Nov 22, 2025
512cc50
Public snapshot: working async stack, isoch TX DMA, AV/C/CMP, and IRM
mrmidi Jan 8, 2026
1b2dc82
Revise Isoch stack README for clarity and updates
mrmidi Jan 9, 2026
d729c3e
Working stereo audio playback, full isoch RX/TX pipeline, CoreAudio i…
mrmidi Feb 10, 2026
2960f2d
fix: SIGBUS crash on ARM64 block reads due to DMA buffer alignment
gly11 Feb 11, 2026
e41a1fa
fix: add alignas(4) to payloadCopy for strict quadlet alignment guara…
gly11 Feb 11, 2026
75a35e1
Modular isoch audio pipeline, Duet support, TX verification, and cloc…
mrmidi Feb 22, 2026
f6a0af1
Config ROM overhaul: correct BIB parsing, async ROM scan, double-comp…
mrmidi Feb 22, 2026
a797e08
Audio: split DICE vs AV/C backends; blocking AMDTP; reuse isoch DMA
mrmidi Feb 23, 2026
61dc95f
ASFW: refactor ROM explorer
mrmidi Feb 23, 2026
9625956
Chore: ignore xcuserdata and build-codex
mrmidi Feb 23, 2026
8a82101
Harden isoch queue lifetime and hot-unplug teardown
mrmidi Feb 24, 2026
d861579
Update audio channel clamp tests for new policy
mrmidi Feb 24, 2026
8d95e6e
Async pipeline: propagate rCode and add forced block ops
mrmidi Feb 25, 2026
a765cbe
Swift debug tools: block read/write UI and Saffire app-base fix
mrmidi Feb 25, 2026
314a182
ROM scanner: refactor detail discovery and add host completion tests
mrmidi Feb 25, 2026
1b2536d
IsochReceiveContext: fix raw new without RAII (cpp:S5025)
mrmidi Feb 25, 2026
b8a0678
Replace strncpy with strlcpy and use default member initializers
mrmidi Feb 25, 2026
712118a
ROMScanner: pass default ROMScannerParams in Start() and fix PendingR…
mrmidi Feb 25, 2026
4f5f061
ObserverGuard: fix destructor exception safety and dangling reference…
mrmidi Feb 25, 2026
17879ff
crc32 mock: replace unary minus on unsigned with explicit mask (S876)
mrmidi Feb 25, 2026
2767675
Fix cpp:S3923: suppress false positives and eliminate real branch dup…
mrmidi Feb 25, 2026
0be61ae
Isoch backends: use OSSharedPtr for IOBufferMemoryDescriptor (S5025)
mrmidi Feb 25, 2026
cbaab7c
build.sh: use -destination instead of -arch for xcodebuild invocations
mrmidi Feb 25, 2026
80ae69e
Fix cpp:S3923: suppress 2 remaining false positives (log-only branches)
mrmidi Feb 25, 2026
533e94e
CI: bump sonarqube-scan-action to v7, pin to full commit SHA
mrmidi Feb 25, 2026
9057190
Maintainability: quick wins — S5028/S5421 NOSONAR, S1186 stub comment…
mrmidi Feb 25, 2026
a747a7e
Refactor S5028: replace macros with constexpr/enum in TX profiles and…
mrmidi Feb 25, 2026
6b2b150
Isoch: consolidate audio stream config
mrmidi Feb 25, 2026
94e99f3
tech debt: configg rom classes refactor
mrmidi Feb 27, 2026
e87db34
ConfigROM: rewrite + bootstrap quality tooling
mrmidi Mar 2, 2026
897f938
ConfigROM: modularize ROMScanSession; expected parser; IRM verify
mrmidi Mar 2, 2026
76b55b4
Checkpoint: ConfigROM de-spaghetti baseline
mrmidi Mar 2, 2026
9fe6f64
ConfigROM: docs polish + clang-tidy cleanups
mrmidi Mar 2, 2026
7ea2e77
ConfigROM: de-spaghetti details discovery
mrmidi Mar 3, 2026
f786385
Async: enforce bus contract (gen gate + cancel)
mrmidi Mar 4, 2026
3da0b51
Protocols: depend on IFireWireBusOps (drop AsyncSubsystem coupling)
mrmidi Mar 4, 2026
7a78c38
Discovery: unify generation type (use FW::Generation)
mrmidi Mar 4, 2026
21e2355
Refactor: split Async/Controller/BusReset god files into TUs
mrmidi Mar 4, 2026
ef3f165
Protocols: decouple FCPResponseRouter from Async Rx
mrmidi Mar 5, 2026
a6ffe17
Refactor: checkpoint async cleanup and bus-reset hardening
mrmidi Mar 7, 2026
71db585
Bus: finalize reset recovery and gap optimization
mrmidi Mar 7, 2026
493d02d
Merge pull request #4 from mrmidi/codex/stack-despaghetti
mrmidi Mar 7, 2026
4a67194
Fix analysis findings and prepare local Sonar runs
mrmidi Mar 8, 2026
1b1d09f
Merge pull request #5 from mrmidi/codex/clang-analysis-fix-sweep
mrmidi Mar 8, 2026
44a7721
Some dice experiments
mrmidi Mar 14, 2026
9932cd7
Merge pull request #3 from gly11/fix/block-read-arm64-alignment
mrmidi Mar 20, 2026
f45814c
Fix AR receive boundary handling on ARM64
mrmidi Mar 20, 2026
a001ddd
FW: extract shared wire-format and serialization helpers
mrmidi Mar 20, 2026
9ec644f
Async: harden AR matching and DICE notification routing
mrmidi Mar 20, 2026
b48b2fe
DICE: split generic TCAT bring-up from Focusrite extensions
mrmidi Mar 20, 2026
5f2df24
tools/pydice: add strict phase-0 parity tooling
mrmidi Mar 20, 2026
be21166
Audio: refresh ASFWAudioNub queue geometry from published properties
mrmidi Mar 20, 2026
a6f5826
Isoch: RX-seeded SYT generation for DICE playback audio
mrmidi Mar 23, 2026
e0d6c92
DICE: active clock polling (ASF-98) + per-packet SYT phase discipline…
mrmidi Mar 23, 2026
f5fd9cc
ASF-99 expand Focusrite Saffire DICE model support
mrmidi Mar 23, 2026
14ea68c
docs: refresh README and add Saffire testing guidance
mrmidi Mar 23, 2026
e6a58cd
Update Discord server link in README
mrmidi Apr 11, 2026
864fc13
DICE: implement robust duplex restart coordinator and isochronous pri…
mrmidi Apr 13, 2026
805e8ec
WIP timing investigation and transport clock plumbing
mrmidi Apr 13, 2026
0139802
fix: derive config rom node capabilities from active features
gly11 Apr 15, 2026
6976a87
Merge pull request #7 from gly11/fix/config-rom-1394a-capabilities
mrmidi Apr 17, 2026
e3ee4b6
fix(async): use 16-bit bus generation end-to-end
gly11 Apr 23, 2026
dac7301
fix(async): normalize ack handling and completion scanning
gly11 Apr 23, 2026
744b945
fix(bus): restore cycleMaster and support short/long reset
gly11 Apr 22, 2026
410269f
feat(sbp2): detect units and management agent offset
gly11 Apr 23, 2026
08f7610
feat(sbp2): add address-space plumbing
gly11 Apr 23, 2026
8daafc0
feat(sbp2): add address-space auto allocation
gly11 Apr 23, 2026
22e7b42
feat(sbp2): add ORB wire primitives
gly11 Apr 23, 2026
1b6439f
Audio: implement structured Timing Model and startup alignment
mrmidi Apr 28, 2026
e94b3c0
Merge pull request #9 from gly11/fix/async-bus-foundations
mrmidi Apr 30, 2026
427f648
chore(ci): allow fork PR builds without signing secrets
gly11 Apr 30, 2026
83b1c8b
fix(driver): remove exception use from observer guard
gly11 Apr 30, 2026
9c0a2da
test(ci): tolerate missing optional reference inputs
gly11 Apr 30, 2026
77c5e32
fix(dice): bind Alesis MultiMix active stream profile
boggspa May 1, 2026
31d9bf4
diag(dice): log TCAT runtime-cap discovery
boggspa May 1, 2026
f005fd8
Merge pull request #10 from gly11/feat/sbp2-orb-primitives
mrmidi May 4, 2026
31c784e
fix(foundation): extract async discovery and bus reset fixes
gly11 May 26, 2026
2b39cc4
fix(configrom): guard node ROM fallback by GUID
gly11 May 27, 2026
f693d99
docs(async): clarify AR packet view comments
gly11 May 27, 2026
b66b488
docs(bus): identify recovery reason codes
gly11 May 27, 2026
4c2c155
Merge pull request #18 from gly11/pr/foundation-async-discovery
mrmidi May 27, 2026
1ad37d4
fix(ci): isolate LLVM profile outputs
gly11 May 27, 2026
2864d80
fix(ci): cover test discovery profiles
gly11 May 27, 2026
a409340
Merge pull request #20 from gly11/fix/ci-unique-llvm-profile
mrmidi May 28, 2026
57fc993
Merge remote-tracking branch 'origin/main' into DICE
mrmidi May 28, 2026
52c40f8
feat(configrom): clear bmc in local Bus_Info_Block advertisement (FW-11)
mrmidi May 28, 2026
1b2bde8
test(configrom): cover NormalizeLocalBusOptions bmc policy (FW-11)
mrmidi May 28, 2026
7e41b48
feat(bus): add RoleCoordinator skeleton — pure policy + thin actor (F…
mrmidi May 28, 2026
ab75042
test(bus): cover RoleCoordinator skeleton — policy + actor (FW-6)
mrmidi May 28, 2026
b870926
feat(bus): wire cycle evidence and root stabilization
mrmidi May 28, 2026
d492358
Implement root capability role policy
mrmidi May 29, 2026
7d4e3d3
chore: save current work on ASFWDriver and tests before implementing …
mrmidi May 29, 2026
3c5e91f
Add 1394 Diagnostics Cockpit V0 backend (ASFWDriver)
mrmidi May 29, 2026
dc774f2
Implement 1394 Diagnostics Cockpit V0 frontend and tests
mrmidi May 29, 2026
21d3777
Fix OSData packing in DiagnosticsHandler by using OSData::withBytes d…
mrmidi May 29, 2026
5af18a6
Scale down diagnostics structures to keep payloads under 4KB (Topolog…
mrmidi May 29, 2026
1c25496
Revert static limits back to original values and implement dynamic, v…
mrmidi May 29, 2026
d0abcc3
Diagnostics Cockpit V1: fix the 4KB struct limit, correct decode/sema…
mrmidi May 29, 2026
ab7f7b3
Merge pull request #12 from boggspa/pr/alesis-multimix-stability
mrmidi May 29, 2026
4aa28f5
Merge pull request #13 from boggspa/pr/dice-init-diagnostics
mrmidi May 29, 2026
0680429
Merge remote-tracking branch 'origin/DICE' into DICE
mrmidi May 29, 2026
6eb7bc9
swift text formatter fixes for 1394 diagnostincs view
mrmidi May 29, 2026
cabf2b8
FW-22/FW-19: capability modes + central CSR/local-request dispatch
mrmidi May 29, 2026
3f03926
FW-19/FW-22: resolve peer review feedback for capability modes, gener…
mrmidi May 29, 2026
a9de550
FW-20: Implement TOPOLOGY_MAP service + FW-18: BUS_MANAGER_ID electio…
mrmidi May 29, 2026
8d3d593
Fix DriverKit mutex constraints and RegisterRequestHandler lambda sig…
mrmidi May 29, 2026
8178621
Fix BM election compare-swap destination, improve DMA mirror synchron…
mrmidi May 29, 2026
b669031
FW-14: Bus Manager & IRM role pipeline (Pass 1–6)
mrmidi May 29, 2026
71166b9
FW-14: Implement post-review safety and deadlock fixes for Bus Manage…
mrmidi May 29, 2026
a51543c
FW-14: Clean up TopologyMapService locking contract, clear inFlight_ …
mrmidi May 29, 2026
2450f9d
Implement FW-14 Phase 2: Safe FullBusManager Observe/Election Mode
mrmidi May 30, 2026
dad3b39
Address review comments on Bus Manager pipeline
mrmidi May 30, 2026
4dfa1ae
Add capability mode test for FullBusManager + ObserveOnly
mrmidi May 30, 2026
0f6f037
FW-21: Apple-compatible default role policy — CMC diagnostics-only, g…
mrmidi May 30, 2026
d4387ce
FW-21: wire RoleCoordinator activity gate to config; harden bus-optio…
mrmidi May 30, 2026
6529b86
Rename RoleMode::AppleAvoidManager -> ClientOnly
mrmidi May 30, 2026
6fe0f3d
Remove dead ControllerConfig::supportedSpeeds field
mrmidi May 30, 2026
ac60344
Construct ServiceContext (placement-new) — fix uninitialized config d…
mrmidi May 30, 2026
16471f5
Split immutable identity vs runtime role policy; add ApplyRolePolicy …
mrmidi May 30, 2026
16f26ab
Diagnostics report: fix uptime label, show loaded driver build, clari…
mrmidi May 30, 2026
d4cd6d3
Topology V2: Modular Annex P reconstruction & local normalization
mrmidi May 30, 2026
972c308
Fix ARM64 alignment fault (EXC_ARM_DA_ALIGN) in DMA packet parsing
mrmidi May 30, 2026
7dbf196
Topology: unify on ASFWDiagNode ABI; diameter gap-count; tree view
mrmidi May 30, 2026
07c6c8c
Topology text-report tree parity + concurrency threading contract
mrmidi May 30, 2026
63ae729
Fix stack overflow rendering diagnostics topology tree
mrmidi May 31, 2026
7265324
Diagnostics report accuracy cleanup
mrmidi May 31, 2026
3ac4ca0
IRM reorganization and OHCI CAS sequence fix
mrmidi May 31, 2026
3a74e9b
Lock down CSRControl write order with regression tests
mrmidi May 31, 2026
d8ebd24
Add Linux and Apple cross-validation references to IRM constants
mrmidi May 31, 2026
c5bc616
Implement unified OHCI initial IRM register programming
mrmidi May 31, 2026
0901832
Add LocalCSRAccessor thin wrapper for IRM CSRs
mrmidi May 31, 2026
7987e8a
Extract BroadcastChannelCSR logic from CSRResponder
mrmidi May 31, 2026
dfd02f6
Refactor LocalIRMResourceController into a state machine
mrmidi May 31, 2026
4396b1a
Rename IRMServerOnly to IRMResourceHost
mrmidi May 31, 2026
d6d4351
Wire IRM Resource Host into controller lifecycle
mrmidi May 31, 2026
2347a3d
Enhance IRM hosting diagnostics
mrmidi May 31, 2026
ae4011d
Complete Milestone 1: IRMResourceHost implementation
mrmidi May 31, 2026
37672e8
Add post-reset timing core types and constants
mrmidi May 31, 2026
a180bb0
Add PostResetTimingCoordinator gate logic and ISO allocation guard
mrmidi May 31, 2026
d1ba3af
Add PostResetTiming host tests
mrmidi May 31, 2026
9449ec0
Anchor post-reset timing gates in the bus-reset FSM
mrmidi May 31, 2026
f9b4649
Expose post-reset timing in diagnostics (ABI v4)
mrmidi May 31, 2026
60769a2
Render Post-Reset Timing section in the diagnostics app
mrmidi May 31, 2026
f98c2cb
bugfix
mrmidi May 31, 2026
3673053
Milestone 3 Phase 1: Bus Manager Election safety and timing integration
mrmidi May 31, 2026
dc00d14
Milestone 3 Phase 2: Enhanced diagnostics and forbidden action gating
mrmidi May 31, 2026
87264a1
license bumb
mrmidi May 31, 2026
6d4933d
Milestone 3: Hardened deferred election and old value validation
mrmidi May 31, 2026
52f8a68
Fix Swift compilation error and finalize Milestone 3 diagnostics polish
mrmidi May 31, 2026
0742e9f
Finalize Milestone 3 diagnostics polish and hardening
mrmidi May 31, 2026
0c5a9b6
Milestone 3 Hardening: Deferred policy checks, clock injection, and f…
mrmidi May 31, 2026
459ef9a
Complete Milestone 4: IRM Fallback Detector + Cycle Policy Planner
mrmidi May 31, 2026
2adc8d2
Hardening Milestone 1-4: Order fixes, abstraction restoration, and ve…
mrmidi May 31, 2026
fb9e637
Milestone 5 Phase 1: Activity ladder update and passive ObserveOnly
mrmidi May 31, 2026
e8e06d9
Milestone 5 Phase 2: Hardware helpers for cycle master control
mrmidi May 31, 2026
cb04bed
Milestone 5 Phase 3: Pure cycle policy planner
mrmidi May 31, 2026
82e1a8f
Milestone 5 Phase 4: Cycle policy execution and integration
mrmidi May 31, 2026
53a1b0a
Finalize Milestone 5: Cycle Master Policy implementation and hardening
mrmidi May 31, 2026
ad301fb
Milestone 5: Update diagnostics size assertions for ABI v7
mrmidi May 31, 2026
e3ee4f7
ConfigROM: replace Nikon quirk with spec-compliant scan
mrmidi May 31, 2026
7a45109
Milestone 6: Root Selection / Force-Root Policy implementation
mrmidi May 31, 2026
4455a16
Milestone 6 Final Hardening: Single mutation ownership and evidence p…
mrmidi May 31, 2026
6f3bd56
Milestone 7: Gap Count Optimization and Milestone 6 Final Hardening
mrmidi May 31, 2026
22142e5
Hardening Milestone 5-7: Single mutation ownership, evidence purity, …
mrmidi May 31, 2026
2cf9c7b
Restore Milestone 8: Power Management / Link-On Policy
mrmidi May 31, 2026
19a24f8
Milestone 8 Final Hardening: Integration and sequencing fixes
mrmidi May 31, 2026
5597bde
Milestone 9: CSR Compliance, SPEED_MAP, and Final BM Register Contract
mrmidi Jun 1, 2026
4a2f20c
Fix build issues in Milestone 9: resolve incomplete types and missing…
mrmidi Jun 1, 2026
3e59ee2
Fix log labels and indentation in HardwareInterface. Corrected 'PHY G…
mrmidi Jun 1, 2026
3b6b070
Optimize PowerLinkPolicyCoordinator: avoid redundant topology scans
mrmidi Jun 1, 2026
64f3897
Milestone 9: Add authoritative CSR ownership contract table. Definiti…
mrmidi Jun 1, 2026
334287f
Hardening Milestone 9: Authoritative CSR Contract alignment and singl…
mrmidi Jun 1, 2026
79c089e
Review BM/IRM compliance fixes in progress
mrmidi Jun 1, 2026
31a9026
Fix diagnostics formatter stack overflow; split god file into sections
mrmidi Jun 1, 2026
bffe085
Fix bus timing and enable BM IRM validation
mrmidi Jun 1, 2026
57da541
Stabilize BM IRM review path
mrmidi Jun 1, 2026
1f30f1d
Document BM yield review findings
mrmidi Jun 1, 2026
873e65f
Harden OHCI hardware compliance review
mrmidi Jun 2, 2026
c0e97ec
driver/bus: Refine cycle policy and clarify IRM CSR ownership model
mrmidi Jun 2, 2026
f19d2d2
discovery/deviceprofiles: extract audio identity metadata into Device…
mrmidi Jun 2, 2026
614f4e5
Review BM power link policy
mrmidi Jun 2, 2026
45d3878
Expose BM power budget diagnostics
mrmidi Jun 2, 2026
ed4d46e
Polish BM diagnostics wording
mrmidi Jun 2, 2026
a7db2a1
Enable root and gap BM validation
mrmidi Jun 2, 2026
e8948d3
discovery/audio: move runtime IDeviceProtocol ownership out of Discov…
mrmidi Jun 2, 2026
3f8f649
audio: reset runtime registry before bus/IRM teardown
mrmidi Jun 2, 2026
8ea9bd8
Fix local IRM resource allocation path
mrmidi Jun 2, 2026
61373d0
DICE: Adjust duplex startup order, cache total capabilities, and impr…
mrmidi Jun 3, 2026
33e1f21
Isoch/Audio: Improve startup alignment, relax seed gating, and fix SY…
mrmidi Jun 3, 2026
945adcd
ADK headers references
mrmidi Jun 3, 2026
2f1db48
Refactor audio source tree and unify endianness primitives
mrmidi Jun 3, 2026
e710b66
Add direct ADK audio engine skeleton
mrmidi Jun 3, 2026
a478ba3
Harden direct audio skeleton state reset
mrmidi Jun 3, 2026
bf9072b
Add direct audio TX sidecar diagnostics
mrmidi Jun 3, 2026
429aee1
audio: Unify direct TX packet encoding, introduce TxAudioPacketWriter…
mrmidi Jun 3, 2026
e5bad1f
audio: Refactor direct TX binding to shared-memory/control view
mrmidi Jun 3, 2026
2ad1355
audio: Wire nub-registered direct TX binding + enable hardware path (…
mrmidi Jun 3, 2026
3cd23de
Complete direct-only audio architecture and stabilize build
mrmidi Jun 3, 2026
b4667dc
Fix remaining legacy queue references and build errors
mrmidi Jun 3, 2026
052e3bc
audio: Cleanup IDiceQueueMemoryProvider and DiceNubQueueMemoryProvide…
mrmidi Jun 3, 2026
1b23f98
audio: restore OHCI DMA memory allocation for direct-only isoch contexts
mrmidi Jun 3, 2026
f35e288
audio: keep RX device cursor monotonic across direct binding arm and …
mrmidi Jun 3, 2026
0305b71
audio: delete obsolete nub queue and zero-copy remnants
mrmidi Jun 3, 2026
cd3e905
audio: add raw24in32 codec conformance tests
mrmidi Jun 3, 2026
6eb1c2f
feat(dice): recognize Midas Venice as a deferred fail-closed DICE device
boggspa Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
Language: Cpp
BasedOnStyle: LLVM

IndentWidth: 4
TabWidth: 4
UseTab: Never

ColumnLimit: 100

BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never

DerivePointerAlignment: false
PointerAlignment: Left

SortIncludes: true
IncludeBlocks: Preserve
...
26 changes: 26 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
Checks: >
-*,
clang-analyzer-*,
-clang-analyzer-alpha.*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-reserved-identifier,
performance-*,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-auto,
-modernize-avoid-c-arrays,
readability-*,
-readability-identifier-naming,
-readability-magic-numbers

FormatStyle: file
WarningsAsErrors: ''

# The DriverKit codebase uses common low-level abbreviations (`kr`, `hw`, `it`, `ok`).
# Keep `readability-identifier-length` enabled, but reduce noise by allowing 2-char names.
CheckOptions:
readability-identifier-length.MinimumVariableNameLength: '2'
readability-identifier-length.MinimumParameterNameLength: '2'
...
147 changes: 147 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Build and Test

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-and-test:
name: Build and Test
runs-on: macos-26
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
LLVM_PROFILE_FILE: ${{ github.workspace }}/build/tests/%p-%m.profraw
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: recursive

- name: Install Dependencies
run: |
gem install xcpretty

- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.CERT_BASE_64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
# BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
if [[ -z "$BUILD_CERTIFICATE_BASE64" || -z "$P12_PASSWORD" || -z "$KEYCHAIN_PASSWORD" ]]; then
echo "Signing secrets are unavailable; skipping certificate import."
exit 0
fi

# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH

# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

# apply provisioning profile
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
# cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

- name: Generate Compilation Database
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.CERT_BASE_64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
chmod +x bump.sh
ls -l bump.sh
set -o pipefail
CODE_SIGN_ARGS=()
if [[ -z "$BUILD_CERTIFICATE_BASE64" || -z "$P12_PASSWORD" || -z "$KEYCHAIN_PASSWORD" ]]; then
echo "Signing secrets are unavailable; building without code signing."
CODE_SIGN_ARGS=(CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO)
fi

xcodebuild -project ASFW.xcodeproj \
-scheme ASFW \
-configuration Debug \
-arch arm64 \
-derivedDataPath build/DerivedData \
clean build \
"${CODE_SIGN_ARGS[@]}" \
| tee xcodebuild.log \
| xcpretty -r json-compilation-database --output compile_commands.json || {
echo "::error::Build failed! Showing last 100 lines of log:"
tail -n 100 xcodebuild.log
exit 1
}

- name: Configure Tests with Coverage
run: |
cmake -S tests -B build/tests \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \
-DCMAKE_EXE_LINKER_FLAGS="-fprofile-instr-generate"

- name: Build Tests
run: |
cmake --build build/tests --config Debug -j$(sysctl -n hw.ncpu)

- name: Run Tests
run: |
cd build/tests
ctest --output-on-failure -j$(sysctl -n hw.ncpu)

- name: Process C++ Coverage
run: |
# Merge all profraw files into a single profdata file
xcrun llvm-profdata merge -sparse build/tests/*.profraw -o coverage.profdata

# Find all test executables in build/tests (excluding CMake artifacts)
TEST_EXECUTABLES=$(find build/tests -type f -perm +111 -not -name "*.dylib" -not -name "*.a" -not -path "*/CMakeFiles/*" -not -path "*/_deps/*" -not -name "cmake" -not -name "ctest")

# Construct the object args for llvm-cov
OBJECT_ARGS=""
for exe in $TEST_EXECUTABLES; do
OBJECT_ARGS="$OBJECT_ARGS -object $exe"
done

# Generate coverage report excluding test files, stubs, and mocks
xcrun llvm-cov show $OBJECT_ARGS \
-instr-profile=coverage.profdata \
--ignore-filename-regex='.*Tests\.cpp$' \
--ignore-filename-regex='.*/tests/.*Stub\.cpp$' \
--ignore-filename-regex='.*/tests/mocks/.*' \
--ignore-filename-regex='.*/tests/LoggingStubs\.cpp$' \
> coverage.txt

- name: Install Sonar Build Wrapper (optional for C/C++ analysis)
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7
if: runner.os == 'macOS' && env.SONAR_TOKEN != ''

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7
if: env.SONAR_TOKEN != ''
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
--define "sonar.cfamily.compile-commands=compile_commands.json"
--define "sonar.cfamily.llvm-cov.reportPath=coverage.txt"

# REDUNDANT if generating compile_commands.json succeeded
# - name: Build Driver
# run: |
# ./build.sh
43 changes: 42 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,62 @@
# Build artifacts
build/
build-ninja/
build-tests/
build-tests-codex/
**/build/
**/build_*/
tests_build/
*.log
tests.log
build-tests*/

# Local tooling caches
.cache/

# .DS_Store
.DS_Store

# .env
.env

# Coverage report
coverage_html/
coverage.profdata
coverage.profraw
default.profraw

# build logs
*.logs
diff.txt

# Other
compile_commands.json

# Sonar run with token
sonar.sh

# PVS studio
.PVS-Studio*

# Scripts for private repo management
push-to-public.shtests/simple_mock_test
push-to-public.sh
# Exclude docs from public repository
# Version metadata (auto-generated)
ASFWDriver/Version/DriverVersion.hpp

# Exclude docs/ from public repository
docs/

# Exclude Plugins/VersionGeneratorPlugin from public repository
Plugins/VersionGeneratorPlugin

# LLM Tools

.claude/
opencode.json

# Xcode per-user state
**/xcuserdata/

# Local Codex scratch builds
build-codex/
21 changes: 21 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++23",
"intelliSenseMode": "macos-clang-arm64",
"macFrameworkPath": [
"/Applications/Xcode-beta.app/Contents/Developer/Platforms/DriverKit.platform/Developer/SDKs/DriverKit.sdk/System/DriverKit/System/Library/Frameworks/AudioDriverKit.framework/Headers",
"/Applications/Xcode-beta.app/Contents/Developer/Platforms/DriverKit.platform/Developer/SDKs/DriverKit.sdk/System/DriverKit/System/Library/Frameworks/DriverKit.framework/Headers",
"/Applications/Xcode-beta.app/Contents/Developer/Platforms/DriverKit.platform/Developer/SDKs/DriverKit.sdk/System/DriverKit/System/Library/Frameworks/PCIDriverKit.framework/Headers"
]
}
],
"version": 4
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sonarlint.connectedMode.project": {
"connectionId": "mrmidi",
"projectKey": "mrmidi_ASFireWire"
},
"sonarlint.pathToCompileCommands": "${workspaceFolder}/compile_commands.json"
}
Loading
Loading