Skip to content

feat(suite): line-range skipping for Lua 5.3 official tests#249

Merged
davydog187 merged 2 commits into
mainfrom
feat/suite-line-range-skips
May 27, 2026
Merged

feat(suite): line-range skipping for Lua 5.3 official tests#249
davydog187 merged 2 commits into
mainfrom
feat/suite-line-range-skips

Conversation

@davydog187
Copy link
Copy Markdown
Contributor

Summary

  • Stops file-level @tag :skip for the Lua 5.3 official suite. Suite files now run with specific line ranges commented out, so every assertion outside those ranges contributes to the green signal.
  • Adds test/lua53_skips.exs as the central conformance backlog. Each entry pairs a Range with a category, one-line reason, and optional GitHub issue number. The skip list answers "what's left before 1.0.0?" from one file.
  • Adds mix lua.suite --status (fast summary) and mix lua.suite --audit (re-runs each file with each entry omitted to surface stale ranges and promotion candidates).
  • Rewrites the triage-suite-failure skill to produce line-range entries instead of whole-file skips.

Zero behavior change in this PR: same 6 ready files pass, the 19 previously-skipped files keep lines: :all (still tagged :skip), and the 4 permanently-deferred files stay in @deferred_permanent. The follow-up triage of the 19 :all files happens in subsequent PRs — the mix lua.suite --audit output already gives first-failure line numbers for each as a starting point.

Why

Direction A's goal (ROADMAP.md) is pushing the suite from 6/29 ready to a healthier pass rate before 1.0.0-rc.1. The file-level skip mechanism throws away signal: a single failing assertion in pm.lua blocks the rest of the file from running. With line-range skipping we get incremental progress per assertion, and mix lua.suite --audit automatically detects when fixes elsewhere have made a skip range obsolete.

Key design choices

  • Line-comment replacement, not AST skip. apply_skip_ranges/2 replaces each skipped line with -- skipped (suite triage): was line N, preserving line numbers. This is load-bearing — Lua.VM.AssertionError auto-captures source position via Lua.VM.Executor.current_position/0, so the line in the error must match the line in the file. A regression test in test/suite_runner_test.exs pins this invariant.
  • lines: :all as a pressure-release valve. Files that need deeper triage stay at :all (still @tag :skip'd) without blocking the mechanism PR.
  • Permanently-deferred files stay separate. main.lua, files.lua, attrib.lua, verybig.lua remain in @deferred_permanent — they're "we will never fix" (filesystem I/O, subprocess), categorically different from the new "fix before 1.0" backlog.
  • Single PR, mechanism only. Per-file triage happens in follow-up PRs so each set of range decisions can be reviewed independently.

Test plan

  • mix test — 1898 passed, 30 skipped (was 1894/30 before adding the 9 new tests in this PR)
  • mix test test/lua53_suite_test.exs --include lua53 — same 6 passing, 23 skipped
  • mix format --check-formatted
  • mix lua.suite --status — prints per-file summary, totals by category and issue
  • mix lua.suite --audit --timeout 8000 — reports ACTIVE/CANDIDATE/STALE/MOVED for each entry
  • New regression test confirms an assertion at line N reports line N in the error, both with and without an unrelated 1..3 skip range applied

Follow-ups

  • Per-file triage of the 19 :all entries — one PR per file (or small group), turning whole-file skips into specific ranges with reasons and (where applicable) tracking issues.
  • Optional: nightly CI job running mix lua.suite --audit to surface stale entries automatically.

Replace whole-file `@tag :skip` with per-file line ranges. Each suite
file can now run partially, with only the failing lines skipped, so
every assertion outside the skipped range contributes to the green
signal. The skip list itself becomes the conformance backlog ahead of
1.0.0.

- `Lua.SuiteRunner.run_file/2` accepts `:skip_ranges`, replacing each
  skipped line with a one-line comment to preserve line numbers
  (load-bearing for `Lua.VM.AssertionError`).
- `test/lua53_skips.exs` holds the per-file skip map. Each entry pairs
  a line range with a category, one-line reason, and optional GitHub
  issue number. `lines: :all` marks files awaiting initial triage.
- `test/lua53_suite_test.exs` generates one ExUnit test per suite file
  from the skip map. Test names carry the conformance debt count
  (e.g. `pm.lua (47 lines skipped, 3 ranges)`).
- `mix lua.suite --status` summarises the conformance backlog
  (totals by category and tracking issue).
- `mix lua.suite --audit` re-runs each file with each entry omitted
  to surface stale ranges and promotion candidates.
- Triage skill rewritten so §6.C produces a skip-range entry instead
  of a whole-file skip. Documents range edge cases (multi-line strings,
  local-decl coupling, if/then/end).

Zero behavior change for the existing suite: same 6 ready files pass,
the 19 previously-skipped files keep `lines: :all` (still tagged
`:skip`), and the 4 permanently-deferred files (filesystem I/O,
subprocess) stay in their own `@deferred_permanent` attribute.
- Validate skip file: raise when a file mixes `lines: :all` with
  specific ranges. The test driver treats `:all` as a hard skip and
  would silently drop the ranges. Loader lives on `Lua.SuiteRunner`
  so both the Mix task and the test module enforce it.
- Audit labels exceptions without a `:line` field (e.g.
  `Lua.VM.InternalError`, `Lua.CompilerException`) as
  `unknown line (StructName)` instead of bare `?`.
- Collapse four passes over the skip map in `--status` into one
  reducer; extract per-file printing for clarity.
- `range_to_string/1` handles non-default step ranges.
@davydog187 davydog187 merged commit f974726 into main May 27, 2026
5 checks passed
@davydog187 davydog187 deleted the feat/suite-line-range-skips branch May 27, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant