Refinements: clarify HLC packing, optimize VectorClock coordinator, simplify deterministic simulation#46
Conversation
|
@cursoragent review this PR |
PR ReviewOverall this is a strong refinement pass: the wire-format docs are clearer, the What looks good
Nits / follow-ups to consider (non-blocking)
Verification
|
|
@copilot review this PR |
|
@dexcompiler I've opened a new pull request, #47, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot I made some more changes. Review |
|
@dexcompiler I've opened a new pull request, #48, to work on those changes. Once the pull request is ready, I'll request review from you. |
Switched default branches in two switch statements to throw UnreachableException instead of ArgumentOutOfRangeException, clarifying that these code paths should never be reached. This improves code semantics and intent.
|
@cursoragent I made more changes since your last review. Take a look at the latest commits! |
|
Yep — I pulled the PR branch again and reviewed the latest commits (now up through What changed since my last review (and looks good)
Minor nits (non-blocking)
|
Code review: VectorClock optimizations and deterministic simulation refinements
Code review: HLC sign-extension fix, VectorClock optimizations, deterministic demo improvements


Summary
This PR refines several distributed-systems demo and library implementation details to be more explicit and efficient [closer to “systems library” standards], while preserving existing behavior and wire formats.
HlcTimestamp:Int64encoding semantics [explicit constant + XML docs]NodeIdtruncation in packed form explicit; full-fidelity remainsWriteTo(Span<byte>)andReadFrom(ReadOnlySpan<byte>)VectorClockandVectorClockCoordinator:IsEmptyfor explicit checksVectorClockBuilderand updatedVectorClockCoordinatorto use it to reduce allocation churn on merge/increment hot pathsDeterministic distributed showcase demo:
ConcurrentDictionarytoDictionary/HashSet[since the initial demo is single-threaded by design]PriorityQueuewith deterministic tie-breaking