Skip to content

HLC: Witness Full Remote Timestamps + Property Test Expansions (v1.2.0)#24

Merged
dexcompiler merged 2 commits intomainfrom
property-tests-improvements
Jan 27, 2026
Merged

HLC: Witness Full Remote Timestamps + Property Test Expansions (v1.2.0)#24
dexcompiler merged 2 commits intomainfrom
property-tests-improvements

Conversation

@dexcompiler
Copy link
Copy Markdown
Owner

Summary

This PR updates Clockworks’ Hybrid Logical Clock (HLC) receive behavior to fully respect the incoming remote timestamp (walltime.counter@node) and strengthens the property-test suite to cover important edge cases and invariants.

Key changes

  • Full remote timestamp merge on receive
    • HlcGuidFactory.Witness(HlcTimestamp) now merges using the full remote timestamp ordering (WallTimeMs, Counter, NodeId) (including nodeId tie-breaking) instead of only using WallTimeMs.
  • Statistics alignment
    • HlcStatistics.RecordReceive now treats “remote ahead” based on full timestamp comparison (remote > before), matching the new witness semantics.
  • Test coverage improvements
    • Expanded property-tests/HlcCoordinatorProperties.fs with additional properties covering:
      • remote-ahead within same wall time via higher counter
      • remote-ahead via nodeId tie-break
      • remote-behind behavior (no wall-time rewind)
      • mixed sequences of send/receive/physical time changes preserving core invariants
    • Added unit coverage in tests/HlcCausalityTests.cs for counter adoption/exceed behavior.
  • Build modernization
    • Added Directory.Build.props to centralize shared build properties across the solution.
    • Removed duplicated common properties from individual .csproj/.fsproj files.
  • Versioning
    • Bumped package version from 1.1.11.2.0
    • Tagged v1.2.0

Notes

  • The property tests that include adversarial physical-time scenarios use HlcOptions.HighThroughput where appropriate to avoid drift exceptions during randomized generation, while still enforcing monotonicity/correct ordering invariants.

Treat remote HLC timestamps as (wallTime,counter,nodeId) when receiving, and strengthen coordinator property/unit tests for counter and nodeId tie-breaking.
Add Directory.Build.props for shared build settings across the solution, de-duplicate per-project properties, and bump Clockworks package version to 1.2.0.
@dexcompiler
Copy link
Copy Markdown
Owner Author

@copilot review this PR

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 27, 2026

@dexcompiler I've opened a new pull request, #25, to work on those changes. Once the pull request is ready, I'll request review from you.

@dexcompiler dexcompiler merged commit 1207de2 into main Jan 27, 2026
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