feat(iterator): implement Iterator.prototype.includes#1026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Web Tooling Benchmark
18 pinned Web Tooling workloads; 18 workloads produced at least one Goccia sample. Raw results from 1 sample per workload; full stdout/stderr for failures and min/max/CV stay in the |
Suite TimingTest Runner (interpreted: 11,543 passed; bytecode: 11,543 passed)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Test runner worker shutdown frees thread-local heaps in bulk; that shutdown reclamation is not counted as GC collections or collected objects.
Benchmarks (interpreted: 439; bytecode: 439)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Benchmark runner performs explicit between-file collections, so collection and collected-object counts can be much higher than the test runner.
Boot
Empty-script ( Measured on ubuntu-latest x64. |
Benchmark Results439 benchmarks · PR vs same-runner Interpreted: 🟢 26 improved · 🔴 45 regressed · 368 unchanged · avg -0.8% Typical per-run noise (median variance): interpreted ±1.7%, bytecode ±2.0%. Deltas within noise overlap and read as unchanged. arraybuffer.js — Interp: 🔴 1, 13 unch. · avg -0.5% · Bytecode: 🟢 3, 11 unch. · avg +1.6%
arrays.js — Interp: 🟢 1, 🔴 1, 17 unch. · avg -0.6% · Bytecode: 🟢 2, 17 unch. · avg +1.5%
async-await.js — Interp: 6 unch. · avg -1.3% · Bytecode: 🟢 1, 5 unch. · avg +2.3%
async-generators.js — Interp: 2 unch. · avg +0.4% · Bytecode: 🔴 1, 1 unch. · avg -2.4%
atomics.js — Interp: 🔴 1, 5 unch. · avg -3.4% · Bytecode: 🔴 1, 5 unch. · avg -0.8%
base64.js — Interp: 10 unch. · avg -0.7% · Bytecode: 🔴 1, 9 unch. · avg +0.0%
classes.js — Interp: 🟢 1, 30 unch. · avg -0.7% · Bytecode: 🟢 2, 🔴 3, 26 unch. · avg -0.2%
closures.js — Interp: 🔴 1, 10 unch. · avg -2.1% · Bytecode: 🟢 2, 9 unch. · avg +2.4%
collections.js — Interp: 🔴 1, 11 unch. · avg -1.9% · Bytecode: 🟢 1, 11 unch. · avg +1.2%
csv.js — Interp: 🟢 1, 12 unch. · avg -0.9% · Bytecode: 13 unch. · avg +0.2%
destructuring.js — Interp: 🟢 1, 21 unch. · avg -1.1% · Bytecode: 🟢 1, 🔴 2, 19 unch. · avg -0.1%
fibonacci.js — Interp: 🔴 1, 7 unch. · avg -0.9% · Bytecode: 8 unch. · avg -2.0%
float16array.js — Interp: 🟢 3, 🔴 3, 26 unch. · avg -1.2% · Bytecode: 🟢 4, 🔴 8, 20 unch. · avg -2.4%
for-in/for-in.js — Interp: 🟢 1, 2 unch. · avg +3.7% · Bytecode: 3 unch. · avg +0.7%
for-of.js — Interp: 🔴 2, 5 unch. · avg -1.3% · Bytecode: 🔴 2, 5 unch. · avg -1.1%
generators.js — Interp: 🟢 1, 3 unch. · avg +1.0% · Bytecode: 4 unch. · avg +3.2%
intl.js — Interp: 🔴 1, 5 unch. · avg -3.2% · Bytecode: 🔴 1, 5 unch. · avg -0.2%
iterators.js — Interp: 🔴 17, 25 unch. · avg -4.4% · Bytecode: 🔴 9, 33 unch. · avg -1.0%
json.js — Interp: 🟢 2, 21 unch. · avg +1.2% · Bytecode: 🟢 6, 17 unch. · avg +1.9%
jsx.jsx — Interp: 🟢 1, 20 unch. · avg +1.9% · Bytecode: 🟢 2, 🔴 4, 15 unch. · avg +1.8%
modules.js — Interp: 9 unch. · avg -1.7% · Bytecode: 🟢 1, 8 unch. · avg -0.9%
numbers.js — Interp: 12 unch. · avg -0.8% · Bytecode: 12 unch. · avg +0.5%
objects.js — Interp: 7 unch. · avg -2.6% · Bytecode: 7 unch. · avg -3.4%
promises.js — Interp: 🟢 1, 🔴 2, 9 unch. · avg -1.6% · Bytecode: 🟢 1, 🔴 2, 9 unch. · avg +1.2%
property-access.js — Interp: 🟢 1, 4 unch. · avg +2.3% · Bytecode: 5 unch. · avg +0.3%
regexp.js — Interp: 🔴 1, 12 unch. · avg -2.5% · Bytecode: 🟢 1, 12 unch. · avg +4.0%
strings.js — Interp: 🟢 2, 17 unch. · avg +0.3% · Bytecode: 🟢 2, 🔴 1, 16 unch. · avg +0.4%
temporal.js — Interp: 6 unch. · avg +0.3% · Bytecode: 6 unch. · avg +2.0%
tsv.js — Interp: 9 unch. · avg +0.1% · Bytecode: 🟢 1, 🔴 2, 6 unch. · avg -2.0%
typed-arrays.js — Interp: 🟢 3, 🔴 6, 13 unch. · avg -10.3% · Bytecode: 🟢 2, 🔴 12, 8 unch. · avg -14.9%
uint8array-encoding.js — Interp: 🔴 7, 11 unch. · avg -4.0% · Bytecode: 🟢 10, 🔴 1, 7 unch. · avg +26.5%
weak-collections.js — Interp: 🟢 7, 8 unch. · avg +22.9% · Bytecode: 🟢 5, 🔴 6, 4 unch. · avg +2.6%
Deterministic profile diffDeterministic profile diff: no significant changes. Measured on ubuntu-latest x64. Each PR run also builds the |
AWFY Results
Geomean Ratios
14 pinned AWFY benchmarks. Medians from 5 interleaved samples per engine; raw JSON includes min/max/CV and is attached as the |
JetStream 3 Performance Barometer
Geomean reference ratio: QuickJS 27.48×; Node.js 320.48×. 1.00× means aligned; values above 1.00× mean Goccia was proportionally slower after normalizing JetStream’s higher-is-better score. This is a directional barometer across runtimes with different goals, not a product ranking. Raw samples and failure details remain in the |
test262 Conformance
Areas closest to 100%
Per-test deltas (+0 / -0 / timeout +3 / -1)New timeouts (3):
Resolved timeouts (1):
Steady-state failures and timeouts are non-blocking; PASS → non-timeout failure transitions fail the conformance gate. Measured on ubuntu-latest x64, bytecode mode. Areas grouped by the first two test262 path components; minimum 25 attempted tests, areas already at 100% excluded. Δ vs main compares against the most recent cached |
Summary
Iterator.prototype.includes(searchElement, skippedElements?)algorithm on the shared per-realm iterator prototype.IsSameValueZeroseam while preserving proposal-defined validation, consumption, abrupt completion, andIteratorClosebehavior.Goccia.proposal, and update the public language and built-in documentation.Validated against
tc39/proposal-iterator-includesStage 3 commit2ce6cbf99a1385465da11ee1ebcd44332134d08e, clausesec-iterator.prototype.includes. The repository's pinned Test262 SHA is9e61c12835c5e4a3bdba93850427e6742c4f64c4; it contains no Iterator Includes cases. Relevant upstream tests remain unmerged in test262 PR #5031, so this PR does not claim pinned Test262 coverage.Closes #1002
Testing
Commands run:
./build.pas --clean testrunner./build.pas testrunner./build/GocciaTestRunner tests/built-ins/Iterator/prototype/includes.js./build/GocciaTestRunner tests/built-ins/Iterator/prototype/includes.js --mode=bytecode./build/GocciaTestRunner tests/built-ins/Iterator./build/GocciaTestRunner tests/built-ins/Iterator --mode=bytecode./build/GocciaTestRunner tests— 1,443 files; 11,543 tests; 25,825 assertions passed./build/GocciaTestRunner tests --mode=bytecode— 1,443 files; 11,543 tests; 25,825 assertions passedbun run scripts/check-test-structure.ts./format.pas --check