Close framework gaps: dsp fixture, codegen stress-test, distribution model, NativeAOT docs#2
Merged
Conversation
Copilot created this pull request from a session on behalf of
ayersdecker
June 20, 2026 04:52
View session
There was a problem hiding this comment.
Pull request overview
This PR closes several “scaffolded vs. production-usable” gaps by adding a second native fixture (DSP-style APIs), expanding codegen validation to cover real consumer ABI patterns, and formalizing a distribution approach that includes both NuGet packages and a dotnet new template.
Changes:
- Add
native/dsp_fixtureand expand CI native builds (iOS slices + Android ABIs) to build both fixtures. - Add codegen stress tests for pointer buffer parameters and blittable struct out-parameters, plus a committed generated bindings file with drift-guard tests.
- Add a
Ferrum.TemplatesNuGet project to distribute a MAUI starter template, and update docs to reflect parser/distribution decisions and NativeAOT manual verification steps.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/Ferrum.Templates.csproj | New template-packaging project for dotnet new distribution. |
| src/Framework.Tests/Codegen/Generated/FerrumDspBindings.cs | Committed generated bindings for the DSP fixture used by drift-guard tests. |
| src/Framework.Tests/Codegen/DspFixtureCodegenTests.cs | New xUnit suite exercising parser/emitter on DSP fixture header and output stability. |
| native/dsp_fixture/src/ferrum_dsp.c | Implementation of DSP fixture functions for build/pipeline validation. |
| native/dsp_fixture/include/ferrum_dsp.h | DSP fixture header designed to exercise pointer + struct-out patterns. |
| native/dsp_fixture/CMakeLists.txt | CMake target for building/installing the DSP fixture library. |
| native/CMakeLists.txt | Adds FERRUM_BUILD_DSP_FIXTURE option and includes the new subdirectory. |
| Ferrum.sln | Adds the templates project and solution folder organization. |
| docs/open-questions.md | Documents decisions on distribution model and tokenizer vs. libclang. |
| docs/getting-started.md | Adds manual NativeAOT-on-device verification checklist. |
| docs/architecture.md | Updates architecture docs to reflect multiple fixtures and tokenizer rationale. |
| .github/workflows/native-build.yml | Builds and uploads artifacts for both fixtures across iOS and Android matrices. |
| .github/workflows/codegen-tests.yml | Extends codegen smoke tests to run against both fixture headers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+14
to
+16
| <TargetFramework>net9.0</TargetFramework> | ||
| <IsPackable>true</IsPackable> | ||
|
|
Comment on lines
+7
to
+11
| void ferrum_dsp_scale(float* buf, int32_t len, float factor) | ||
| { | ||
| for (int32_t i = 0; i < len; ++i) | ||
| buf[i] *= factor; | ||
| } |
Comment on lines
+15
to
+16
| if (len <= 0 || !buf || !result) | ||
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the gaps between "scaffolded" and "safe to depend on by a real consumer app" — specifically the open questions and untested patterns called out in the problem statement.
Codegen parser decision
Resolved
open-questions.mditem 5: keep the tokenizer. It already satisfies "fail loudly, never silently" — throwsCodegenExceptionon any unrecognised construct. libclang would add ~50 MB of native binaries per platform to the dotnet tool NuGet with no correctness gain within the blittable-only constraint.DSP fixture (
native/dsp_fixture/)Adds the two real-consumer parameter patterns
ferrum_add(int,int)never exercised:FerrumDspStats—[StructLayout(Sequential)]withfloat min_val/max_val/mean+int32_t countFerrumDspBindings.cspre-generated and committed; compiles in the test project via[LibraryImport]float*/int-lengthtext prematurely closed a/** */comment, causing a parse errorBuild pipeline
native/CMakeLists.txt— addedFERRUM_BUILD_DSP_FIXTUREoption +add_subdirectory(dsp_fixture)native-build.yml— matrix now builds both fixtures across all iOS slices and Android ABIscodegen-tests.yml— smoke test runs codegen against both headers; verifies[LibraryImport], struct, and function names in outputDistribution model
Resolved
open-questions.mditem 1: NuGet + source template. NuGet metadata already existed in both.csprojfiles. Addedtemplates/Ferrum.Templates.csprojto packagemaui-ferrumas adotnet new install Ferrum.Templatespackage; wired intoFerrum.sln.NativeAOT real-device verification
Cannot be automated in CI (requires provisioned hardware + Apple Developer credentials). Added explicit manual steps to
getting-started.mdwith aTODOmarker — covers both fixtures, expected console checks, and what to record in the PR.