lua: scoreboard iter — trailing-dot numbers, stdlib preload, arg/debug stubs (8x assertion-depth)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-24 19:49:32 +00:00
parent 743e0bae87
commit 781bd36eeb
5 changed files with 72 additions and 56 deletions

View File

@@ -1493,3 +1493,27 @@
(if (>= i (len args)) (if (>= i (len args))
(list) (list)
(cons (nth args i) (lua-varargs-tail args (+ i 1)))))) (cons (nth args i) (lua-varargs-tail args (+ i 1))))))
;; preload standard libs in package.loaded
(dict-set! __package-loaded "string" string)
(dict-set! __package-loaded "math" math)
(dict-set! __package-loaded "table" table)
(dict-set! __package-loaded "io" io)
(dict-set! __package-loaded "os" os)
(dict-set! __package-loaded "coroutine" coroutine)
(dict-set! __package-loaded "package" package)
(dict-set! __package-loaded "_G" _G)
(define arg {})
;; preload debug stub
(define debug {})
(dict-set! debug "traceback" (fn (&rest args) (if (> (len args) 0) (first args) "")))
(dict-set! debug "getinfo" (fn (&rest args) {}))
(dict-set! debug "sethook" (fn (&rest args) nil))
(dict-set! debug "gethook" (fn () nil))
(dict-set! debug "getlocal" (fn (&rest args) nil))
(dict-set! debug "setlocal" (fn (&rest args) nil))
(dict-set! debug "getupvalue" (fn (&rest args) nil))
(dict-set! debug "setupvalue" (fn (&rest args) nil))
(dict-set! __package-loaded "debug" debug)

View File

@@ -11,20 +11,12 @@
"top_failure_modes": [ "top_failure_modes": [
[ [
"other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
5 8
],
[
"parse error",
3
], ],
[ [
"other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio", "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio",
2 2
], ],
[
"other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: module 'string' not found\\\\",
1
],
[ [
"timeout", "timeout",
1 1
@@ -33,16 +25,20 @@
"undefined symbol: collectgarbage\\", "undefined symbol: collectgarbage\\",
1 1
], ],
[
"parse error",
1
],
[ [
"undefined symbol: setfenv\\", "undefined symbol: setfenv\\",
1 1
], ],
[ [
"undefined symbol: T\\", "arith type error",
1 1
], ],
[ [
"undefined symbol: arg\\", "undefined symbol: T\\",
1 1
] ]
], ],
@@ -62,20 +58,20 @@
{ {
"name": "attrib.lua", "name": "attrib.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: module 'string' not found\\\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 5744 "ms": 5747
}, },
{ {
"name": "big.lua", "name": "big.lua",
"status": "timeout", "status": "timeout",
"reason": "per-test timeout", "reason": "per-test timeout",
"ms": 8004 "ms": 8007
}, },
{ {
"name": "calls.lua", "name": "calls.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 4612 "ms": 4595
}, },
{ {
"name": "checktable.lua", "name": "checktable.lua",
@@ -87,7 +83,7 @@
"name": "closure.lua", "name": "closure.lua",
"status": "fail", "status": "fail",
"reason": "undefined symbol: collectgarbage\\", "reason": "undefined symbol: collectgarbage\\",
"ms": 6160 "ms": 6175
}, },
{ {
"name": "code.lua", "name": "code.lua",
@@ -99,7 +95,7 @@
"name": "constructs.lua", "name": "constructs.lua",
"status": "fail", "status": "fail",
"reason": "parse error", "reason": "parse error",
"ms": 2720 "ms": 2589
}, },
{ {
"name": "db.lua", "name": "db.lua",
@@ -111,13 +107,13 @@
"name": "errors.lua", "name": "errors.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 3172 "ms": 2997
}, },
{ {
"name": "events.lua", "name": "events.lua",
"status": "fail", "status": "fail",
"reason": "undefined symbol: setfenv\\", "reason": "undefined symbol: setfenv\\",
"ms": 6976 "ms": 6803
}, },
{ {
"name": "files.lua", "name": "files.lua",
@@ -134,14 +130,14 @@
{ {
"name": "literals.lua", "name": "literals.lua",
"status": "fail", "status": "fail",
"reason": "parse error", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 1786 "ms": 1783
}, },
{ {
"name": "locals.lua", "name": "locals.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 1707 "ms": 1623
}, },
{ {
"name": "main.lua", "name": "main.lua",
@@ -152,44 +148,44 @@
{ {
"name": "math.lua", "name": "math.lua",
"status": "fail", "status": "fail",
"reason": "parse error", "reason": "arith type error",
"ms": 2475 "ms": 3864
}, },
{ {
"name": "nextvar.lua", "name": "nextvar.lua",
"status": "fail", "status": "fail",
"reason": "undefined symbol: T\\", "reason": "undefined symbol: T\\",
"ms": 6743 "ms": 6725
}, },
{ {
"name": "pm.lua", "name": "pm.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 5928 "ms": 5622
}, },
{ {
"name": "sort.lua", "name": "sort.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio",
"ms": 1169 "ms": 1158
}, },
{ {
"name": "strings.lua", "name": "strings.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 3872 "ms": 3811
}, },
{ {
"name": "vararg.lua", "name": "vararg.lua",
"status": "fail", "status": "fail",
"reason": "undefined symbol: arg\\", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"assertion failed!\\\\\\\"\\",
"ms": 2140 "ms": 2111
}, },
{ {
"name": "verybig.lua", "name": "verybig.lua",
"status": "fail", "status": "fail",
"reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio", "reason": "other: Unhandled exception: \\\"Unhandled exception: \\\\\\\"lua: attempt to call non-functio",
"ms": 553 "ms": 563
} }
] ]
} }

View File

@@ -5,15 +5,14 @@ fail=15 timeout=1 skip=8 total=24
## Top failure modes ## Top failure modes
- **5x** other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ - **8x** other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\
- **3x** parse error
- **2x** other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio - **2x** other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio
- **1x** other: Unhandled exception: \"Unhandled exception: \\\"lua: module 'string' not found\\
- **1x** timeout - **1x** timeout
- **1x** undefined symbol: collectgarbage\ - **1x** undefined symbol: collectgarbage\
- **1x** parse error
- **1x** undefined symbol: setfenv\ - **1x** undefined symbol: setfenv\
- **1x** arith type error
- **1x** undefined symbol: T\ - **1x** undefined symbol: T\
- **1x** undefined symbol: arg\
## Per-test results ## Per-test results
@@ -21,25 +20,25 @@ fail=15 timeout=1 skip=8 total=24
|---|---|---|---:| |---|---|---|---:|
| all.lua | skip | driver uses dofile to chain other tests | 0 | | all.lua | skip | driver uses dofile to chain other tests | 0 |
| api.lua | skip | requires testC (C debug library) | 0 | | api.lua | skip | requires testC (C debug library) | 0 |
| attrib.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"lua: module 'string' not found\\ | 5744 | | attrib.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 5747 |
| big.lua | timeout | per-test timeout | 8004 | | big.lua | timeout | per-test timeout | 8007 |
| calls.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 4612 | | calls.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 4595 |
| checktable.lua | skip | internal debug helpers | 0 | | checktable.lua | skip | internal debug helpers | 0 |
| closure.lua | fail | undefined symbol: collectgarbage\ | 6160 | | closure.lua | fail | undefined symbol: collectgarbage\ | 6175 |
| code.lua | skip | bytecode inspection via debug library | 0 | | code.lua | skip | bytecode inspection via debug library | 0 |
| constructs.lua | fail | parse error | 2720 | | constructs.lua | fail | parse error | 2589 |
| db.lua | skip | debug library | 0 | | db.lua | skip | debug library | 0 |
| errors.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 3172 | | errors.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 2997 |
| events.lua | fail | undefined symbol: setfenv\ | 6976 | | events.lua | fail | undefined symbol: setfenv\ | 6803 |
| files.lua | skip | io library | 0 | | files.lua | skip | io library | 0 |
| gc.lua | skip | collectgarbage / finalisers | 0 | | gc.lua | skip | collectgarbage / finalisers | 0 |
| literals.lua | fail | parse error | 1786 | | literals.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 1783 |
| locals.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 1707 | | locals.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 1623 |
| main.lua | skip | standalone interpreter driver | 0 | | main.lua | skip | standalone interpreter driver | 0 |
| math.lua | fail | parse error | 2475 | | math.lua | fail | arith type error | 3864 |
| nextvar.lua | fail | undefined symbol: T\ | 6743 | | nextvar.lua | fail | undefined symbol: T\ | 6725 |
| pm.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 5928 | | pm.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 5622 |
| sort.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio | 1169 | | sort.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio | 1158 |
| strings.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 3872 | | strings.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 3811 |
| vararg.lua | fail | undefined symbol: arg\ | 2140 | | vararg.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"assertion failed!\\\"\ | 2111 |
| verybig.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio | 553 | | verybig.lua | fail | other: Unhandled exception: \"Unhandled exception: \\\"lua: attempt to call non-functio | 563 |

View File

@@ -224,11 +224,7 @@
(begin (begin
(read-decimal-digits!) (read-decimal-digits!)
(when (when
(and (and (< pos src-len) (= (cur) "."))
(< pos src-len)
(= (cur) ".")
(< (+ pos 1) src-len)
(lua-digit? (lua-peek 1)))
(begin (advance! 1) (read-decimal-digits!))) (begin (advance! 1) (read-decimal-digits!)))
(read-exp-part!) (read-exp-part!)
(parse-number (slice src start pos))))))) (parse-number (slice src start pos)))))))

View File

@@ -82,6 +82,7 @@ Each item: implement → tests → tick box → update progress log.
_Newest first. Agent appends on every commit._ _Newest first. Agent appends on every commit._
- 2026-04-24: lua: scoreboard iteration — trailing-dot number literals (`5.`), preload stdlibs in `package.loaded` (`string`/`math`/`table`/`io`/`os`/`coroutine`/`package`/`_G`), `arg` stub, `debug` module stub. Assertion-failure count 4→**8**, parse errors 3→**1**, call-non-fn stable, module-not-found gone.
- 2026-04-24: lua: scoreboard iteration — **vararg `...` transpile**. Parser already emitted `(lua-vararg)`; transpile now: (a) binds `__varargs` in function body when `is-vararg`, (b) emits `__varargs` for `...` uses; `lua-varargs`/`lua-spread-last-multi` runtime helpers spread multi in last call-arg and last table-pos positions. Eliminated all 6× "transpile: unsupported" failures; top-5 now all real asserts. 353 unit tests. - 2026-04-24: lua: scoreboard iteration — **vararg `...` transpile**. Parser already emitted `(lua-vararg)`; transpile now: (a) binds `__varargs` in function body when `is-vararg`, (b) emits `__varargs` for `...` uses; `lua-varargs`/`lua-spread-last-multi` runtime helpers spread multi in last call-arg and last table-pos positions. Eliminated all 6× "transpile: unsupported" failures; top-5 now all real asserts. 353 unit tests.
- 2026-04-24: lua: scoreboard iteration — added `rawget`/`rawset`/`rawequal`/`rawlen`, `loadstring`/`load`, `select`, `assert`, `_G`, `_VERSION`. Failure mix now 6×vararg-transpile / 4×real-assertion / 3×parse / 2×call-non-fn / 1×timeout (was 14 parse + 1 print undef at baseline); tests now reach deep into real assertions. Still 0/16 runnable — next targets: vararg transpile, goto, loadstring-compile depth. 347 unit tests. - 2026-04-24: lua: scoreboard iteration — added `rawget`/`rawset`/`rawequal`/`rawlen`, `loadstring`/`load`, `select`, `assert`, `_G`, `_VERSION`. Failure mix now 6×vararg-transpile / 4×real-assertion / 3×parse / 2×call-non-fn / 1×timeout (was 14 parse + 1 print undef at baseline); tests now reach deep into real assertions. Still 0/16 runnable — next targets: vararg transpile, goto, loadstring-compile depth. 347 unit tests.
- 2026-04-24: lua: `require`/`package` via preload-only (no filesystem search). `package.loaded` caching, nil-returning modules cache as `true`, unknown modules error. 347 tests. - 2026-04-24: lua: `require`/`package` via preload-only (no filesystem search). `package.loaded` caching, nil-returning modules cache as `true`, unknown modules error. 347 tests.