Skip to content

Conversation

@MichaelHatherly
Copy link
Collaborator

@MichaelHatherly MichaelHatherly commented Feb 1, 2026

  • Custom binary serialization for typed request/response structs
  • Direct socket communication instead of Malt RPC
  • Add protocol roundtrip tests
  • Update tests for RenderResponse struct access

I noticed that serialisation with BSON.jl was generating a large amount of allocations. This switches it out for a much simpler, less generic, custom format that that reduces allocations in the boundary between runner and workers significantly. Also removes all uses of eval in the transport layer, which was a hold-over from Malt usage, but isn't strictly needed for our simpler needs here. Finally, the Malt implementation itself has been replaced a simpler implementation since we needed need all those features listed above. Things like the "message boundary marker" has been replaced with a length-encoded protocol to ensure we don't encounter that magic boundary marker in real data. Some potential race conditions have also been fixed up in both the worker and runner logic.

- Custom binary serialization for typed request/response structs
- Direct socket communication instead of Malt RPC
- Add protocol roundtrip tests
- Update tests for RenderResponse struct access
Replace @lock macro (Julia 1.7+) with lock() do for 1.6 support.
Treat unknown msg_id as protocol corruption and break receive loop
instead of continuing, which would leave caller blocked forever.
@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 78.84972% with 114 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.25%. Comparing base (1cb6d81) to head (d62c330).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/QuartoNotebookWorker/src/protocol.jl 81.69% 41 Missing ⚠️
src/WorkerIPC.jl 79.78% 37 Missing ⚠️
src/QuartoNotebookWorker/src/WorkerIPC.jl 63.88% 26 Missing ⚠️
...c/QuartoNotebookWorker/src/QuartoNotebookWorker.jl 75.00% 7 Missing ⚠️
src/server.jl 90.90% 2 Missing ⚠️
src/startup.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
+ Coverage   76.20%   78.25%   +2.04%     
==========================================
  Files          48       47       -1     
  Lines        2135     2304     +169     
==========================================
+ Hits         1627     1803     +176     
+ Misses        508      501       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use parametric PendingCall{R} with typed channels instead of
Channel{Any}. deliver!() dispatches on response type for type stability.
@MichaelHatherly MichaelHatherly marked this pull request as ready for review February 2, 2026 12:06
@MichaelHatherly MichaelHatherly merged commit b0a513b into main Feb 2, 2026
12 checks passed
@MichaelHatherly MichaelHatherly deleted the mh/binary-ipc-protocol branch February 2, 2026 12:06
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.

2 participants