1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
//! DETERMINISM::TIEBREAK (Task 20, ledger DT-017/DT-027/DT-028) — the one
//! fixed, documented tiebreak for same-`(time, region)` committed effects
//! from different processes, published here so `sv-sim-harness`'s Gate 1
//! (`CommittedEffectSink`) has one named symbol to call/cite instead of
//! re-deriving the rule from reading `sched`/`determinism` source directly.
//!
//! **The policy (DT-017):** the total order is exactly
//! [`CanonicalEventKey`]'s already-derived `Ord` (Task 2/DT-010) — field
//! order `vtime, region_ordinal, reconv_iter, canonical_process_id,
//! local_send_seq`. This function does not reimplement that comparison; it
//! delegates to it, so there is exactly one comparison algorithm for
//! `CanonicalEventKey` values in the crate, never two that could silently
//! drift apart (the same "duplicate pure-function eval diverges" risk this
//! codebase has hit before). `local_send_seq` — assigned once, at
//! effect-creation time, by the controller that produced the key (Task 3's
//! `SequentialController::next_seq`, and any future WOCB controller the same
//! way) — is what makes the order total even when two effects share every
//! other field: two processes at the same `(time, region, reconv_iter)` are
//! already separated by `canonical_process_id`; two effects from the *same*
//! process at the same `(time, region, reconv_iter)` are separated by
//! `local_send_seq`.
//!
//! **DT-027 — Gate 1's hard dependency:** Gate 1 (`sv-sim-harness`'s
//! thread-count-sweep bit-diff gate) is not proceeded around while this rule
//! is unpublished. This module's existence, its `pub` visibility, and its
//! passing tests below ARE the "ENGINE has published and documented its
//! fixed tiebreak rule" precondition DT-027 requires before Gate-1
//! implementation work may proceed — recorded as a hard, checked dependency,
//! not an informal aside.
//!
//! **DT-028 — the recorded CI policy decision:** the full `{1, 4, 8, 16,
//! 31}`-thread-count blake3 bit-diff sweep (SC-013's literal acceptance) is
//! **nightly-only** — it needs a real multi-threaded `DeterminismController`,
//! which does not exist this wave (`SequentialController` is the only
//! implementation shipped, `determinism::sequential::tests::
//! dt006_no_thread_spawn_or_rollback_code_outside_determinism_module` proves
//! it never spawns a thread). A cheap **Tier-A subset is PR-blocking**:
//! `{1, 4}` thread counts only, made up of two checks this crate already
//! ships — `sched::resume::tests::
//! resume_is_never_called_concurrently_for_the_same_process_id` (Task 12's
//! real 8-OS-thread `ResumeDriver` reentrancy stress test, the seam any
//! future multi-threaded controller dispatches through) plus a 2-controller
//! `committed_effect_tiebreak` ordering check (this module's own
//! `tiebreak_is_a_total_order_matching_canonical_event_key_ord` and
//! `tests/region_order_fixture.rs`'s `sequential_and_levelized_controllers_
//! converge_to_the_same_canonical_effect_order`, Task 22). This is a decision
//! *recorded* here because DT-028 asks for an explicit recorded policy, not
//! a default assumed silently; the actual CI YAML wiring the Tier-A subset
//! into PR checks and the full sweep into a nightly job is
//! `sv-sim-harness`'s/the repo's own CI configuration, a different track,
//! out of this crate.
use crateCanonicalEventKey;
/// The one fixed, documented tiebreak for same-`(time, region)` committed
/// effects (DT-017). Delegates to [`CanonicalEventKey`]'s derived `Ord`
/// (Task 2/DT-010's total order) rather than reimplementing comparison —
/// see this module's doc comment for why that matters.