Skip to content

0.0.3

Latest

Choose a tag to compare

@jinzhongjia jinzhongjia released this 25 Oct 04:11
· 10 commits to main since this release

znvim v0.0.3

Release Date: October 25, 2025

Overview

znvim 0.0.3 represents a major stability and quality milestone, bringing comprehensive multi-threading support, enhanced error recovery, complete cross-platform test coverage, and an upgrade to zig-msgpack 0.0.14 that fixes critical stability issues discovered through fuzzing.

Highlights

Multi-Threading Support

Full thread-safe client implementation with comprehensive concurrency testing:

  • Atomic message ID generation (lock-free, tested with 32 threads × 10,000 operations)
  • Mutex-protected shared Client usage for concurrent access
  • Independent Client instances for per-thread isolation
  • Thread-safe read-only operations
  • Performance: 24,615 ops/ms throughput (320,000 operations in 13ms)
  • New documentation: THREAD_SAFETY.md with best practices and migration guide

Dependency Upgrade: zig-msgpack 0.0.14

Critical update addressing recursion depth crashes discovered through fuzzing:

  • Fixed recursion depth crash bug found via fuzzing tests (Signal 9 on random input)
  • All 16 fuzzing tests now pass, including full random input tests
  • Removed all temporary workarounds
  • Complete fuzzing investigation documented in BUG_REPRODUCTION_REPORT.md

Complete Cross-Platform Test Coverage

Added comprehensive unit and integration tests for all transport layers:

New Test Suites:

  • ChildProcess transport: 20 unit tests covering initialization, spawning, connection, read/write operations, error handling, and VTable mechanism
  • UnixSocket transport: 21 independent unit tests with custom socket server (no Neovim dependency)
  • TCP Socket Unix-specific: 18 POSIX-specific tests for BrokenPipe, ConnectionResetByPeer, SO_REUSEADDR, IPv6, and network scenarios
  • Protocol layer: 27 comprehensive message/encoder tests for Request/Response/Notification structures and roundtrip validation
  • Windows Stdio transport: 13 tests using temporary files for cross-platform compatibility
  • Windows Named Pipe: 12 unit tests with custom pipe server plus existing integration tests

Cross-Platform Transport Coverage Matrix:

Transport Windows Unix/Linux macOS Total Tests
ChildProcess 20 20 20 20
UnixSocket N/A 21 21 21
WindowsPipe 53 N/A N/A 53
TCP Socket 19 26 26 37
Stdio 18 21 21 26
Total 110 108 108 157

Enhanced Error Recovery

13 specialized error recovery tests covering:

  • Partial message reads and buffering
  • Connection drop detection
  • Message ID overflow handling
  • Type conversion overflow
  • Empty and null response handling

Boundary Condition Testing

25 boundary condition tests validating:

  • Large data handling (1MB strings, 1000-element arrays)
  • Numeric boundaries (max/min integers, special floats: infinity, NaN)
  • Empty values (strings, arrays, maps)
  • Extreme parameters (1000-character method names, 100 parameters)
  • Unicode and binary data
  • Mixed-type arrays and deeply nested structures

Test Statistics

Metric Value
Test Files 41
Test Cases 773
Pass Rate 100%
Test Code Lines 20,000+
Source Code Lines 3,200
Test/Code Ratio 6.25:1
Quality Rating A (87/100)

Platform Distribution:

  • Windows-only tests: ~70 (skipped on Unix)
  • Unix/Linux-only tests: ~85 (skipped on Windows)
  • Cross-platform tests: ~618 (run on all platforms)

Coverage Improvements

  • Core functionality: 100%
  • Error recovery: 95%
  • Boundary conditions: 90%
  • Concurrency: 100%
  • Memory safety: 100%

New Test Files

Concurrency:

  • concurrency_tests.zig (11 tests) - Atomic operations, thread safety
  • concurrent_shared_client_tests.zig (6 tests) - Shared Client with mutex

Error Handling:

  • error_recovery_tests.zig (13 tests) - Partial reads, timeouts
  • boundary_tests.zig (25 tests) - Large data, edge cases

Transport Layer:

  • child_process_tests.zig (20 tests) - ChildProcess unit tests
  • unix_socket_unit_tests.zig (21 tests) - UnixSocket independent tests
  • tcp_socket_unix_tests.zig (18 tests) - Unix/POSIX TCP tests
  • stdio_windows_tests.zig (13 tests) - Windows Stdio tests
  • windows_pipe_unit_tests.zig (12 tests) - Named pipe unit tests

Protocol:

  • protocol_message_tests.zig (27 tests) - Message structure and encoding

End-to-End:

  • e2e_concurrent_tests.zig (3 tests) - Concurrency scenarios
  • e2e_fault_recovery_tests.zig (17 tests) - Disconnect/reconnect
  • e2e_workflow_tests.zig (9 tests) - Real editing workflows
  • e2e_long_running_tests.zig (9 tests) - Sustained operations
  • e2e_large_data_tests.zig (11 tests) - Large data transfers

Fuzzing:

  • fuzz_manual_tests.zig (16 tests) - All passing including random input

Breaking Changes

None. This release maintains full backward compatibility with v0.0.2.

Requirements

  • Zig 0.15.x
  • Neovim with --embed support (standard builds)

Installation

zig fetch --save https://github.com/jinzhongjia/znvim/archive/v0.0.3.tar.gz

What's Next

Future enhancements planned for upcoming releases:

  • Event handling system for buffer events, UI events
  • Async/await support for non-blocking operations
  • API code generation for type-safe wrappers
  • Connection pooling and batch operations

Acknowledgments

Special thanks to the zig-msgpack maintainers for the rapid fix of the recursion depth issue discovered through our fuzzing tests.


Full Changelog: v0.0.2...v0.0.3