Skip to content

feat(INT-1B): reliable 1Hz native audio profiling and matched dry/FX evidence - #840

Open
masarray wants to merge 40 commits into
mainfrom
feat/int1b-audio-health-profiling-20261120
Open

masarray wants to merge 40 commits into
mainfrom
feat/int1b-audio-health-profiling-20261120

Conversation

@masarray

@masarray masarray commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

INT-1B — Audio Reliability Profiling (one integrated product PR)

Central integration: INT-1 #837
Exact candidate source SHA: 99909dba1691e761a4457b16e7418879145cb5fe
Release contract: keep one approved /preview/ WebView + one primary DIRECT ASIO PCM/FX render graph, current native ACK/readback, device identity, .smix, output arm and N-MOD reliability. No dual-ASIO hardware claims.

Delivered code (not just documentation)

  • Off-RT evidence: RealtimeHealthHistogram already records 13 lock-free budget bins on the existing JUCE audio callback; LiveAudioEngine::status() now exposes those cumulative counts only on the CONTROL thread so one-second deltas can be calculated. No extra callback timer, locks, heap or DSP workload.
  • Bounded health log: existing 1 Hz native AUDIO_HEALTH worker writes compact arsonmix.audio-health.int1b.v1 JSON rather than occasionally truncated full device/plugin snapshots (4096-byte bounded record). Full SIGNAL CHECK/COPY FULL REPORT retains native detail.
  • Correct native FX truth: effective DRY/FX classification comes from accepted ChannelId FX inserts, rack/slot/global bypass AND the externally leased original CH1 vendor/Orbit VST graph. The external Graph is accessed via the exact accepted PCM lease, not the latest replaceable graphOwned_. An opaque external owner is marked incomplete, never incorrectly DRY. Legacy dryTest is not sufficient evidence.
  • Offline analysis: scripts/audio_reliability_profile.mjs computes interval callback p95/p99 budget-bucket ceilings, over-budget per 1k, late cadence and device epochs; makes same-ASIO, same-pin-mask/graph-revision/session matched DRY→FX comparisons. Rejects malformed/truncated/unknown evidence, clock/counter resets, device restarts, unmatched modes and gaps. P2 fix: rejected health snapshots are a hard boundary, while a proven monotonic global FX bypass ON→OFF is the only permitted cross-mode transition.
  • Regression coverage: tests/smart_audio_diagnostic_contract_test.mjs includes expected normal power transition, corrupted middle record, opaque external lease, negative counter transition, unchanged-power false match, external-only CH1 A/B, stale sessions, physical mask remapping, coarse histogram semantics. tests/direct_restore_recovery_contract_test.mjs retains three existing DIRECT fence calls plus a STATUS-only mask read.
  • Operator protocol: INT-1B 2-minute dry + 2-minute FX evidence runbook.

Verified qualification (exact source only)

  • Native fast source contracts: PASS at 99909dba1691e761a4457b16e7418879145cb5fe.
  • Windows FAT #44718283667: dispatched at exact 99909dba1691e761a4457b16e7418879145cb5fe. As of last inspection, Windows JS source/contracts PASS, JUCE native MSVC/CTest/installer build RUNNING. Do NOT represent old completed #44701563027 as qualification for this newer SHA.
  • Codex P1 (legacy dryTest), P1 (external CH1) and P2 (rejected health evidence boundary) have concrete code/tests and review replies. Final exact-head review + Windows FAT must pass. Unresolved review threads not suppressed.
  • Physical ASIO hardware listening, actual driver-render underruns, measured round-trip latency, full unloaded/loaded CPU differential: NOT RUN/NOT AVAILABLE. This improves reliability of profiling, not yet a proven numerical CPU/XRUN optimization.

Merge and distribution gates

DO NOT MERGE until same-head Windows MSVC Release, native CTest, FAT installer/portable proof, review and protected required status are green; then use protected squash merge at expected HEAD. Release only via existing authorized INT-1 owner release controller, never speculative old-SHA binaries. No FX/GUI IO experimental feature promotion through this PR.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T10:21:33.495126Z 99909db Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99909db
Status: ✅  Deploy successful!
Preview URL: https://421f7cb0.arsonmix.pages.dev
Branch Preview URL: https://feat-int1b-audio-health-prof.arsonmix.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: edec4e3783

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/audio_reliability_profile.mjs Outdated
else diagnosis="NO_HOST_TIMING_ANOMALY_OBSERVED";
}
return {
lineStart:first.line,lineEnd:last.line,mode:s.dryTest?"DRY":"FX",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Classify DRY windows using the actual native FX bypass state

When following the documented SIGNAL CHECK DRY TEST procedure, this labels a window as DRY even though VST3 processing remains enabled: LiveAudioEngine::setDryTestEnabled() only stores dryTest_, and repository-wide inspection shows that neither render path reads that flag. The actual native bypass is separately controlled by setGlobalFxBypassed() and globalFxBypassed_, which this health record does not capture. Consequently, the new analyzer can report a matched dry/FX comparison between two FX-enabled recordings; using the working global bypass instead leaves both recordings classified as FX. Record the accepted native bypass state and use it for both mode classification and window splitting.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved P1 in current newer HEAD fc1a2c274f127108ec9f72af05a8827df0766e96 (the review audited old edec4e3). Confirmed dryTest_ is intent-only; we now derive nativeGlobalFxBypassed, nativeFxInstalledCount and nativeFxProcessingCount from actual accepted LiveDryRoutingLab::status() FX INSERT leases, native channel/rack bypass flags and atomic global override (CONTROL thread). Compact health records carry this readback; profiler labels DRY only when EFFECTIVE processing count == 0, FX only when >0, splits on bypass/count/epoch changes and rejects mismatched native graph revisions / physical masks. New focused regression proves dryTest=true with effective FX still active is FX, not DRY. This is a substantive P1 fix; final exact-head Windows FAT still pending, not silently waived.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat dbbc955

Copy link
Copy Markdown
Owner Author

@codex review

Please review exact current PR #840 HEAD (not the original edec4e3), specifically the fixed P1 DRY vs FX accepted bypass readback, JUCE var array lifetimes in native status, pin-mask/graph-revision scope checks, new failure fixtures, and RT-offload/4096-byte diagnostic writer safety. The previous P1 has a source and regression fix; do not infer physical FAT from code inspection.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc1a2c274f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/LiveAudioEngine.h
Comment on lines +2548 to +2550
accountInserts (
channel.getProperty ("inserts", {}),
bool (channel.getProperty ("fxRackBypassed", false)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include the externally leased CH1 graph in native FX counts

When the original CH1 vendor/Orbit rack is leased into the accepted ChannelId graph, this counts neither its installed nor its processing plugins. Fresh evidence in the current HEAD shows that currentOriginalCh1Lease() supplies that Graph through ExternalLease, while DynamicChannelFxLeaseBank::prepare() requires the external channel's ordinary insert count to be zero; nativeBusStatus() enumerates only those ordinary inserts. Consequently, with plugins only in the original CH1 rack, disabling global bypass still produces nativeFxProcessingCount=0, so the analyzer labels the FX recording DRY and cannot produce the documented matched comparison. The earlier dryTest fix is present, but this separate supported render path remains unaccounted for. Include the accepted external Graph's slot/bypass readback in both counts, and add a regression fixture for an external-only CH1 rack with global bypass on and off.

AGENTS.md reference: AGENTS.md:L183-L183

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this distinct P1 in current exact head c8753d9ffba7289fbd6aecf5e07819354137e1d4: the native LiveDryRoutingLab::status() accepts originalCh1GraphLeased ONLY when the original CH1 vendor Graph is admitted in the authoritative ChannelId PCM. LiveAudioEngine::status() now includes the externally leased Graph's real slots[].processor, atomic rackBypassed and per-physical-slot atomic bypassFlags in both installed and effectively processing FX counts, respecting the shared global bypass. It publishes separate nativeExternalCh1Leased/InstalledCount/ProcessingCount provenance and includes them in compact 1Hz log; analyzer checks consistency and splits mismatched windows. Added explicit regression: an external-only CH1 vendor rack remains installed while global BYPASS=ON (DRY) and processes when OFF (FX), without native ordinary insert slots. Fast / final exact-head Windows FAT qualification is still required. Thanks for finding the real supported external-host path.

Copy link
Copy Markdown
Owner Author

@codex review

Please inspect current exact HEAD 8f875f9bdca7dad78c8041aebdc457b0044c5d82 after BOTH prior P1 repairs. Focus: (1) accepted native global/rack/slot bypass DRY/FX classification; (2) the original external CH1 vendor Graph, now accessed using the accepted PCM ExternalLease + verified processOwnedChannelOne callback, NEVER a potentially newer graphOwned_ pointer; (3) fail-closed opaque external lease / session identity / timestamp discontinuity / pin-mask and graph revision comparisons; (4) JUCE Windows C++ compile and actual parser fixtures. The P1 original tests and source contracts are still required. Avoid speculative unrelated changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f875f9bdc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +225 to +228
if(dry.sessionId!==fx.sessionId ||
fx.startTimeMs<dry.endTimeMs ||
fx.startTimeMs-dry.endTimeMs>60000)
return {comparable:false,reason:"DRY/FX windows belong to different app sessions or are more than 60s apart."};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject matched comparisons across invalid health records

When a rejected AUDIO_HEALTH record falls between otherwise valid DRY and FX windows, the analyzer still reports a matched comparison. Using the current parser fixtures, 40 seconds of DRY, one malformed record, and 40 seconds of FX produces warnings but compareDryFx() returns comparable: true. The same problem applies to a record rejected because nativeFxActivityComplete is false for an opaque external lease. analyzeHealthLog() splits the windows but discards the boundary's rejection reason, and these checks subsequently accept the adjacent segments. Preserve that boundary information and reject pairing across invalid evidence, while still allowing an ordinary accepted bypass transition.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed at current exact HEAD 99909dba1691e761a4457b16e7418879145cb5fe in scripts/audio_reliability_profile.mjs and tests/smart_audio_diagnostic_contract_test.mjs. Each segment now exposes invalidBefore; a rejected/malformed/legacy/opaque-lease sample between the two windows is a hard cross-mode pairing barrier, even when both windows individually have >=30s data. Only a monotonic, same-session, same-device/pins/graph, explicitly accepted GLOBAL FX BYPASS ON→OFF transition with processing count 0→positive can pair the DRY and FX segments. P2 regressions cover (1) valid bypass pair accepted, (2) truncated JSON between two 40s windows rejected, (3) nativeFxActivityComplete:false opaque lease record rejected, (4) callback counter regression rejected, (5) unproven global power state rejected. Fast native source contracts on HEAD are PASS; MSVC/real hardware FAT is separately gated.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci fat 99909db

Copy link
Copy Markdown
Owner Author

@codex review

Final INT-1B gate: review only current HEAD 99909db, with extra focus on the just-fixed P2 boundary rule. Test a malformed/opaque-lease snapshot between >=40s accepted DRY and FX intervals: compareDryFx MUST reject. An intact native global FX ON→OFF bypass transition with continuous counters and same device/graph MUST be accepted. Earlier P1 lease-count and actual native DSP status fixes also must stand. Check native C++ JUCE compilation and any tangible remaining P0/P1 regression before protected merge.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 99909dba16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

masarray added a commit that referenced this pull request Nov 20, 2026
Integrate PERF-1 health evidence from PR #840. Preserve an explicit and device-scoped calibration path in the verified primary audio callback, and drive the installer smoke test through the existing GUI-only probe.

This branch has not been deployed

No deployments
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