Skip to content

Sync with VRCFaceTracking (.NET 10), Async Refactor & Performance Improvements#42

Open
frg2089 wants to merge 4 commits intoregzo2:vrcfacetracking-modulefrom
frg2089:master
Open

Sync with VRCFaceTracking (.NET 10), Async Refactor & Performance Improvements#42
frg2089 wants to merge 4 commits intoregzo2:vrcfacetracking-modulefrom
frg2089:master

Conversation

@frg2089
Copy link
Copy Markdown
Contributor

@frg2089 frg2089 commented May 3, 2026

📝 Summary

This PR brings major modernization and improvements to the Pico4SAFTExtTrackingModule:

1. Upgrade VRCFaceTracking submodule

Updated the VRCFaceTracking version to 5.4.4.1 (latest on Steam).

2. Modernize codebase with safe C# patterns

  • Removed unsafe pointer code, replacing it with Span<T>, ref, and ReadOnlySpan<T>.
  • Upgraded the target framework to $(VftTargetFramework) to stay in sync with VRCFaceTracking (currently .NET 10).
  • Adopted C# 12 primary constructors.
  • Added Directory.Build.props.
  • Updated tests to work with the new connector API.

3. Fix build output copying

Copied all output files (.dll, .pdb, .deps.json) to the CustomLibs folder during local builds, not just the main DLL.

  • Benefit: This allows line numbers to be visible in logs when the module throws exceptions, making debugging much easier.

4. Refactor LegacyConnector to async/await model

  • Migrated from a single-threaded blocking model to Task + CancellationToken.
  • Used Socket.ReceiveFromAsync for non-blocking UDP reads.
  • Simplified connection state management with volatile flags.
  • Removed the redundant IsDisposed method.
  • Benefit: The shift to asynchronous methods prevents the main VRCFaceTracking application from hanging during shutdown.

5. Code details & performance optimizations

  • Utilized MemoryMarshal.AsRef to avoid redundant struct copying.
  • Corrected all JSDoc-style comments to standard C# XML documentation comments.

frg2089 added 4 commits May 3, 2026 17:09
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
…ades

- Remove unsafe pointer code, replace with Span<T> and ref instead
- Upgrade target framework from hardcoded net7.0 to $(VftTargetFramework)
- Apply C# 12 primary constructor syntax in FileBlendshapeScaler
- Add Directory.Build.props for CI/CD integration
- Update tests to work with new IPicoConnector API (GetBlendShapes returns ReadOnlySpan<float>)
- Simplify ConnectorFactory.Build method naming convention
- Refactor PacketLogger classes with improved structure
- Update dependencies and project references

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
- Include .pdb, .deps.json, and other build artifacts besides the main DLL
- Skip copying when running on CI (ContinuousIntegrationBuild=true)

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
- Replace lock-based threading with Task + CancellationToken
- Use Socket.ReceiveFromAsync for non-blocking UDP reads
- Simplify connection state management with volatile flags

Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
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