005 dotnet bindings#7
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds a new tp-net Rust crate and accompanying TpLib C# library to expose tp-lib-core functionality to .NET consumers via a JSON-over-FFI ByteBuffer contract, plus CI/NuGet packaging scaffolding and core in-memory parsing helpers required for FFI use cases.
Changes:
- Introduces Rust FFI surface (
tp-net) for GNSS projection, path calculation, and detection preparation using heap-ownedByteBufferpayloads. - Adds managed C# API (
TpLib) with models, native resolver, P/Invoke stubs, and xUnit tests. - Extends
tp-coreparsers with*_strin-memory variants to avoid disk I/O and support FFI.
Reviewed changes
Copilot reviewed 80 out of 191 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tp-net/src/marshal.rs | Rust JSON (de)serialization helpers for FFI payloads |
| tp-net/src/lib.rs | Rust extern "C" FFI entry points for projection/path/detection flows |
| tp-net/src/ffi.rs | Rust ByteBuffer + #[repr(C)] config structs and free function |
| tp-net/README.md | README for the .NET bindings package |
| tp-net/csharp/TpLibNative.cs | Native library resolver + free-buffer helper |
| tp-net/csharp/TpLib.targets | MSBuild target for copying RID-specific native binaries |
| tp-net/csharp/TpLib.csproj | .NET project + packaging configuration for NuGet |
| tp-net/csharp/TpLib.cs | Public managed API wrappers around the FFI calls |
| tp-net/csharp/Tests/TpLib.Tests.csproj | xUnit test project |
| tp-net/csharp/Tests/TestData.cs | Test helper for locating fixture data |
| tp-net/csharp/Tests/SerializationTests.cs | JSON serialization unit tests for enums/config/timestamps |
| tp-net/csharp/Tests/ProjectionTests.cs | Projection integration tests using sample fixtures |
| tp-net/csharp/Tests/PathCalculationTests.cs | Path calculation integration tests |
| tp-net/csharp/Tests/InMemoryInputTests.cs | Tests for in-memory network/GNSS input builders |
| tp-net/csharp/Tests/DetectionPreparationTests.cs | Detection preparation integration tests |
| tp-net/csharp/Tests/obj/TpLib.Tests.csproj.nuget.g.targets | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/TpLib.Tests.csproj.nuget.g.props | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/TpLib.Tests.csproj.nuget.dgspec.json | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/project.nuget.cache | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.sourcelink.json | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.GlobalUsings.g.cs | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.genruntimeconfig.cache | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.GeneratedMSBuildEditorConfig.editorconfig | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.csproj.FileListAbsolute.txt | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.csproj.CoreCompileInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.AssemblyInfoInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/TpLib.Tests.AssemblyInfo.cs | Generated build output committed in-tree |
| tp-net/csharp/Tests/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | Generated build output committed in-tree |
| tp-net/csharp/Tests/bin/Debug/net8.0/TpLib.xml | Generated build output committed in-tree |
| tp-net/csharp/Tests/bin/Debug/net8.0/TpLib.Tests.runtimeconfig.json | Generated build output committed in-tree |
| tp-net/csharp/Tests/bin/Debug/net8.0/TpLib.Tests.deps.json | Generated build output committed in-tree |
| tp-net/csharp/obj/TpLib.csproj.nuget.g.targets | Generated build output committed in-tree |
| tp-net/csharp/obj/TpLib.csproj.nuget.g.props | Generated build output committed in-tree |
| tp-net/csharp/obj/TpLib.csproj.nuget.dgspec.json | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.xml | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.sourcelink.json | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.GlobalUsings.g.cs | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.GeneratedMSBuildEditorConfig.editorconfig | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.csproj.FileListAbsolute.txt | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.csproj.CoreCompileInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.AssemblyInfoInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/TpLib.AssemblyInfo.cs | Generated build output committed in-tree |
| tp-net/csharp/obj/Release/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | Generated build output committed in-tree |
| tp-net/csharp/obj/project.nuget.cache | Generated build output committed in-tree |
| tp-net/csharp/obj/project.assets.json | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.xml | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.sourcelink.json | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.GlobalUsings.g.cs | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.GeneratedMSBuildEditorConfig.editorconfig | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.csproj.FileListAbsolute.txt | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.csproj.CoreCompileInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.AssemblyInfoInputs.cache | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/TpLib.AssemblyInfo.cs | Generated build output committed in-tree |
| tp-net/csharp/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs | Generated build output committed in-tree |
| tp-net/csharp/NuGet.config | NuGet feed configuration for the C# projects |
| tp-net/csharp/NativeMethods.g.cs | csbindgen-generated P/Invoke stubs and FFI structs |
| tp-net/csharp/Models.cs | Managed DTOs + NetworkInput/GnssInput builders + JSON options |
| tp-net/csharp/Exceptions.cs | Managed exception hierarchy |
| tp-net/csharp/Enums.cs | Managed enums mirrored from Rust concepts |
| tp-net/csharp/bin/Release/net8.0/TpLib.xml | Generated build output committed in-tree |
| tp-net/csharp/bin/Release/net8.0/TpLib.deps.json | Generated build output committed in-tree |
| tp-net/csharp/bin/Debug/net8.0/TpLib.xml | Generated build output committed in-tree |
| tp-net/csharp/bin/Debug/net8.0/TpLib.deps.json | Generated build output committed in-tree |
| tp-net/Cargo.toml | New Rust crate manifest for .NET bindings |
| tp-net/build.rs | build-script for csbindgen C# stub generation |
| tp-lib.sln | Visual Studio solution file including TpLib + tests |
| tp-core/src/lib.rs | Re-exports for new in-memory parser helpers |
| tp-core/src/io/geojson/detections.rs | Adds load_str for in-memory detection GeoJSON parsing |
| tp-core/src/io/geojson.rs | Adds parse_network_geojson_str and parse_gnss_geojson_str |
| tp-core/src/io/csv/detections.rs | Adds load_str for in-memory detection CSV parsing |
| tp-core/src/io/csv.rs | Adds parse_gnss_csv_str and shared DF parsing helper |
| tp-core/src/io.rs | Re-exports new in-memory parsing helpers |
| specs/005-dotnet-bindings/tasks.md | Feature task breakdown for tp-net |
| specs/005-dotnet-bindings/spec.md | Feature specification for tp-net |
| specs/005-dotnet-bindings/research.md | Research/decisions for FFI + packaging approach |
| specs/005-dotnet-bindings/quickstart.md | End-to-end quickstart documentation for .NET consumers |
| specs/005-dotnet-bindings/plan.md | Implementation plan for the feature |
| specs/005-dotnet-bindings/data-model.md | Data model and FFI mapping documentation |
| specs/005-dotnet-bindings/checklists/requirements.md | Spec quality checklist |
| README.md | Root README updated with NuGet badge + tp-net mention |
| docs/OpenRail-onboarding.md | Onboarding doc updated with .NET bindings mention |
| Cargo.toml | Adds tp-net to the Rust workspace members |
| .github/workflows/publish-nuget.yml | New workflow to build native libs and publish NuGet package |
| .github/workflows/ci.yml | Adds .NET test job to CI |
| .github/agents/copilot-instructions.md | Updates dev guidelines to include tp-net tech stack |
Comments suppressed due to low confidence (1)
tp-net/csharp/TpLib.cs:116
CalculateTrainPathrejects CSV-backedGnssInput, which makesGnssInput.FromCsvunusable for this entry point as well. Consider supporting CSV here too (usingtp_lib_core::parse_gnss_csv_str) or removing the CSV constructor to keep the surface coherent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/Matdata-eu/tp-lib/sessions/5e3df05e-6299-4e3d-a615-b69bff80574a Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Matdata-eu/tp-lib/sessions/5e3df05e-6299-4e3d-a615-b69bff80574a Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Applied requested changes from the review thread for CSV GNSS support end-to-end in the .NET bindings/FFI path, with tests updated. Addressed in b54bcdd and refined in 231023c. |
…to 005-dotnet-bindings
Remove bin/ and obj/ directories from git tracking (build output that should not be version-controlled). Add comprehensive .NET exclusions to .gitignore.
No description provided.