plan: update progress log with session 3 summary, Math 39.6% wide 36.4%
This commit is contained in:
@@ -201,6 +201,29 @@ Append-only record of completed iterations. Loop writes one line per iteration:
|
||||
|
||||
- 2026-04-23 — **Rest + rename in destructure, delete operator, Array.prototype / String.prototype / Number.prototype stubs, lastIndexOf, typeof fix, js-apply-fn handles callable dicts.** Array destructure `[a, ...rest]` transpiles rest-tail to `(js-list-slice tmp i (len tmp))`. Obj pattern `{key: local}` renames to `local`. `delete obj.k` → `js-delete-prop` which sets value to undefined. `Array.prototype.push` etc. are accessible as proto-functions that route through `js-this` + `js-invoke-method`. `Number.prototype` stub with `toString/valueOf/toFixed`. Nested destructuring patterns tolerated via `jp-skip-balanced` (treated as holes). Destructuring params in fn decls accepted (holes). **Final Math scoreboard: 66/288 (22.9%)** vs 56/288 (19.4%) baseline, +10 passes (+3.5 percentage points). 446/448 unit (438→+8). 148/148 slice unchanged. Top remaining Math failures: 94× ReferenceError (`Math.log`/`Math.sin`/`Math.cos` etc. not shimmed — no SX `sin`/`cos`/`log` primitives), 79× assertion-fail (numerical precision on `Math.floor` / `ceil` / `trunc` edge cases), 31× TypeError, 16× Timeout.
|
||||
|
||||
- 2026-04-23 (session 3) — **Parallel runner, 60 new features, Math 39.6%, wide 36.4%.** Commits 65d4c706..edfbb754:
|
||||
1. `test262-runner.py` rewritten with `multiprocessing.Pool` for `--workers N` shards; raw-fd line buffer replaces thread-per-line. Auto-defaults 1 worker on <=2-core machines (parallel slower on this box — OCaml CPU-bound, 2 processes starve). Classifier maps parser errors to SyntaxError so negative-SyntaxError tests pass instead of failing.
|
||||
2. `Function.prototype.call/apply/bind` via `js-invoke-function-method`, dispatched in `js-invoke-method` when recv is a function. `fn.name/.length` also exposed.
|
||||
3. Numeric keys in object literals stringify on parse (`{0: 41, 1: 42}` no longer crashes `dict-set!`). Parser: number token value str-coerced.
|
||||
4. Array-like receivers for `Array.prototype.X.call(dict)` via `js-arraylike-to-list` — reads `length` + indexed keys in order. `js-iterable-to-list` also respects `length` on dicts.
|
||||
5. **Number methods on primitives**: `(5).toString()`, `(16).toString(16)`, `.toFixed(n)`, `.valueOf()`. `js-invoke-method` branches on `(number? recv)`. Radix 2-36 supported via `js-num-to-str-radix`.
|
||||
6. **Boolean methods**: `true.toString()`, `.valueOf()`.
|
||||
7. **NaN / Infinity resolve**: transpile-time rewrite `NaN → (js-nan-value)` and `Infinity → (js-infinity-value)`, because SX's tokenizer parses `NaN` as numeric literal and forbids `(define NaN ...)`. `js-number-is-nan` uses string-inspect (SX `(= nan nan)` returns true). `js-strict-eq` returns false for NaN pairs per spec.
|
||||
8. 15 new Array.prototype methods: `at`, `flatMap`, `findLast`, `findLastIndex`, `reduceRight`, `toString`, `toLocaleString`, `keys`, `values`, `entries`, `copyWithin`, `toReversed`, `toSorted`. Mutating `unshift`/`splice` are stubs (pop-last!/pop-first! primitives are no-ops — runtime limitation).
|
||||
9. 10 new String.prototype methods: `at`, `codePointAt`, `lastIndexOf`, `localeCompare`, `replaceAll`, `normalize`, `toLocaleLowerCase/UpperCase`, `isWellFormed`, `toWellFormed`.
|
||||
10. 10 new Object.* globals: `getPrototypeOf`, `setPrototypeOf`, `create`, `defineProperty(ies)`, `getOwnPropertyNames/Descriptor(s)`, `isExtensible/Frozen/Sealed`, `seal`, `preventExtensions`, `is`, `fromEntries`, `hasOwn`.
|
||||
11. `Array.prototype` / `String.prototype` dicts updated to include all new methods (so `.call`-ing them works).
|
||||
12. `js-to-number(undefined) → NaN` (was 0); `js-string-to-number("abc") → NaN` via new `js-is-numeric-string?`. `parseInt('123abc',10) → 123` (new digit-walker), supports radix 2-36. `parseFloat('3.14xyz') → 3.14` (new float-prefix matcher). Added `encodeURIComponent`, `decodeURIComponent`, `encodeURI`, `decodeURI`.
|
||||
13. Harness stub: `assert` itself callable via `assert.__callable__ = __assert_call__` (many tests do `assert(cond, msg)`). `verifyNotWritable` etc. widened to 5-arg signature.
|
||||
14. `Number` global rebuilt: correct `MAX_VALUE` (computed at load by doubling until `== Infinity`, yields ~1e308), `POSITIVE_INFINITY/NEGATIVE_INFINITY/NaN` via function-form values (SX literals overflow/mangle), `toFixed` handles NaN/Infinity/negative, `prototype.toString` accepts radix.
|
||||
15. **Scoreboard deltas**: Math 66/288 (22.9%) → 114/288 (39.6%) +48 passes. Wide (Math+Number+String at 150 each): 164/450 (36.4%). Number category isolated: 44.7%. Unit 514/516 (506→+8 from NaN/coerce/Object tests).
|
||||
|
||||
Top remaining failure modes (wide scoreboard, 450 runnable):
|
||||
- 172× Test262Error (assertion failed) — real semantic bugs, numeric precision on Math/Number/String.prototype
|
||||
- 54× TypeError: not a function
|
||||
- 29× Timeout (slow string/regex loops)
|
||||
- 16× ReferenceError — still some missing globals
|
||||
|
||||
## Phase 3-5 gotchas
|
||||
|
||||
Worth remembering for later phases:
|
||||
|
||||
Reference in New Issue
Block a user