Repository navigation
Commit 6b601ef
committed
Kernel: session-day facts on a certified cycle of an exchange zone resolve no calendar interval per bar (R5 lane PERF-ZONED)
PERF-KEDGE recovered KERNEL-EDGE's per-bar cost on UTC calendars only. On
every other zone present_session_day still resolved the bar's script interval
through the calendar memo at every bar, and read the label and both neighbours
through it: a New York 5-minute FeedTolerant run cost 1.73x the instructions of
1a0e7ea (+2,443 Ir a bar), a Tokyo 1-minute run 1.22x (+3,439).
native_calendar::cycle_certificate certifies the session day holding an
instant when the zone makes its cycle read from that day alone: UTC or a fixed
offset, or, under glibc or macOS, a TZif v2+ zone whose 64-bit table covers the
reach (22 days around the cycle, widened by the spacing) and whose transitions
there move the offset by at most 3 hours, between offsets within 14 hours of
UT, never backwards while keeping the daylight-saving flag, and at least 8 days
apart, each read back from libc (localtime on both sides, chained). Then every
civil time in reach resolves to the first instant the wall clock reaches it,
whatever was resolved before: one reading is found from any start; the two
readings of a fold that flips the flag are both found (glibc's mktime probes a
week at a time for the flag asked, and the spacing puts that probe on the
fold's own side; macOS's mktime keeps no state) and resolve_stamp keeps the
earlier; a gap resolves to the move itself inside the 14-hour search. So the
cycles tile, each instant's local date is within a day of its cycle's open
date, the memo's candidate lookup finds exactly that day, and no other day
holds its instants. The zone is asked first, around the instant, and a day is
resolved only where it holds: a refused certificate asks the calendar nothing.
On a certified cycle present_session_day reads an instant in one of the day's
spans in session on the day's ordinal, and an instant whose fixed bucket
(fixed_bucket_ms, the calendar's own unit) meets no span out of session,
resolving nothing. A bucket that reaches a span from outside one, every
instant a certificate refuses, the walk and the scheduled close make the calls
they always made. Measured on spark (instructions:u, A725 core 12):
- zoned configs, 3000 bars idle, main 1a0e7ea / f1f3febd / this commit:
NY 5m tolerant 1.7294x -> 1.0000x, NY 1m tolerant 1.7648x -> 0.9993x,
Tokyo 1m tolerant 1.2201x -> 1.0003x; every canonical and tolerant config
of NY, Tokyo, Chicago, London, Kolkata and UTC at most 1.0008x main;
- the 100 public slots against f1f3febd: median 0.9952 (magnifier on),
0.9942 (off), no slot above 1.0; against main 1.0013 / 1.0001;
- the budget workload: +0.41% over main at f1f3febd, +0.32% here.
Identity (spark, f1f3febd against this commit, byte for byte): 100 slots x
magnifier off/on with trade digests, equity and broker_state_hash; the
132-configuration battery on 8 host variants with every hash column; the
KERNEL-EDGE probes and the AUDIT4 acid tests; PERF-KEDGE's facts battery (9,216
rows); a new 60-window zoned facts battery (45,600 rows: 2024 changes of New
York, Chicago, Denver, Los Angeles, St John's, Havana, Santiago, London,
Berlin, Dublin, Sydney, Lord Howe, Auckland, Chatham, Casablanca, Troll; Sao
Paulo 2018/19, Tehran 2021, Apia and Tongatapu at +14, Caracas, Pyongyang;
constant zones; and the refused folds and jumps of Tokyo 1887, Sitka and
Juneau 1867, Apia 2011, Kwajalein 1969, Moscow 2011/2014, Recife 2000, New
York 1883 and 2040, Amsterdam 1937, Manila 1844); the Pine witness replay.
- native_calendar.cpp / native_calendar_memo.hpp: cycle_certificate,
fixed_bucket_ms, SessionDayMemo::libc_local_reads() (a derived cost
reading), the TZif v2+ table reader, and tz_read_resource shared with the
identity digest.
- native_execution_consumer: the certified-cycle cache (four entries, the
last hit first), certified_point, certified_interval_meets_span; the
PERF-KEDGE UTC member calendar_is_utc() is gone (a UTC calendar certifies
every cycle).
ADR-0001 rule 2: a generic capability of the run's own calendar -- its zone
is data, the same for every venue -- with no spec field, switch or Pine
vocabulary, and no answer moves. The only platform condition picks the libcs
whose mktime the proof reads; elsewhere TZif zones take the exact path.
Nothing is hashed: the facts fold into no digest and the new members are
derived memos.
Witness, tests/test_native_session_day_zoned.cpp (kernel-only):
certificates at real transitions (New York, Chicago, London, Sydney, Lord
Howe 2024 certified where the host's table lists them; Tokyo, Kolkata, a
fixed offset, Apia at +14, Sitka's +14:58:47 and Moscow 2015 certified; Tokyo
1887, Sitka 1867, Apia 2011, Kwajalein 1969, Moscow 2014, Recife 2000, New
York 2040 and POSIX zones refused, a refused certificate reading nothing),
each certified cycle checked against the memo-free session_day_at; the same
tapes under each TZif zone and its POSIX twin (never certified) present
identical facts at every decision point over 8 windows, 7 sessions and 12
runs each, plus the magnifier, seconds and undetected paths (700 runs, 0
mismatches); and New York and Tokyo FeedTolerant batches resolve no interval
for their facts where their twins resolve one a bar. Fail-before at f1f3febd:
"no member named 'libc_local_reads' in
'pineforge::native_calendar::SessionDayMemo'". 17 of 19 mutants fail it; the
two that survive loosen guards no zone in the host's database reaches (the
14-hour offset bound, the libc chain check). The PERF-KEDGE witness's probe
reads the memo's UTC decision directly and its header records the change.
Floors: kernel 278 -> 279, release 679 -> 680, PR registration 660/660/669
-> 661/661/670 (ci_verify.py, its self-test pin and docs/ci.md). 24 doc
anchors carried through the exact line map from f1f3febd; the 6 that cite the
two rewritten floor lines set by hand (ci_verify.py:253, :365).
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit 27e1f384f1063c13efe3961ff58b8a0c6410c425)
INT27 pick note: the lane's base f1f3febd is PERF-KEDGE's tip, which INT26
carries as a3b4b97/debbd7f1. Every source, header and test hunk applied
unchanged against INT26's text (each file's patch is byte-identical to the
lane's), and no other caller of PERF-KEDGE's calendar_is_utc() is left on
the merged tree. The floors are INT26's plus K-RUNERR's plus this lane's row:
kernel 287 run (288 registered), release 705, PR registration 686/686/695
(ci_verify.py, its self-test pin and docs/ci.md). The docs conflicts were
citation digits, merged token by token (INT27's single re-anchor pass sets
every digit on the integrated tree), and the one floors paragraph, rewritten
with the merged counts.1 parent 43f25c9 commit 6b601ef
16 files changed
Lines changed: 1363 additions & 88 deletions
File tree
- docs
- adr
- design
- pages
- scripts
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
| 155 | + | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
2099 | 2099 | | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | | - | |
| 2102 | + | |
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| |||
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
2913 | | - | |
| 2913 | + | |
2914 | 2914 | | |
2915 | 2915 | | |
2916 | 2916 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
261 | 268 | | |
262 | 269 | | |
263 | 270 | | |
| |||
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
396 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
| |||
418 | 427 | | |
419 | 428 | | |
420 | 429 | | |
421 | | - | |
| 430 | + | |
| 431 | + | |
422 | 432 | | |
423 | | - | |
| 433 | + | |
424 | 434 | | |
425 | 435 | | |
426 | 436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1331 | 1331 | | |
1332 | 1332 | | |
1333 | 1333 | | |
1334 | | - | |
| 1334 | + | |
1335 | 1335 | | |
1336 | 1336 | | |
1337 | 1337 | | |
| |||
0 commit comments