Repository navigation
Wire Maxine AFX packaging, native path, and rate-specific models (stubbed) - #336
Conversation
Register AFX for discovery while keeping honest not-ready behavior: stub readiness in DI, refuse downloads, and fall through to DeepFilterNet until native packaging is wired. Lock the stub contract with tests and docs. Co-authored-by: Anthony Thompson <github@trackdub.com>
Check EnableNvidiaAfx and IsStubbed before GetReadiness so a replaced readiness implementation cannot break DeepFilterNet fallback. Co-authored-by: Anthony Thompson <github@trackdub.com>
Scaffold honest redistributable gates, Maxine-aligned NvAFX_Run/AEC far-end, and settings→enhancement stage options without flipping IsStubbed() or claiming Ready. Co-authored-by: Anthony Thompson <github@trackdub.com>
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
This PR successfully wires NVIDIA AFX packaging gates and native path integration. The implementation demonstrates solid engineering:
Key Strengths:
- P/Invoke bindings correctly match Maxine AFX SDK signatures with proper IntPtr[] marshalling for pointer-to-pointer parameters
- Package validation gates properly reject placeholder URLs, zero hashes, and incomplete metadata
- Far-end reference audio path for AEC properly implemented with dual-input processing
- Thread-safe native library loading with proper locking
- Comprehensive test coverage (42 tests passing)
Technical Implementation:
- NvAFX_Run signature correctly updated to use IntPtr[] for planar channel buffers
- Proper GCHandle pinning for memory safety during native calls
- Secure download verification with SHA-256 and size checks
- Atomic extraction with staging directories
- Graceful fallback to DeepFilterNet when AFX unavailable
The code is production-ready with IsStubbed() staying true as documented. No merge-blocking defects identified.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Keep readiness short-circuit tests from stubs and the AEC far-end fallback coverage from wiring. Co-authored-by: Anthony Thompson <github@trackdub.com>
PR Summary by QodoWire gated NVIDIA AFX runtime and native audio paths while retaining stub
AI Description
Diagram
High-Level Assessment
Files changed (26)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bba189ce66
ℹ️ 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".
Code Review by Qodo
1.
|
Qodo FixerNo findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page. |
Use telephony output sample rate, zero-pad short AEC far-end, require native create/load before Ready, harden settings-load and frame-size fallbacks, and cover the gates with tests. Keep IsStubbed() true. Co-authored-by: Anthony Thompson <github@trackdub.com>
Resolve conflicts after #335 squash-merge onto main by keeping wiring and review fixes. IsStubbed remains true. Co-authored-by: Anthony Thompson <github@trackdub.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Native buffer sizing, rate-changing output trimming, headless settings propagation, and post-stub test coverage need correction.
Review effort: Balanced
Findings: 1
Open (5)
Validate native input channel count matches marshalled pointer array · New Preserve persisted AFX settings in headless runs · New Trim rate-converted output to the source duration · New Reject non-hex SHA-256 values in package metadata · New Add injectable installer stub coverage for post-stub branches · New
What changed in this PR
Adds gated NVIDIA AFX runtime scaffolding while preserving stubbed readiness and DeepFilterNet fallback.
Changes:
- Adds package, license, runtime-path, and native readiness gates.
- Aligns native AFX/AEC processing and telephony output handling.
- Plumbs studio settings and far-end audio into enhancement stages.
| File | Description |
|---|---|
tests/Trackdub.Infrastructure.Tests/Components/NvidiaAfx/NvidiaAfxRuntimePathResolverTests.cs |
Tests runtime path resolution. |
tests/Trackdub.Infrastructure.Tests/Components/NvidiaAfx/NvidiaAfxRuntimePackageGatesTests.cs |
Tests package metadata gates. |
tests/Trackdub.Composition.Tests/NvidiaAfxSpeechAudioEnhancementServiceTests.cs |
Tests AEC fallback behavior. |
tests/Trackdub.Composition.Tests/NvidiaAfxSessionHelpersTests.cs |
Tests frame and far-end helpers. |
tests/Trackdub.Composition.Tests/NvidiaAfxRuntimeInstallerTests.cs |
Tests stubbed installer refusal. |
tests/Trackdub.Composition.Tests/NvidiaAfxProfileCatalogTests.cs |
Tests AEC and telephony profiles. |
tests/Trackdub.Composition.Tests/NvidiaAfxInstalledRuntimeEvaluatorTests.cs |
Tests native readiness evaluation. |
tests/Trackdub.Application.Tests/SpeechAudioEnhancementOptionsPlumbingTests.cs |
Tests settings-to-stage mapping. |
src/Trackdub.Infrastructure/Components/NvidiaAfx/NvidiaAfxRuntimePathResolver.cs |
Resolves configured or installed runtimes. |
src/Trackdub.Infrastructure/Components/NvidiaAfx/NvidiaAfxRuntimePackageGates.cs |
Validates package metadata. |
src/Trackdub.Infrastructure/Components/NvidiaAfx/NvidiaAfxRuntimeDownloader.cs |
Applies gates before download. |
src/Trackdub.Contracts/NvidiaAfxProfile.cs |
Corrects telephony selector documentation. |
src/Trackdub.Contracts/NvidiaAfxIntegration.cs |
Expands stub status and resource metadata. |
src/Trackdub.Contracts/IStudioSettingsService.cs |
Adds AFX license and runtime settings. |
src/Trackdub.Contracts/ISpeechAudioEnhancementService.cs |
Adds far-end and settings mapping options. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxSpeechAudioEnhancementService.cs |
Adds AEC input and output-rate handling. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxSession.cs |
Implements dual-input native frame processing. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxRuntimeReadinessService.cs |
Adds installed-runtime native probing. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxRuntimeInstaller.cs |
Adds gated installer orchestration. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxProfileCatalog.cs |
Updates telephony and output-rate metadata. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxNative.cs |
Aligns Maxine P/Invoke declarations. |
src/Trackdub.Composition/NvidiaAfx/NvidiaAfxEffectProbe.cs |
Adds create/load readiness probe. |
src/Trackdub.Composition/nvidiaafx-runtime.manifest.json |
Updates placeholder package metadata. |
src/Trackdub.Composition/CompositionRoot.cs |
Registers installer and HTTP client. |
src/Trackdub.Application/Transcripts/SpeechAudioEnhancementStageHandler.cs |
Resolves settings and far-end overrides. |
docs/reference/nvidia-afx-wiring.md |
Documents wiring and remaining blockers. |
docs/reference/nvidia-afx-stubs.md |
Updates the stub contract. |
docs/index.md |
Links the wiring reference. |
docs/docs.json |
Adds reference navigation entry. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Require exact RunFrame channel counts, preserve headless AFX settings, trim rate-changing padded output, reject non-hex SHA-256, add installer stub-seam tests, EnsureSuccess on non-chained output-rate set, and narrow installer catch filters. IsStubbed remains true. Co-authored-by: Anthony Thompson <github@trackdub.com>
Resolve NVAudioEffects.dll and features/nvafx*/models by architecture, switch profiles to feature+stem model requirements, keep legacy models/ fallback, and leave IsStubbed true until Windows+NVIDIA proof. Co-authored-by: Anthony Thompson <github@trackdub.com>
Bind 16k/48k model stems per sample rate, require feature bin DLLs when a features/ tree is present, and resolve NVAudioEffects via DllImport resolver so CreateEffect can load Maxine feature packages. Co-authored-by: Anthony Thompson <github@trackdub.com>
Preload features/*/bin/*.dll via NativeLibrary.Load before NVAudioEffects, keep SetDllImportResolver, and tidy layout resolvers with Select/FirstOrDefault. Co-authored-by: Anthony Thompson <github@trackdub.com>
Keep Maxine wiring changes; pick up latest main for CI stability. Co-authored-by: Anthony Thompson <github@trackdub.com>
Address CodeQL style finding on EnumerateFeatureNativeLibraryPaths. Co-authored-by: Anthony Thompson <github@trackdub.com>





Summary
Continues #335 with as-far-as-honest AFX wiring: packaging gates, Maxine-aligned native path, rate-specific models, and settings→stage options.
NvidiaAfxIntegration.IsStubbed()staystrue. DeepFilterNet remains the live enhancement backend. No Ready claims without Trackdub-hosted redistributables + verified GPU native run.What works
NvidiaAfxRuntimePackageGatesrejects placeholder URL/zero-hash/size packages; bundled manifest still non-downloadableNvidiaAfxLicenseAccepted+NvidiaAfxRuntimeInstaller(stub/license/gate refusals)NvidiaAfxRuntimeDirectory/TRACKDUB_NVIDIA_AFX_RUNTIME_ROOTNVAudioEffects.dll+features/nvafx*/(legacymodels/*.nvamfallback)ModelsBySampleRate/ResolveRequiredModels(sampleRate)(16k + 48k)features/tree is presentSetDllImportResolver; managed preload offeatures/*/bin/*.dll(noSetDllDirectory)FarEndReferenceAudioPathon options + dual-input session Process (selector not in Maxine 3.x public docs; stays discoverable-only)SpeechAudioEnhancementStageHandlerusesSpeechAudioEnhancementOptions.FromStudioSettingsdocs/reference/nvidia-afx-wiring.mdStill blocked
IsStubbed()/ swapping DI stub readiness for real probeNVAudioEffects.dllcreate/load/run on Turing+ GPUTest plan
dotnet test tests/Trackdub.Composition.Tests --filter FullyQualifiedName~NvidiaAfx -m:1(32 passed)dotnet test tests/Trackdub.Infrastructure.Tests --filter FullyQualifiedName~NvidiaAfx -m:1(23 passed)dotnet test tests/Trackdub.Application.Tests --filter FullyQualifiedName~SpeechAudioEnhancement -m:1(14 passed)Base:
main(merged docs-rag corpus commit).Summary by CodeRabbit