From 6d212d89ea2f669aa60d81d145caaeaffd8b9d1a Mon Sep 17 00:00:00 2001 From: Dave Lucia Date: Wed, 10 Jun 2026 15:17:02 -0700 Subject: [PATCH 1/3] chore(roadmap): sync plan statuses and status block to reality The ship-a-plan skill never wrote merged status back to 35 plan files (A19-A48, B8-B14, B5a/b-v2, B9 all shipped) and the ROADMAP status block was stale at 2026-05-21. Flip those 35 frontmatter statuses review -> merged (each PR confirmed MERGED) and refresh the status block: - Unit tests 1,705 -> 2,230 passing, 0 failing. - Lua 5.3 suite 6/29 -> 17/29 passing. - Note rc.2 shipped and current focus is the A13 release gates. Leaves the In flight / Next / Deferred narrative for human update per the ROADMAP cadence rule. --- .../plans/A19-error-line-info-native-funcs.md | 2 +- .agents/plans/A20-triage-sandbox-refusals.md | 2 +- .agents/plans/A21a-integer-divide-by-zero.md | 2 +- .agents/plans/A22a-gc-collectgarbage-stub.md | 2 +- .agents/plans/A23a-gsub-replacement-errors.md | 2 +- .../A24a-table-unpack-too-many-results.md | 2 +- .agents/plans/A25-string-pack-unpack.md | 2 +- .agents/plans/A26-error-message-quality.md | 2 +- .agents/plans/A27-inspect-protocol.md | 2 +- .agents/plans/A29-mix-tasks.md | 2 +- .agents/plans/A30-examples-directory.md | 2 +- .agents/plans/A31-readme-rewrite.md | 2 +- .agents/plans/A32-docstring-audit.md | 2 +- .agents/plans/A36-parser-error-positions.md | 2 +- .../plans/A37-parser-error-tuple-shapes.md | 2 +- .agents/plans/A38-dialyzer-plt-cache.md | 2 +- .../plans/A39-require-leaks-open-upvalues.md | 2 +- .agents/plans/A40-arith-name-hints.md | 2 +- .agents/plans/A41-funcdecl-head-name.md | 2 +- .../plans/A42-paren-adjust-single-value.md | 2 +- .agents/plans/A43-os-library.md | 2 +- .agents/plans/A44-debug-getinfo-name.md | 2 +- .agents/plans/A45-short-circuit-level4.md | 2 +- .agents/plans/A46-pattern-position-capture.md | 2 +- .agents/plans/A47-open-upvalue-block-close.md | 2 +- .../A48-pcall-error-value-passthrough.md | 2 +- .../plans/B10-table-sort-batch-writeback.md | 2 +- .agents/plans/B11-setlist-batch-insert.md | 2 +- .../plans/B12-string-format-flags-bitmask.md | 2 +- .../plans/B13-string-format-width-iolist.md | 2 +- .../plans/B14-string-format-iolib-float.md | 2 +- .agents/plans/B5a-v2-dispatcher-foundation.md | 2 +- .agents/plans/B5b-v2-dispatcher-tables.md | 2 +- .agents/plans/B8-inline-numeric-narrowing.md | 2 +- .agents/plans/B9-stdlib-hot-paths.md | 2 +- ROADMAP.md | 24 ++++++++++++------- 36 files changed, 51 insertions(+), 43 deletions(-) diff --git a/.agents/plans/A19-error-line-info-native-funcs.md b/.agents/plans/A19-error-line-info-native-funcs.md index d9b5de27..c2ebd487 100644 --- a/.agents/plans/A19-error-line-info-native-funcs.md +++ b/.agents/plans/A19-error-line-info-native-funcs.md @@ -5,7 +5,7 @@ issue: null pr: 215 branch: fix/error-line-info-stdlib base: main -status: review +status: merged direction: A unlocks: - line numbers on `string.upper(nil)`, `table.insert(t, nil, 5)`, etc. diff --git a/.agents/plans/A20-triage-sandbox-refusals.md b/.agents/plans/A20-triage-sandbox-refusals.md index fdf47265..154dd11e 100644 --- a/.agents/plans/A20-triage-sandbox-refusals.md +++ b/.agents/plans/A20-triage-sandbox-refusals.md @@ -5,7 +5,7 @@ issue: null pr: 216 branch: triage/sandbox-refusals base: main -status: review +status: merged direction: A unlocks: - main.lua diff --git a/.agents/plans/A21a-integer-divide-by-zero.md b/.agents/plans/A21a-integer-divide-by-zero.md index 387fc78d..29fa4aac 100644 --- a/.agents/plans/A21a-integer-divide-by-zero.md +++ b/.agents/plans/A21a-integer-divide-by-zero.md @@ -5,7 +5,7 @@ issue: 259 pr: 292 branch: fix/runtime-type-cluster base: main -status: review +status: merged direction: A --- diff --git a/.agents/plans/A22a-gc-collectgarbage-stub.md b/.agents/plans/A22a-gc-collectgarbage-stub.md index bfc688e2..c36643ac 100644 --- a/.agents/plans/A22a-gc-collectgarbage-stub.md +++ b/.agents/plans/A22a-gc-collectgarbage-stub.md @@ -5,7 +5,7 @@ issue: 260 pr: 287 branch: fix/gc-vm-errors base: main -status: review +status: merged direction: A unlocks: - gc.lua diff --git a/.agents/plans/A23a-gsub-replacement-errors.md b/.agents/plans/A23a-gsub-replacement-errors.md index d0bfbde8..896925fe 100644 --- a/.agents/plans/A23a-gsub-replacement-errors.md +++ b/.agents/plans/A23a-gsub-replacement-errors.md @@ -5,7 +5,7 @@ issue: 261 pr: 291 branch: fix/metamethod-control-flow base: main -status: review +status: merged direction: A unlocks: - pm.lua diff --git a/.agents/plans/A24a-table-unpack-too-many-results.md b/.agents/plans/A24a-table-unpack-too-many-results.md index be0906fb..a5f0da94 100644 --- a/.agents/plans/A24a-table-unpack-too-many-results.md +++ b/.agents/plans/A24a-table-unpack-too-many-results.md @@ -5,7 +5,7 @@ issue: 262 pr: 293 branch: fix/stdlib-data-structure base: main -status: review +status: merged direction: A --- diff --git a/.agents/plans/A25-string-pack-unpack.md b/.agents/plans/A25-string-pack-unpack.md index cb384d76..469dd69f 100644 --- a/.agents/plans/A25-string-pack-unpack.md +++ b/.agents/plans/A25-string-pack-unpack.md @@ -5,7 +5,7 @@ issue: null pr: 217 branch: feat/string-pack-unpack base: main -status: review +status: merged direction: A unlocks: - tpack.lua diff --git a/.agents/plans/A26-error-message-quality.md b/.agents/plans/A26-error-message-quality.md index 23b8c100..27f2c5f9 100644 --- a/.agents/plans/A26-error-message-quality.md +++ b/.agents/plans/A26-error-message-quality.md @@ -5,7 +5,7 @@ issue: 263 pr: 304 branch: errors/quality-pass base: main -status: review +status: merged direction: A unlocks: - "world-class error messages" promise of the library diff --git a/.agents/plans/A27-inspect-protocol.md b/.agents/plans/A27-inspect-protocol.md index 8b24ac7f..efda4059 100644 --- a/.agents/plans/A27-inspect-protocol.md +++ b/.agents/plans/A27-inspect-protocol.md @@ -5,7 +5,7 @@ issue: null pr: 218 branch: dx/inspect-protocol base: main -status: review +status: merged direction: A unlocks: - readable iex output for Lua values diff --git a/.agents/plans/A29-mix-tasks.md b/.agents/plans/A29-mix-tasks.md index 2bca6c70..7cdd135c 100644 --- a/.agents/plans/A29-mix-tasks.md +++ b/.agents/plans/A29-mix-tasks.md @@ -5,7 +5,7 @@ issue: null pr: 220 branch: dx/mix-tasks base: main -status: review +status: merged direction: A unlocks: - one-line invocations from a Mix project diff --git a/.agents/plans/A30-examples-directory.md b/.agents/plans/A30-examples-directory.md index efb00c7a..19d87de6 100644 --- a/.agents/plans/A30-examples-directory.md +++ b/.agents/plans/A30-examples-directory.md @@ -5,7 +5,7 @@ issue: 264 pr: 300 branch: docs/examples base: main -status: review +status: merged direction: A unlocks: - "embedding patterns are obvious" promise diff --git a/.agents/plans/A31-readme-rewrite.md b/.agents/plans/A31-readme-rewrite.md index 12fb599a..b1edbde1 100644 --- a/.agents/plans/A31-readme-rewrite.md +++ b/.agents/plans/A31-readme-rewrite.md @@ -5,7 +5,7 @@ issue: 265 pr: 298 branch: docs/readme-rewrite base: main -status: review +status: merged direction: A unlocks: - "first-impression" of the library on Hex/GitHub diff --git a/.agents/plans/A32-docstring-audit.md b/.agents/plans/A32-docstring-audit.md index dddde98a..d5376b06 100644 --- a/.agents/plans/A32-docstring-audit.md +++ b/.agents/plans/A32-docstring-audit.md @@ -5,7 +5,7 @@ issue: 266 pr: 301 branch: docs/docstring-audit base: main -status: review +status: merged direction: A unlocks: - "world-class docs" promise diff --git a/.agents/plans/A36-parser-error-positions.md b/.agents/plans/A36-parser-error-positions.md index 3ef0e4a5..5a53444e 100644 --- a/.agents/plans/A36-parser-error-positions.md +++ b/.agents/plans/A36-parser-error-positions.md @@ -5,7 +5,7 @@ issue: null pr: 222 branch: fix/parser-error-positions base: main -status: review +status: merged direction: A unlocks: - `Lua.eval!("2 + 2")` produces a useful error message diff --git a/.agents/plans/A37-parser-error-tuple-shapes.md b/.agents/plans/A37-parser-error-tuple-shapes.md index 9fd87625..fd3ded89 100644 --- a/.agents/plans/A37-parser-error-tuple-shapes.md +++ b/.agents/plans/A37-parser-error-tuple-shapes.md @@ -5,7 +5,7 @@ issue: null pr: 241 branch: fix/parser-error-tuple-shapes base: main -status: review +status: merged direction: A unlocks: - Table-field syntax errors render with position and source context diff --git a/.agents/plans/A38-dialyzer-plt-cache.md b/.agents/plans/A38-dialyzer-plt-cache.md index 8614c260..e22966f3 100644 --- a/.agents/plans/A38-dialyzer-plt-cache.md +++ b/.agents/plans/A38-dialyzer-plt-cache.md @@ -5,7 +5,7 @@ issue: null pr: 243 branch: ci/dialyzer-plt-cache base: main -status: review +status: merged direction: A --- diff --git a/.agents/plans/A39-require-leaks-open-upvalues.md b/.agents/plans/A39-require-leaks-open-upvalues.md index aef05058..b4501d4c 100644 --- a/.agents/plans/A39-require-leaks-open-upvalues.md +++ b/.agents/plans/A39-require-leaks-open-upvalues.md @@ -5,7 +5,7 @@ issue: 244 pr: 245 branch: fix/require-leaks-open-upvalues base: main -status: review +status: merged direction: A unlocks: - luassert.assertions diff --git a/.agents/plans/A40-arith-name-hints.md b/.agents/plans/A40-arith-name-hints.md index bc042797..ace9d6a7 100644 --- a/.agents/plans/A40-arith-name-hints.md +++ b/.agents/plans/A40-arith-name-hints.md @@ -5,7 +5,7 @@ issue: 252 pr: 270 branch: errors/arith-bitwise-hints base: main -status: review +status: merged direction: A unlocks: - math.lua (reason narrowed) diff --git a/.agents/plans/A41-funcdecl-head-name.md b/.agents/plans/A41-funcdecl-head-name.md index 1ef94710..a84812ad 100644 --- a/.agents/plans/A41-funcdecl-head-name.md +++ b/.agents/plans/A41-funcdecl-head-name.md @@ -5,7 +5,7 @@ issue: 255 pr: 274 branch: fix/funcdecl-head-name base: main -status: review +status: merged direction: A unlocks: - calls.lua diff --git a/.agents/plans/A42-paren-adjust-single-value.md b/.agents/plans/A42-paren-adjust-single-value.md index 14a4be3e..29f7b2b9 100644 --- a/.agents/plans/A42-paren-adjust-single-value.md +++ b/.agents/plans/A42-paren-adjust-single-value.md @@ -5,7 +5,7 @@ issue: 254 pr: 278 branch: fix/paren-adjust-single-value base: main -status: review +status: merged direction: A unlocks: - constructs.lua diff --git a/.agents/plans/A43-os-library.md b/.agents/plans/A43-os-library.md index daa2c386..861805dc 100644 --- a/.agents/plans/A43-os-library.md +++ b/.agents/plans/A43-os-library.md @@ -5,7 +5,7 @@ issue: 280 pr: 289 branch: fix/runtime-type-errors base: main -status: review +status: merged direction: A unlocks: - all.lua diff --git a/.agents/plans/A44-debug-getinfo-name.md b/.agents/plans/A44-debug-getinfo-name.md index 993123d3..687b57fc 100644 --- a/.agents/plans/A44-debug-getinfo-name.md +++ b/.agents/plans/A44-debug-getinfo-name.md @@ -5,7 +5,7 @@ issue: 279 pr: 290 branch: feat/debug-getinfo-name base: main -status: review +status: merged direction: A unlocks: - constructs.lua diff --git a/.agents/plans/A45-short-circuit-level4.md b/.agents/plans/A45-short-circuit-level4.md index 9e21bcc0..d2391db5 100644 --- a/.agents/plans/A45-short-circuit-level4.md +++ b/.agents/plans/A45-short-circuit-level4.md @@ -5,7 +5,7 @@ issue: 281 pr: 294 branch: fix/short-circuit-level4 base: main -status: review +status: merged direction: A unlocks: - constructs.lua diff --git a/.agents/plans/A46-pattern-position-capture.md b/.agents/plans/A46-pattern-position-capture.md index 9e99c307..8d6aebe9 100644 --- a/.agents/plans/A46-pattern-position-capture.md +++ b/.agents/plans/A46-pattern-position-capture.md @@ -5,7 +5,7 @@ issue: 257 pr: 288 branch: feat/pattern-position-capture base: main -status: review +status: merged direction: A unlocks: - pm.lua diff --git a/.agents/plans/A47-open-upvalue-block-close.md b/.agents/plans/A47-open-upvalue-block-close.md index 9c6eba6a..79d077aa 100644 --- a/.agents/plans/A47-open-upvalue-block-close.md +++ b/.agents/plans/A47-open-upvalue-block-close.md @@ -5,7 +5,7 @@ issue: 276 pr: 303 branch: fix/open-upvalue-block-close base: main -status: review +status: merged direction: A unlocks: - calls.lua diff --git a/.agents/plans/A48-pcall-error-value-passthrough.md b/.agents/plans/A48-pcall-error-value-passthrough.md index 8ad2c22b..9897896a 100644 --- a/.agents/plans/A48-pcall-error-value-passthrough.md +++ b/.agents/plans/A48-pcall-error-value-passthrough.md @@ -5,7 +5,7 @@ issue: 334 pr: 335 branch: fix/pcall-error-value-passthrough base: main -status: review +status: merged direction: A unlocks: - structured error objects (error({code = ...})) survive pcall diff --git a/.agents/plans/B10-table-sort-batch-writeback.md b/.agents/plans/B10-table-sort-batch-writeback.md index 18047ce5..db5223ba 100644 --- a/.agents/plans/B10-table-sort-batch-writeback.md +++ b/.agents/plans/B10-table-sort-batch-writeback.md @@ -5,7 +5,7 @@ issue: 307 pr: 318 branch: perf/table-sort-batch-writeback base: main -status: review +status: merged direction: B --- diff --git a/.agents/plans/B11-setlist-batch-insert.md b/.agents/plans/B11-setlist-batch-insert.md index 02ac30cf..d583034f 100644 --- a/.agents/plans/B11-setlist-batch-insert.md +++ b/.agents/plans/B11-setlist-batch-insert.md @@ -5,7 +5,7 @@ issue: 308 pr: 321 branch: perf/setlist-batch-insert base: main -status: review +status: merged direction: B --- diff --git a/.agents/plans/B12-string-format-flags-bitmask.md b/.agents/plans/B12-string-format-flags-bitmask.md index 5aac2341..e8172aff 100644 --- a/.agents/plans/B12-string-format-flags-bitmask.md +++ b/.agents/plans/B12-string-format-flags-bitmask.md @@ -5,7 +5,7 @@ issue: 309 pr: 317 branch: perf/string-format-flags-bitmask base: main -status: review +status: merged direction: B --- diff --git a/.agents/plans/B13-string-format-width-iolist.md b/.agents/plans/B13-string-format-width-iolist.md index c092d3c2..97bc3407 100644 --- a/.agents/plans/B13-string-format-width-iolist.md +++ b/.agents/plans/B13-string-format-width-iolist.md @@ -5,7 +5,7 @@ issue: 310 pr: 316 branch: perf/string-format-width-iolist base: main -status: review +status: merged direction: B --- diff --git a/.agents/plans/B14-string-format-iolib-float.md b/.agents/plans/B14-string-format-iolib-float.md index 24c20cf9..9e8fcf79 100644 --- a/.agents/plans/B14-string-format-iolib-float.md +++ b/.agents/plans/B14-string-format-iolib-float.md @@ -5,7 +5,7 @@ issue: 311 pr: 319 branch: perf/string-format-iolib-float base: main -status: review +status: merged direction: B --- diff --git a/.agents/plans/B5a-v2-dispatcher-foundation.md b/.agents/plans/B5a-v2-dispatcher-foundation.md index 2b8eb00d..b2e5e823 100644 --- a/.agents/plans/B5a-v2-dispatcher-foundation.md +++ b/.agents/plans/B5a-v2-dispatcher-foundation.md @@ -5,7 +5,7 @@ issue: null pr: 237 branch: perf/dispatcher-foundation base: main -status: review +status: merged direction: B unlocks: - B5b-v2 (table opcodes), B5c-v2 (closures), B5d-v2 (error fidelity) diff --git a/.agents/plans/B5b-v2-dispatcher-tables.md b/.agents/plans/B5b-v2-dispatcher-tables.md index d9f35f06..72b05d57 100644 --- a/.agents/plans/B5b-v2-dispatcher-tables.md +++ b/.agents/plans/B5b-v2-dispatcher-tables.md @@ -5,7 +5,7 @@ issue: 271 pr: 275 branch: perf/dispatcher-tables base: main -status: review +status: merged direction: B unlocks: - ~2x speedup on table_ops benchmarks diff --git a/.agents/plans/B8-inline-numeric-narrowing.md b/.agents/plans/B8-inline-numeric-narrowing.md index afdbe10a..97ae8569 100644 --- a/.agents/plans/B8-inline-numeric-narrowing.md +++ b/.agents/plans/B8-inline-numeric-narrowing.md @@ -5,7 +5,7 @@ issue: null pr: 227 branch: perf/inline-numeric-narrowing base: main -status: review +status: merged direction: B unlocks: - small but free win on all integer-arithmetic workloads diff --git a/.agents/plans/B9-stdlib-hot-paths.md b/.agents/plans/B9-stdlib-hot-paths.md index 46b60abd..902858a2 100644 --- a/.agents/plans/B9-stdlib-hot-paths.md +++ b/.agents/plans/B9-stdlib-hot-paths.md @@ -5,7 +5,7 @@ issue: 273 pr: 299 branch: perf/stdlib-hot-paths base: main -status: review +status: merged direction: B unlocks: - closes most of the string.format gap vs Luerl (1.77x) and C Lua (5.5x) diff --git a/ROADMAP.md b/ROADMAP.md index 443fa5b9..3e6e0850 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,14 +2,22 @@ This is the strategic overview. For per-PR detail, see [`.agents/plans/`](.agents/plans). -## Status: 2026-05-21 - -- **Unit tests**: 1,705 passing, 0 failing, 30 skipped. -- **Lua 5.3 official suite**: 6/29 files passing (`simple_test.lua`, - `api.lua`, `bitwise.lua`, `code.lua`, `tpack.lua`, `vararg.lua`). -- **Current focus**: post-B-series consolidation. See [Direction B — - Performance](#direction-b--performance-1-0-x) for what was tried, - what shipped, and what we learned about the limits. +## Status: 2026-06-10 + +- **Version**: `1.0.0-rc.2` shipped (rc.0, rc.1, rc.2 all released). +- **Unit tests**: 2,230 passing (62 doctests, 51 properties, 2,117 + tests), 0 failing, 7 skipped. +- **Lua 5.3 official suite**: 17/29 files passing. 8 fully clean + (`api`, `bitwise`, `code`, `nextvar`, `simple_test`, `tpack`, `utf8`, + `vararg`) plus 9 passing with documented skip-ranges (`all`, `calls`, + `constructs`, `events`, `gc`, `goto`, `literals`, `locals`, `pm`). 4 + deliberate non-goals (`main`, `files`, `attrib`, `verybig`). 8 still + whole-file-skipped pending triage (`big`, `closure`, `coroutine`, + `db`, `errors`, `math`, `sort`, `strings`). +- **Current focus**: closing the `1.0.0` release gates in + [`A13`](.agents/plans/A13-release-rc1.md) — suite gate (17/29 → + target), perf gate (A33–A35 baseline + parity, recursion regression + #324), and the DX gate (`Lua.dbg/2`, PR #219). ## Done From 007f2ced84603ddd28582ac2145ba4d75c96d74d Mon Sep 17 00:00:00 2001 From: Dave Lucia Date: Wed, 10 Jun 2026 15:39:39 -0700 Subject: [PATCH 2/3] docs(suite): settle the 1.0.0 suite gate at 20/29 with 9 exclusions A live re-triage of every whole-file-skipped suite file shows the skip *reasons* were stale and the speculative '>=22/29' A13 target was never achievable. Settle the gate and correct the manifest to match reality: - big.lua / closure.lua: confirmed >90s in isolation -> reclassify from 'pending triage (suspected timeout)' to perf-bound 1.0 exclusions (:performance), revisit 1.0.x with B5 / #324. - coroutine.lua / db.lua: frame as capability non-goals (1.0 exclusion). - errors.lua: the real blocker is PUC '[string "..."]:N:' parse-error wording vs our 'parse error: ...'; documented 1.0 exclusion. - math.lua: prior 'math.huge stand-in' reason was wrong (huge+1==huge and 1/0==huge both hold); real first failure near line 47 unclassified -> triage candidate. - sort.lua: first checkerror passes; a later assertion fails -> triage candidate. - strings.lua: tostring(function) renders 'function' with no ': 0x...' address (line 126) -> cheap fix, triage candidate. A13 suite gate set to 20/29 with 9 documented exclusions (4 fs/subprocess + 2 capability + 2 perf + 1 error-wording); 17 pass today, path to 20 is the strings/sort/math triage plans. Suite stays green (17 passed, 12 skipped). No production code touched. --- .agents/plans/A13-release-rc1.md | 27 ++++++++++++++++++++------ ROADMAP.md | 8 +++++--- test/lua53_skips.exs | 33 ++++++++++++++++++++++---------- 3 files changed, 49 insertions(+), 19 deletions(-) diff --git a/.agents/plans/A13-release-rc1.md b/.agents/plans/A13-release-rc1.md index 230b6cb7..ad6c3054 100644 --- a/.agents/plans/A13-release-rc1.md +++ b/.agents/plans/A13-release-rc1.md @@ -42,12 +42,27 @@ final. summarizing the diff vs `1.0.0-rc.1`. - [ ] `mix test` passes (≥ current count + new tests from A19-A35). -- [ ] **Suite gate**: at least N/29 official Lua 5.3 suite files - passing, where N is set by A20-A24 outcomes. Target is - "near-fully compliant"; specific number to be set after triage - lands. Files explicitly out of scope (`os.execute` etc.) are - documented as deliberate non-goals in the README and - CHANGELOG. **Best-guess: ≥22/29 with documented exclusions.** +- [ ] **Suite gate**: **20/29 official Lua 5.3 suite files passing, + with 9 documented exclusions.** (Settled 2026-06-10 after a live + re-triage of every whole-file skip; supersedes the earlier + best-guess ≥22, which was never achievable — 22 would require a + capability or perf rewrite we have deliberately deferred.) + - **Today: 17/29 pass.** Path to 20 is three triage plans: + `strings.lua` (cheap — `tostring(function)` lacks the + `: 0x...` address that PUC prints), `sort.lua` and `math.lua` + (need a triage pass each; the first-failure sites are recorded + in `test/lua53_skips.exs`). + - **9 documented exclusions**, by category (reasons live in + `test/lua53_skips.exs` + `@deferred_permanent`): + - filesystem / subprocess non-goals (4): `main`, `files`, + `attrib`, `verybig` + - capability non-goals (2): `coroutine`, `db` + - perf-bound, revisit 1.0.x (2): `big`, `closure` (both >90s) + - PUC error-wording divergence (1): `errors` + - If `sort` or `math` proves to be a wording/perf rabbit hole, + exclude it too and ship at the resulting floor (≥18). Every + exclusion must stay a documented non-goal/known-limit in + `lua53_skips.exs`, the README, and the CHANGELOG. - [ ] **Perf gate**: `mix lua.bench --compare-baseline` passes against the locked-in baseline from A35. No workload more than 25% slower than Luerl on the same machine. diff --git a/ROADMAP.md b/ROADMAP.md index 3e6e0850..56e7a012 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -15,9 +15,11 @@ This is the strategic overview. For per-PR detail, see [`.agents/plans/`](.agent whole-file-skipped pending triage (`big`, `closure`, `coroutine`, `db`, `errors`, `math`, `sort`, `strings`). - **Current focus**: closing the `1.0.0` release gates in - [`A13`](.agents/plans/A13-release-rc1.md) — suite gate (17/29 → - target), perf gate (A33–A35 baseline + parity, recursion regression - #324), and the DX gate (`Lua.dbg/2`, PR #219). + [`A13`](.agents/plans/A13-release-rc1.md) — suite gate (settled at + **20/29 with 9 documented exclusions**; 17 pass today, 3 triage + plans remain: `strings` cheap, `sort`/`math` need a pass), perf gate + (A33–A35 baseline + parity, recursion regression #324), and the DX + gate (`Lua.dbg/2`, PR #219). ## Done diff --git a/test/lua53_skips.exs b/test/lua53_skips.exs index db5d2406..feaa8a50 100644 --- a/test/lua53_skips.exs +++ b/test/lua53_skips.exs @@ -48,8 +48,9 @@ "big.lua" => [ %{ lines: :all, - category: :unimplemented, - reason: "pending initial triage (suspected timeout per ROADMAP A10)", + category: :performance, + reason: + "1.0 exclusion (perf): runs >90s in isolation. Perf-bound on the BEAM tuple-copy ceiling; revisit in 1.0.x alongside B5 / the recursion-cost work (#324).", issue: nil } ], @@ -84,8 +85,9 @@ "closure.lua" => [ %{ lines: :all, - category: :unimplemented, - reason: "pending initial triage (suspected timeout per ROADMAP A10)", + category: :performance, + reason: + "1.0 exclusion (perf): runs >90s in isolation. Perf-bound; revisit in 1.0.x alongside B5 / the recursion-cost work (#324).", issue: nil } ], @@ -113,17 +115,27 @@ } ], "coroutine.lua" => [ - %{lines: :all, category: :unimplemented, reason: "coroutines not implemented", issue: nil} + %{ + lines: :all, + category: :unimplemented, + reason: "1.0 exclusion (capability non-goal): coroutines not implemented", + issue: nil + } ], "db.lua" => [ - %{lines: :all, category: :unimplemented, reason: "full debug library not implemented", issue: nil} + %{ + lines: :all, + category: :unimplemented, + reason: "1.0 exclusion (capability non-goal): full debug library not implemented", + issue: nil + } ], "errors.lua" => [ %{ lines: :all, category: :stdlib, reason: - "checkmessage/checksyntax expect PUC-Lua [string \"...\"]:N: prefixes on load() errors; many parse-error templates still differ", + "1.0 exclusion: checkmessage/checksyntax assert PUC-Lua `[string \"...\"]:N:` parse-error wording, but the suite-harness load() returns `parse error: ...`. Matching PUC error wording verbatim is out of scope for 1.0.", issue: nil } ], @@ -196,7 +208,7 @@ lines: :all, category: :stdlib, reason: - "math.huge is a finite 1.0e308 stand-in so identities like math.huge + 1 == math.huge fail; not a wording issue", + "triage candidate: fails a checkerror near line 47. NB the prior `math.huge is a finite stand-in` reason was inaccurate — `math.huge + 1 == math.huge` and `1/0 == math.huge` both hold with the 1.0e308 value. Real first failure is unclassified; needs a triage pass.", issue: nil } ], @@ -250,7 +262,7 @@ lines: :all, category: :stdlib, reason: - "times out: the 2000-element unpack loop and O(n^2) table.sort over the perm/timesort sections run for minutes; the os.clock timing harness is also unimplemented", + "triage candidate: the first checkerror (line 19, table.insert arg count) passes; a later assertion fails. Also has O(n^2) table.sort / 2000-element unpack sections that may need range skips. Needs a triage pass.", issue: 262 } ], @@ -258,7 +270,8 @@ %{ lines: :all, category: :stdlib, - reason: "times out (>30s) on string.rep with large counts; pending finer triage", + reason: + "fixable (cheap): tostring(function) renders `function` with no `: 0x...` address, so line 126 `string.find(tostring(print), 'function:')` fails. tostring({}) is correct (`table: 0x...`). One tostring fix should convert this file (modulo later string.rep/perf sections).", issue: nil } ] From ca0acf685ff98cfa2d21d5bfc6d2485ae4c14814 Mon Sep 17 00:00:00 2001 From: Dave Lucia Date: Wed, 10 Jun 2026 15:47:10 -0700 Subject: [PATCH 3/3] fix(vm): tostring on a function returns a function: 0x address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tostring(print) returned the bare string "function"; PUC-Lua returns "function: 0x..." (and "function: builtin: ..." for C functions). Lua code that branches on string.find(tostring(f), 'function:') — including the official strings.lua suite (line 126) — failed against the bare form. Render lua/compiled closures as "function: 0x" and native functions as "function: builtin: 0x", mirroring the existing "table: 0x..." format; the address is a deterministic per-value pseudo-pointer via :erlang.phash2. type(f) still returns "function". Advances strings.lua past line 126 (next blocker is string.format('%q') escaping at line 153); skip reason updated accordingly. No suite count change yet — strings.lua stays a triage candidate. --- .agents/plans/A13-release-rc1.md | 9 +++++---- CHANGELOG.md | 9 +++++++++ ROADMAP.md | 2 +- lib/lua/vm/value.ex | 16 +++++++++++----- test/lua/vm/value_test.exs | 24 ++++++++++++++++++++++++ test/lua53_skips.exs | 2 +- 6 files changed, 51 insertions(+), 11 deletions(-) diff --git a/.agents/plans/A13-release-rc1.md b/.agents/plans/A13-release-rc1.md index ad6c3054..570cc0bd 100644 --- a/.agents/plans/A13-release-rc1.md +++ b/.agents/plans/A13-release-rc1.md @@ -48,10 +48,11 @@ final. best-guess ≥22, which was never achievable — 22 would require a capability or perf rewrite we have deliberately deferred.) - **Today: 17/29 pass.** Path to 20 is three triage plans: - `strings.lua` (cheap — `tostring(function)` lacks the - `: 0x...` address that PUC prints), `sort.lua` and `math.lua` - (need a triage pass each; the first-failure sites are recorded - in `test/lua53_skips.exs`). + `strings.lua` (`tostring(function)` address fixed, clearing + line 126; next blocker is `string.format('%q')` escaping at + line 153 — a format chain), `sort.lua` and `math.lua` (need a + triage pass each). First-failure sites are recorded in + `test/lua53_skips.exs`. - **9 documented exclusions**, by category (reasons live in `test/lua53_skips.exs` + `@deferred_permanent`): - filesystem / subprocess non-goals (4): `main`, `files`, diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cabd66b..a4026e9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- **`tostring` on a function now returns a `function: 0x...` address** + instead of the bare string `"function"`, matching PUC-Lua's + `tostring(print)`-style output (builtins render as + `function: builtin: 0x...`). The address is a deterministic + per-value pseudo-pointer. Table rendering (`table: 0x...`) is + unchanged. `type(f)` still returns `"function"`. + ## [v1.0.0-rc.2] - 2026-06-10 The third release candidate for `1.0.0`. It builds on rc.1 with a major diff --git a/ROADMAP.md b/ROADMAP.md index 56e7a012..ab9929e1 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -17,7 +17,7 @@ This is the strategic overview. For per-PR detail, see [`.agents/plans/`](.agent - **Current focus**: closing the `1.0.0` release gates in [`A13`](.agents/plans/A13-release-rc1.md) — suite gate (settled at **20/29 with 9 documented exclusions**; 17 pass today, 3 triage - plans remain: `strings` cheap, `sort`/`math` need a pass), perf gate + plans remain — `strings`/`sort`/`math`), perf gate (A33–A35 baseline + parity, recursion regression #324), and the DX gate (`Lua.dbg/2`, PR #219). diff --git a/lib/lua/vm/value.ex b/lib/lua/vm/value.ex index df1fc874..0ca6bd9e 100644 --- a/lib/lua/vm/value.ex +++ b/lib/lua/vm/value.ex @@ -56,13 +56,19 @@ defmodule Lua.VM.Value do def to_string(v) when is_binary(v), do: v - def to_string({:tref, id}), do: "table: 0x#{String.pad_leading(Integer.to_string(id, 16), 14, "0")}" - - def to_string({:lua_closure, _, _}), do: "function" - def to_string({:compiled_closure, _, _}), do: "function" - def to_string({:native_func, _}), do: "function" + def to_string({:tref, id}), do: "table: 0x#{address(id)}" + + # PUC-Lua renders functions as `function: 0x`; the suite and host + # code that calls `tostring` on a function rely on the `function:` prefix. + # There is no stable identity to print like a table's tref id, so derive a + # deterministic pseudo-address from the term itself. + def to_string({:lua_closure, _, _} = f), do: "function: 0x#{address(:erlang.phash2(f))}" + def to_string({:compiled_closure, _, _} = f), do: "function: 0x#{address(:erlang.phash2(f))}" + def to_string({:native_func, _} = f), do: "function: builtin: 0x#{address(:erlang.phash2(f))}" def to_string(other), do: inspect(other) + defp address(id), do: String.pad_leading(Integer.to_string(id, 16), 14, "0") + @doc """ Parses a string to a number (integer or float), supporting hex notation. diff --git a/test/lua/vm/value_test.exs b/test/lua/vm/value_test.exs index 78c1312a..35da1881 100644 --- a/test/lua/vm/value_test.exs +++ b/test/lua/vm/value_test.exs @@ -278,4 +278,28 @@ defmodule Lua.VM.ValueTest do assert user2 == [{"age", 25}, {"name", "Bob"}] end end + + describe "to_string/1 functions" do + test "lua closures render with a function: 0x address" do + assert Value.to_string({:lua_closure, :proto, {}}) =~ ~r/^function: 0x[0-9A-F]{14}$/ + end + + test "compiled closures render with a function: 0x address" do + assert Value.to_string({:compiled_closure, :proto, {}}) =~ ~r/^function: 0x[0-9A-F]{14}$/ + end + + test "native functions render as builtins" do + assert Value.to_string({:native_func, fn -> :ok end}) =~ + ~r/^function: builtin: 0x[0-9A-F]{14}$/ + end + + test "is deterministic for the same value" do + f = {:native_func, fn -> :ok end} + assert Value.to_string(f) == Value.to_string(f) + end + + test "carries the function: prefix that the suite and host code match on" do + assert Value.to_string({:lua_closure, :proto, {}}) =~ "function:" + end + end end diff --git a/test/lua53_skips.exs b/test/lua53_skips.exs index feaa8a50..fe4df0f1 100644 --- a/test/lua53_skips.exs +++ b/test/lua53_skips.exs @@ -271,7 +271,7 @@ lines: :all, category: :stdlib, reason: - "fixable (cheap): tostring(function) renders `function` with no `: 0x...` address, so line 126 `string.find(tostring(print), 'function:')` fails. tostring({}) is correct (`table: 0x...`). One tostring fix should convert this file (modulo later string.rep/perf sections).", + "triage candidate: tostring(function) now prints `function: 0x...` (was bare `function`), clearing line 126. Next blocker is `string.format('%q', ...)` escaping at line 153; later string.rep sections may also need range skips. A format chain, not a one-shot.", issue: nil } ]