From b91b365c1721db0ece00f714668e26bdf3864273 Mon Sep 17 00:00:00 2001 From: InauguralPhysicist Date: Wed, 28 Oct 2026 14:15:09 -0500 Subject: [PATCH 1/3] Tier D: library-edge programs for utf8.codes/offset and math.fmod/ult/string.reverse (#61, #62) utf8_codes_offset.lua MATCHes the reference; math_fmod_ult_reverse.lua diverges only within the existing EigenScript gap classes (non-finite values, the float subtype, 64-bit integers, NUL bytes), each line itemized in LEDGER.md. Tier D after the additions: D=146/159, diverge=13. LEDGER's summary and Counts table are merged with round 15's refresh (#66): 28 EigenScript-gap rows, 148 PASS/MATCH. Built by Codex Cloud task task_e_6ae23c7f94e8832d8594714ee3b25674, applied by hand (its LEDGER.md diff conflicted with #66). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF --- LEDGER.md | 25 +++++++++++----- changes/added/61-62-library-edge-corpus.md | 1 + corpus/D.manifest | 2 ++ corpus/D/math_fmod_ult_reverse.lua | 27 +++++++++++++++++ corpus/D/utf8_codes_offset.lua | 35 ++++++++++++++++++++++ 5 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 changes/added/61-62-library-edge-corpus.md create mode 100644 corpus/D/math_fmod_ult_reverse.lua create mode 100644 corpus/D/utf8_codes_offset.lua diff --git a/LEDGER.md b/LEDGER.md index 1ee5f23..fbfd448 100644 --- a/LEDGER.md +++ b/LEDGER.md @@ -17,16 +17,24 @@ failure tables below preserve the round-6 measurements; the current measurement `SUMMARY S=0/0 D=124/136 fail=0 diverge=12 hang=0 crash=0 unsupported=0 examined=136 assert=n/a`. - **Grader verdict, end of round 13 (Tier D):** `SUMMARY S=0/0 D=125/137 fail=0 diverge=12 hang=0 crash=0 unsupported=0 examined=137 assert=n/a`. +- **Library-edge additions for #61/#62 (Tier D, 2026-10-28):** `utf8_codes_offset.lua` MATCHes; + `math_fmod_ult_reverse.lua` DIVERGEs only for the pre-existing non-finite, + float-subtype, 64-bit-integer, and NUL-string EigenScript gaps itemized + below. +- **Grader verdict after the #61/#62 additions (Tier D):** + `SUMMARY S=0/0 D=146/159 fail=0 diverge=13 hang=0 crash=0 unsupported=0 examined=159 assert=n/a`. - **Before round 7** (same checkout before EigenLua#35's changes, on v0.45.1): `SUMMARY S=23/23 D=108/108 fail=0 diverge=0 hang=0 crash=0 unsupported=0 examined=131 assert=trusted`. - **Before round 6** (round 5, 79e29669, re-measured on v0.45.0): `SUMMARY S=2/23 D=87/99 fail=15 diverge=12 hang=2 crash=0 unsupported=4 examined=122 assert=trusted`. Round 5's own line (on 686d3b7d) had fail=16 hang=1: cstack.lua is a HANG on v0.45.0 (below), with its first failure unchanged. -Tier D has 157 rows: 145 match and the 12 current divergences are the longstanding EigenScript gaps listed below. +Tier D has 159 rows: 146 match, and the 13 current divergences are the longstanding EigenScript gaps listed below. Rounds 3 through 13 and their additions are described in the historical material below; rounds 14 and 15 added -20 matching rows without changing the divergence classes. Tier S has 23 rows. Across both tiers, the first-failure -classes remain 27 EigenScript gaps, 6 out-of-scope rows, no open front-end bugs, and no unspecified rows. +20 matching rows without changing the divergence classes, and the #61/#62 library-edge programs add one MATCH +(`utf8_codes_offset.lua`) and one row (`math_fmod_ult_reverse.lua`) that diverges only within the existing gap +classes. Tier S has 23 rows. Across both tiers, the first-failure classes are 28 EigenScript gaps (27 before the +#61/#62 additions), 6 out-of-scope rows, no open front-end bugs, and no unspecified rows. ## Classes @@ -43,11 +51,11 @@ A row's class is the class of its **first failure**. Its first ten failures were | class | rows | S | D | |---|---|---|---| -| EigenScript gap | 27 | 15 | 12 | +| EigenScript gap | 28 | 15 | 13 | | out of scope | 6 | 6 | 0 | | front-end bug (open) | 0 | 0 | 0 | | unspecified | 0 | 0 | 0 | -| PASS / MATCH | 147 | 2 | 145 | +| PASS / MATCH | 148 | 2 | 146 | **Scope of the zero in the "front-end bug (open)" row: graded rows only.** No graded row's first failure is a known front-end bug. That says nothing about code the corpus does not reach, and probing beyond it keeps finding @@ -178,9 +186,11 @@ fails correctly. | vararg.lua | **PASS** | 80 | | | | verybig.lua | UNSUPPORTED | 5 | out of scope | 141 OOS (`os.tmpname`); 147 OOS (`io.close`); 148 OOS (`dofile` of the file); 149 OOS (`os.remove`). Then it runs to the end. | -## Tier D: DIVERGE (12 rows) +## Tier D: DIVERGE (13 rows) -Unchanged from round 2: each row's first difference, and every differing line of ops_matrix, is one of the gaps. +The original 12 rows are unchanged from round 2; round 14 adds the final row. +Each first difference, every differing line of `ops_matrix.lua`, and every +difference in the new row is one of the recorded EigenScript gaps. | row | first difference | class | evidence | |---|---|---|---| @@ -196,6 +206,7 @@ Unchanged from round 2: each row's first difference, and every differing line of | str_format_num.lua | line 11 `1 1.0` vs `1 1` | EigenScript gap | `no-float-subtype` (`%s` of 1.0) | | str_len.lua | line 3 `3` vs `1` | EigenScript gap | `nul-in-string` | | utf8_lib.lua | line 9 `utf8.charpattern` bytes | EigenScript gap | `nul-in-string` | +| math_fmod_ult_reverse.lua | line 5: float zero divisor returns `-nan` in Lua but raises `(zero)` in EigenLua; line 7: `2.0` prints as `2`; lines 12-13: `math.maxinteger` has no integer representation; line 16: reversed embedded-NUL string is truncated | EigenScript gaps | `no-nonfinite` and `no-float-subtype` (lines 5 and 7), `no-int64` (lines 12-13), and `nul-in-string` (line 16). These are the complete stdout differences; both arms exit 0. | ## Front-end bugs fixed in round 3 diff --git a/changes/added/61-62-library-edge-corpus.md b/changes/added/61-62-library-edge-corpus.md new file mode 100644 index 0000000..fdcbf7a --- /dev/null +++ b/changes/added/61-62-library-edge-corpus.md @@ -0,0 +1 @@ +Add differential corpus coverage for `utf8.codes`, `utf8.offset`, `math.fmod`, `math.ult`, and `string.reverse` edge cases (#61, #62). diff --git a/corpus/D.manifest b/corpus/D.manifest index 57ab1e7..852cc71 100644 --- a/corpus/D.manifest +++ b/corpus/D.manifest @@ -156,3 +156,5 @@ co_wrap_close_yieldable.lua unspecified-audit: ok tbl_table_value_type_matrix.lua unspecified-audit: ok tbl_sparse_geometric_keys.lua unspecified-audit: ok tbl_set_churn_bounded.lua unspecified-audit: ok +utf8_codes_offset.lua unspecified-audit: ok +math_fmod_ult_reverse.lua unspecified-audit: ok diff --git a/corpus/D/math_fmod_ult_reverse.lua b/corpus/D/math_fmod_ult_reverse.lua new file mode 100644 index 0000000..9716925 --- /dev/null +++ b/corpus/D/math_fmod_ult_reverse.lua @@ -0,0 +1,27 @@ +-- surface: math fmod signed zero-divisor and mixed operands, ult sign-boundary comparisons, and string reverse empty multibyte and NUL bytes +local function show(label, f, ...) + local r = table.pack(pcall(f, ...)) + io.write(label) + for i = 1, r.n do io.write("\t", tostring(r[i])) end + io.write("\n") +end + +show("fmod -7 3", math.fmod, -7, 3) +show("fmod 7 -3", math.fmod, 7, -3) +show("fmod -7 -3", math.fmod, -7, -3) +show("fmod int zero", math.fmod, 7, 0) +show("fmod float zero", math.fmod, 7.0, 0.0) +show("fmod mixed float dividend", math.fmod, 7.5, 2) +show("fmod mixed float divisor", math.fmod, 7, 2.5) + +show("ult negative positive", math.ult, -1, 1) +show("ult positive negative", math.ult, 1, -1) +show("ult min zero", math.ult, math.mininteger, 0) +show("ult zero min", math.ult, 0, math.mininteger) +show("ult max negative", math.ult, math.maxinteger, -1) +show("ult negative max", math.ult, -1, math.maxinteger) + +print("reverse empty", string.reverse("") == "") +print("reverse multibyte", string.reverse("A\xc3\xa9\xe2\x82\xacZ")) +local nul = string.reverse("a\0bc") +print("reverse NUL", #nul, string.byte(nul, 1, -1)) diff --git a/corpus/D/utf8_codes_offset.lua b/corpus/D/utf8_codes_offset.lua new file mode 100644 index 0000000..b02bdb4 --- /dev/null +++ b/corpus/D/utf8_codes_offset.lua @@ -0,0 +1,35 @@ +-- surface: utf8 codes strict and lax iteration, invalid sequences, and offset boundary and continuation-byte behavior +local function show(label, f, ...) + local r = table.pack(pcall(f, ...)) + io.write(label) + for i = 1, r.n do io.write("\t", tostring(r[i])) end + io.write("\n") +end + +local function codes(s, lax) + local out = {} + for p, c in utf8.codes(s, lax) do + out[#out + 1] = p .. ":" .. c + end + return table.concat(out, ",") +end + +local valid = "A\xc3\xa9\xe2\x82\xac\xf0\x9f\x98\x80Z" +show("codes valid", codes, valid) +show("codes continuation", codes, "A\x80B") +show("codes truncated", codes, "A\xe2\x82") +show("codes overlong strict", codes, "\xc0\x80") +show("codes out-of-range strict", codes, "\xf4\x90\x80\x80") +show("codes out-of-range lax", codes, "\xf4\x90\x80\x80", true) +show("codes extended lax", codes, "\xf8\x88\x80\x80\x80", true) + +show("offset forward", utf8.offset, valid, 1, 1) +show("offset negative n", utf8.offset, valid, -1, #valid + 1) +show("offset zero lead", utf8.offset, valid, 0, 6) +show("offset zero continuation", utf8.offset, valid, 0, 7) +show("offset continuation start", utf8.offset, valid, 1, 3) +show("offset i zero", utf8.offset, valid, 1, 0) +show("offset i negative", utf8.offset, valid, 1, -1) +show("offset i past end", utf8.offset, valid, 1, #valid + 2) +show("offset n past end", utf8.offset, valid, 20, 1) +show("offset negative past start", utf8.offset, valid, -20, #valid + 1) From cc6397d18e39cade3e044e1431bf99a64dc0afd2 Mon Sep 17 00:00:00 2001 From: InauguralPhysicist Date: Wed, 28 Oct 2026 14:15:26 -0500 Subject: [PATCH 2/3] changes: one '- ' entry, as the fragment format requires Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF --- changes/added/61-62-library-edge-corpus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/added/61-62-library-edge-corpus.md b/changes/added/61-62-library-edge-corpus.md index fdcbf7a..bd9f6d2 100644 --- a/changes/added/61-62-library-edge-corpus.md +++ b/changes/added/61-62-library-edge-corpus.md @@ -1 +1 @@ -Add differential corpus coverage for `utf8.codes`, `utf8.offset`, `math.fmod`, `math.ult`, and `string.reverse` edge cases (#61, #62). +- Add differential corpus coverage for `utf8.codes`, `utf8.offset`, `math.fmod`, `math.ult`, and `string.reverse` edge cases (#61, #62). From e9a2835158666e96d9ebe1a8323e66ec496a3314 Mon Sep 17 00:00:00 2001 From: InauguralPhysicist Date: Wed, 28 Oct 2026 14:23:30 -0500 Subject: [PATCH 3/3] LEDGER: count #55's MATCHing Tier D row (EigenLua#67, merged meanwhile) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF --- LEDGER.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LEDGER.md b/LEDGER.md index fbfd448..4b05d2b 100644 --- a/LEDGER.md +++ b/LEDGER.md @@ -29,7 +29,9 @@ failure tables below preserve the round-6 measurements; the current measurement hang=2 crash=0 unsupported=4 examined=122 assert=trusted`. Round 5's own line (on 686d3b7d) had fail=16 hang=1: cstack.lua is a HANG on v0.45.0 (below), with its first failure unchanged. -Tier D has 159 rows: 146 match, and the 13 current divergences are the longstanding EigenScript gaps listed below. +Tier D has 160 rows: 147 match, and the 13 current divergences are the longstanding EigenScript gaps listed below +(159 rows measured after the #61/#62 additions, plus #55's `tbl_sparse_offset_descending.lua`, which MATCHed in its +own run, D=146/158, EigenLua#67). Rounds 3 through 13 and their additions are described in the historical material below; rounds 14 and 15 added 20 matching rows without changing the divergence classes, and the #61/#62 library-edge programs add one MATCH (`utf8_codes_offset.lua`) and one row (`math_fmod_ult_reverse.lua`) that diverges only within the existing gap @@ -55,7 +57,7 @@ A row's class is the class of its **first failure**. Its first ten failures were | out of scope | 6 | 6 | 0 | | front-end bug (open) | 0 | 0 | 0 | | unspecified | 0 | 0 | 0 | -| PASS / MATCH | 148 | 2 | 146 | +| PASS / MATCH | 149 | 2 | 147 | **Scope of the zero in the "front-end bug (open)" row: graded rows only.** No graded row's first failure is a known front-end bug. That says nothing about code the corpus does not reach, and probing beyond it keeps finding