parity probe: cross-tier corpus + fix python remainder + asm modulo
New: wasm/tests/parity-cross-tier.mjs runs the parity-corpus.mjs (216
test cases tagged by whitepaper section / R7RS concept) against three
tiers — native python (reference), c-wasm, asm-wasm — and fails on any
unknown divergence. Known gaps live in KNOWN_DIVERGE so the table stays
green while the bignum / call/cc / etc. work proceeds.
Wired into `make wasm-test` so a regression against any spec claim gets
caught before merge.
Bugs caught and fixed:
- python remainder: was `signed_a % signed_b * sign(a)`, which double-
applied the sign of a (python's % floors) — gave -3 for (-17, 5)
instead of the R7RS-correct -2. Now uses abs() on both sides.
- asm-wasm modulo: was i32.rem_s (truncated, remainder semantics)
where R7RS modulo wants sign of divisor. Added the "if rem and
divisor disagree on sign, add divisor" branch.
Cross-tier numbers after fix:
216 passing
3 known diverge: expt-2-100, expt-3-50, big-arith — all asm-wasm
(no bignums on the asm tier yet; whitepaper §2.1 claim still open)
0 fail
REPL layout: body is now the scroll container, prompt-bar is
position:fixed at the viewport bottom so it doesn't get pushed off
screen by a long transcript. Empty space above the prompt on a fresh
session reads like a terminal.
All other tests still pass: 20 unit, 8 integration, 11 functional.
This commit is contained in:
parent
c50a9da7e8
commit
7ea65dba21
17 changed files with 357 additions and 38 deletions
|
|
@ -1,11 +1,12 @@
|
|||
/* lumbda repl — grid-only layout. Inherits palette + base from style.css. */
|
||||
|
||||
body.repl {
|
||||
display: grid;
|
||||
/* header (fixed) scrolling-stream (everything else) */
|
||||
grid-template-rows: auto 1fr;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
/* Body scrolls naturally. The prompt-bar is position: fixed so it
|
||||
* stays glued to the viewport bottom; the transcript reserves bottom
|
||||
* padding equal to the prompt-bar height so its last line isn't hidden
|
||||
* underneath. */
|
||||
min-height: 100vh;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* ─── Lock screen overlay ──────────────────────────────────────── */
|
||||
|
|
@ -176,12 +177,13 @@ body.repl {
|
|||
* fresh sessions show the prompt up near the top and it drifts down
|
||||
* with each new entry. */
|
||||
.repl-stream {
|
||||
overflow: auto;
|
||||
padding: 0.5rem 1rem 0.8rem;
|
||||
padding: 0.5rem 1rem 0;
|
||||
background: var(--code-bg);
|
||||
display: grid;
|
||||
grid-template-rows: auto auto auto;
|
||||
align-content: start;
|
||||
/* Leave room for the fixed prompt bar at the viewport bottom. */
|
||||
padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0));
|
||||
}
|
||||
.transcript {
|
||||
font-family: var(--mono);
|
||||
|
|
@ -232,12 +234,16 @@ body.repl {
|
|||
/* ─── Prompt bar ───────────────────────────────────────────────── */
|
||||
|
||||
.prompt-bar {
|
||||
position: fixed;
|
||||
left: 0; right: 0; bottom: 0;
|
||||
z-index: 50;
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
gap: 0.4rem;
|
||||
align-items: center;
|
||||
padding: 0.3rem 0;
|
||||
background: transparent;
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--code-bg);
|
||||
border-top: 1px solid var(--rule);
|
||||
}
|
||||
.prompt-bar .prompt-sigil {
|
||||
color: var(--green);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue