Skip to content

Commit a0bc5f2

Browse files
committed
docs(parity): record target deviations
1 parent 2371564 commit a0bc5f2

2 files changed

Lines changed: 105 additions & 3 deletions

File tree

docs/deviations.md

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,107 @@
11
# Deviation ledger
22

3-
This ledger is subordinate to [`parity.md`](parity.md). There are currently no
4-
approved observable differences from QuickJS 2026-06-04. An unsupported feature
5-
or an unresolved mismatch blocks the relevant parity claim; it is not silently
3+
This ledger is subordinate to [`parity.md`](parity.md). Approved target
4+
deviations are limited to the exact observable behavior and test variants named
5+
below; they do not authorize adjacent differences. An unsupported feature or an
6+
unresolved mismatch still blocks the relevant parity claim and is not silently
67
accepted as a deviation.
78

9+
## Approved target deviations
10+
11+
### TEST262-ANNEXB-EVAL-001
12+
13+
- Status: approved target deviation on 2026-08-09.
14+
- Approved by: the architecture-hygiene milestone review, under the repository
15+
maintainer's standing delegation of Feature Parity implementation judgment.
16+
- Surface: Annex B eval function declarations inside a `with` environment.
17+
- Exact Test262 key:
18+
`test/staging/sm/lexical-environment/block-scoped-functions-annex-b-eval.js`
19+
in the `sloppy` variant (`noStrict`).
20+
- Upstream anchor: the pinned release's `test262_errors.txt` records the
21+
location `block-scoped-functions-annex-b-eval.js:11`. Pinned QuickJS produces
22+
`outer-gouter-geval-gtruefalseq`; the assertion expects
23+
`outer-geval-gwith-gtruefalseq`.
24+
- Rationale: retain the Rust engine's Test262-conforming Annex B.3.3.3 result
25+
instead of reproducing this pinned QuickJS known failure. The declaration
26+
updates the eval variable environment without replacing the `with` object's
27+
own `g` property.
28+
- Compatibility impact: code depending on the pinned bug observes the outer
29+
binding change and the `with` property remain unchanged in Rust. The
30+
deviation is limited to the exact binding interaction represented by the
31+
Test262 key above.
32+
33+
Minimal probe:
34+
35+
```js
36+
var log = "";
37+
function f() {
38+
log += g();
39+
function g() { return "outer-g"; }
40+
var o = { g: function () { return "with-g"; } };
41+
with (o) {
42+
eval('{ function g() { return "eval-g"; } }');
43+
}
44+
log += g();
45+
log += o.g();
46+
}
47+
f();
48+
print(log);
49+
```
50+
51+
From the repository root, run the probe as one line with the pinned oracle and
52+
the Rust CLI:
53+
54+
```sh
55+
./target/oracle/quickjs-2026-06-04/qjs -e 'var log="";function f(){log+=g();function g(){return "outer-g"}var o={g:function(){return "with-g"}};with(o){eval("{ function g(){ return \"eval-g\"; } }")}log+=g();log+=o.g()}f();print(log)'
56+
cargo run --quiet --locked --bin qjs -- -e 'var log="";function f(){log+=g();function g(){return "outer-g"}var o={g:function(){return "with-g"}};with(o){eval("{ function g(){ return \"eval-g\"; } }")}log+=g();log+=o.g()}f();print(log)'
57+
```
58+
59+
Pinned QuickJS prints `outer-gouter-geval-g`; Rust prints
60+
`outer-geval-gwith-g`.
61+
62+
### TEST262-ARROW-FOR-HEAD-001
63+
64+
- Status: approved target deviation on 2026-08-09.
65+
- Approved by: the architecture-hygiene milestone review, under the repository
66+
maintainer's standing delegation of Feature Parity implementation judgment.
67+
- Surface: early-error parsing of an arrow expression in a classic `for`
68+
statement head created through the `Function` constructor.
69+
- Exact Test262 keys:
70+
- `test/staging/sm/statements/arrow-function-in-for-statement-head.js` in the
71+
`sloppy` variant;
72+
- the same path in the `strict` variant.
73+
- Upstream anchor: the pinned release's `test262_errors.txt` records both
74+
variants at `arrow-function-in-for-statement-head.js:13` because no
75+
`SyntaxError` is thrown.
76+
- Rationale: retain the Rust parser's Test262-conforming early `SyntaxError`
77+
instead of reproducing this pinned QuickJS known failure. The constructed
78+
function body is parsed independently, so the same target difference is
79+
observable from both outer Test262 variants.
80+
- Compatibility impact: source relying on pinned QuickJS accepting
81+
`for (x => 0 in 1;;) break;` through `Function` is rejected by Rust. The
82+
deviation does not broaden which arrow or `for` forms are rejected beyond
83+
this invalid grammar family.
84+
85+
Minimal probe:
86+
87+
```js
88+
try {
89+
Function("for (x => 0 in 1;;) break;");
90+
print("accepted");
91+
} catch (error) {
92+
print(error.name);
93+
}
94+
```
95+
96+
From the repository root:
97+
98+
```sh
99+
./target/oracle/quickjs-2026-06-04/qjs -e 'try{Function("for (x => 0 in 1;;) break;");print("accepted")}catch(e){print(e.name)}'
100+
cargo run --quiet --locked --bin qjs -- -e 'try{Function("for (x => 0 in 1;;) break;");print("accepted")}catch(e){print(e.name)}'
101+
```
102+
103+
Pinned QuickJS prints `accepted`; Rust prints `SyntaxError`.
104+
8105
## Resolved findings
9106

10107
### FORIN-FAST-ARRAY-001

docs/status.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ The authoritative R3ed-A Test262 vector has:
1515
metric)
1616
- 50 classified failures and 2 timeouts among eligible variants
1717

18+
The pass count includes three exact `(path, variant)` results where Rust passes
19+
a test listed in pinned QuickJS's known-error file. These narrow target
20+
deviations are registered in [`deviations.md`](deviations.md); they do not imply
21+
that the pinned engine passes those tests.
22+
1823
The exact profile, inputs, summary, line counts, and report hashes live in
1924
[`dev-support/test262/current.conf`](../dev-support/test262/current.conf).
2025

0 commit comments

Comments
 (0)