Skip to content

7.14 Events and input: dispatch with activation behavior, UI events, event handlers, user activation, default actions (builds on #298) - #300

Open
atiernan wants to merge 42 commits into
mainfrom
claude/events-input
Open

atiernan wants to merge 42 commits into
mainfrom
claude/events-input

Conversation

@atiernan

@atiernan atiernan commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Phase 7 item 7.14, events and input. Builds on #298 (renderer pipeline: the page hosted in the renderer with an event loop, which contains the WebIDL bindings and scripting); until #298 merges this PR's diff includes its commits.

What works end to end

A click Input is hit-tested through layout to an element and becomes mousemove, mousedown, mouseup, click at it; a scroll Input is a cancelable wheel event and then a scroll event; a key Input goes to the focused element. Default actions run when the event was not canceled: a link is followed (the existing Navigate, or a javascript: URL run by the page), a submit button submits its form (Navigate for GET, the kernel's Submit for POST, through clazel-forms' proven submit_exec), reset, checkbox, radio, label, Tab / Enter / Space / Backspace / typing with beforeinput and input.

  • Dispatch (clazel-web/src/events.rs, DOM §2.9): the activation target, legacy-pre-activation behavior before the listeners, activation or legacy-canceled-activation behavior after the flags are unset. Capture / target / bubble, stopPropagation, stopImmediatePropagation, preventDefault and passive listeners were already there; the "events are recorded, not dispatched" deviation is gone (it was stale: flush_events already dispatched).
  • UI events: UIEvent, MouseEvent, WheelEvent, KeyboardEvent, FocusEvent, InputEvent with constructors, dictionaries and init* methods; focus (blur, focusout, focus, focusin, change on leaving a changed text control), document.activeElement, focus(), blur(), click(), tabIndex, createEvent, window.event.
  • Event handlers (HTML §8.1.8): the on* IDL attributes (generated: Platform::event_handler_get / event_handler_set) and content attributes, compiled on first use, with the handler's place among the listeners where it was first set, return false cancels, body handlers are the Window's.
  • User activation (HTML §6.4): clazel-web/src/user_activation.rs, notified by mousedown and keydown (not Escape) before dispatch, navigator.userActivation, consume_user_activation. The hook for 7.16's popup rule is described in that module: the kernel's own record of the Input it forwards is the guarantee, and clazel-kernel is not touched.

Tests

  • clazel-web/tests/activation.rs (7), user_activation.rs (5), ui_events.rs (48): hand-made trees and parsed documents driven through the input API, expectations written from the standards.
  • clazel-web/tests/wpt_events.rs: 64 vendored WPT dom/events/ pages through a stand-in for testharness.js (the engine cannot run the real one yet): 38 pass (109 subtests), 26 are listed with the reason each. uievents/ is not vendored; dom/events/scrolling/ and non-cancelable-when-passive/ need layout/a window and are not run.
  • clazel-renderer: 5 new tests (click runs the handler of the element under the pointer and the page repaints; a canceled click is not a navigation; submit buttons give Navigate and Submit; canceled wheel and scroll event; keys reach the focused input). All other tests still pass.

Changes outside clazel-web (read before merging)

  • Generator / bindings (xtask/src/bindings, clazel-webidl): event handler attributes are generated (previously left out); UIEvent, MouseEvent, WheelEvent, KeyboardEvent, FocusEvent, InputEvent, UserActivation are exposed; an operation of more than 7 parameters gets its arguments in one struct (so clippy's too_many_arguments stays on). bindings.rs is regenerated: whoever merges second into the DOM-API branch re-runs cargo xtask bindings.
  • Vendored IDL: pointerevents.idl added at the pinned webref commit (the only file with MouseEvent and WheelEvent); MouseEvent and MouseEventInit leave the generator's EXTERNAL list; the inventory is regenerated.
  • Shared files touched, kept small: page/mod.rs (one ui field, one Object::UserActivation, PageHooks::submit, HookCall::Submit, the two Platform handler methods), page/node.rs (createEvent and activeElement / hasFocus in impl DocumentImpl; the empty impl HTMLElementImpl for Page {} is replaced by page/input.rs's click, focus, blur, tabIndex: expect a trivial conflict with the 7.13 branch if it fills that impl), page/window.rs (navigator.userActivation), scripting/bound.rs (window.event, the initial handler scan). clazel-web now depends on clazel-forms (Cargo.lock +1 line).
  • Not touched: clazel-kernel, clazel-ipc, clazel-sys, clazel-js-*, docs/STATUS.md, SPEC-REVIEWS, SYS-AUDITS; no tier raised; no mutation, test or theorem removed.

Not done, and deviations

  • Handler content attributes compile with the global scope only (the engine has no with or Function()): the element, form and document scope chain is missing. onerror gets one argument: there is no ErrorEvent, so a listener's exception is logged, not fired at the window (Event-dispatch-throwing.html is listed).
  • submit is a plain Event (no SubmitEvent.submitter); constraint validation is not run; a link's or form's target is ignored (this tab; 7.16's OpenTab).
  • Text editing has no caret or selection (typing appends; Backspace deletes the last character). HTMLInputElement, HTMLFormElement and the other control interfaces are not exposed (7.13): the control state is Page::control_value / control_checked, over clazel-forms' control state table, for 7.13's IDL attributes to read and write.
  • mouseover, mouseout, mouseenter, mouseleave, dblclick, contextmenu, auxclick, pointer events, composition and drag events are not fired; main button only; hit testing ignores z-index, clipping and pointer-events.
  • The host's window sends no key Input and the Input message has no modifiers; the renderer reads key as a Unicode scalar (8, 9, 13, 27, 127 for the control keys, 0xF700-0xF703 for arrows), documented in the renderer README.
  • Miri timing of the new tests could not be measured locally (each builds a runtime, as the existing ones do); wpt_events runs 2 of its 64 pages under Miri, as wpt_execution_timing does.

Linux sandbox (seccomp) fix, and an open item

#298's renderer was killed by the Linux seccomp filter (SIGSYS) as soon as a page ran a script of any size: the engine parses a source over 64 code points and compiles a program over 256 AST nodes on a helper thread (clazel-js-syntax/src/exec.rs, clazel-js-vm/src/compile.rs), and the filter has no clone. This PR adds an off-by-default switch (clazel_js::set_inline_parsing, an AtomicBool in clazel-js-syntax) that makes those two helpers run on the calling thread, and the renderer's main turns it on before sandbox::enter(). A renderer thread made before the sandbox does not work (after unshare(CLONE_NEWPID) a CLONE_THREAD clone is EINVAL; unshare(CLONE_NEWUSER) fails with a second thread), so the renderer stays single-threaded; the PID namespace is kept. No change to clazel-sys or the seccomp allowlist. Three test binaries (clazel-js-syntax, clazel-js-vm, clazel-js tests/inline.rs) fail if a thread is made with the switch on. Confirmed on Linux (arm64, privileged Docker): cargo test -p clazel --test adversarial passes.

Open item: stack per nesting level, measured (release build, macOS arm64, parse + compile on a thread with a given stack, inline switch on). Smallest stack at which a source nested N deep parses and compiles, at 64 KiB steps (coarser steps for the others):

pattern (N = 1000) smallest stack that worked per level
[[[...1...]]] 1088 KiB about 1.1 KiB
(((...1...))) 1088 KiB about 1.1 KiB
{{{...}}} blocks 480 KiB about 0.5 KiB
x=>x=>...1 1984 KiB about 2 KiB
function f(){function f(){...}} N=1000 is refused as too deep (parse-error); the deepest accepted is N=511, which needs at most 1024 KiB about 2 KiB

So MAX_DEPTH 1024 fits in the 8 MiB main-thread stack with a margin of about 4x for the worst pattern measured (arrow functions, about 2 MiB). Not measured: mixed nesting, other targets (Linux x86-64 frames may differ), and the interpreter's own recursion. The limits are unchanged: the renderer will pick its value once #296's nesting_depth lands.

Verification

cargo xtask verify --changed origin/claude/phase7-integration: see the comment below. CI's full verification (proofs wait for approval) has not run.

🤖 Generated with Claude Code

atiernan and others added 28 commits November 23, 2026 10:46
dispatch_seq folds the spec's one-token step over a sequence of tokens;
incremental_new_ensures and incremental_pump_ensures state what the
incremental driver (exec::incremental, next commit) is to meet: the
initial parser, and a pump that leaves the parser where the spec's step
takes it over some tokens, returning for actions, at the insertion point,
or once stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…shared natives

WebIDL attributes are accessor properties on prototypes (WebIDL §3.7.6),
so item 7.12 needs them in the engine:

- clazel-js-vm: an accessor property is an ACCESSOR attribute bit and a
  Cell::Accessor pair in its slot. OrdinaryGet (§10.1.8.1 steps 4 to 8)
  and OrdinarySetWithOwnDescriptor (§10.1.9.2 steps 4 to 7) call the
  getter and setter with the receiver, for property reads and writes,
  global identifiers and primitive bases; ValidateAndApplyPropertyDescriptor
  (§10.1.6.3) gets its accessor steps (2.c, 5.c, 5.d, 6.a, 6.b); object
  literal getters and setters (DefineMethod forms 1 and 2) run; the
  instanceof operator (§13.10.2, OrdinaryHasInstance §7.3.21) runs.
- clazel-js-builtins: ToPropertyDescriptor (§6.2.6.5) reads get and set.
- clazel-js: define_property takes accessors; get_own_property;
  delete_property, new_array, new_array_from and is_array over the VM's
  arrays; shared_function, a re-entrant native for Sync closures (open
  question 14's proposal, beside function, which keeps its Busy rule).

The Test262 runners gain two classifications for tests that instanceof
now reaches and that stop at the missing eval (fail stays 0). The API
test that listed arrays and delete_property as NotImplemented now asserts
that they work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scope::function and define_method take Fn + Send + Sync, and the table
holds each closure in an Arc that a call clones, so JavaScript that calls a
native function while it is running runs it again, nested, instead of
getting Error::Busy. HTML's document.write needs this: it runs the parser,
which runs a script, which calls document.write (item 7.15). The test that
pinned Busy now checks a three-deep re-entrant call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spec and the contracts first (CLAUDE.md rule 3); the exec functions
and their theorems follow in the next commit.

- set_data: DOM §4.10 "replace data" with offset 0 and count the node's
  length, which is what CharacterData's data setter (and textContent and
  nodeValue on character data) do. Requires a Text, Comment or
  ProcessingInstruction node.
- set_wrapper: the wrapper slot Phase 4 reserved becomes the bindings'
  object id; nothing else changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… step's contract

exec::incremental::Incremental is Phase 4's "a driver, not a restructured
spec": the proven tokenizer and step over an input stream that grows at
the insertion point (document.write), pausing after every step that asks
for an action (ScriptReady), at the insertion point, and at the end of an
input that is not closed (a document.open parser). Verus proves that every
call meets its callee's contract, that the invariant holds after every
method, that every pump ends, and incremental_pump_ensures: the parser after
a pump is the parser before given some tokens by the spec's step. It is not
proven equal to parse; the html5lib document cases run through it and give
parse_real's tree, and cases naming no scripting flag are now checked with
scripting on as well (all 1,931 give the same tree).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HTML's "clean up after running script" performs a microtask checkpoint when
the last script on the stack returns; a host that runs a page's scripts
from one scope (item 7.15) reaches the job queue there. Runtime::run_jobs
now calls it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exec functions meet the contracts of the previous commit, and Verus
proves them (477 verified, 0 errors locally):

- theorem_set_data_wf and theorem_set_data_host_acyclic: replacing all of
  a character data node's data keeps wf and host_acyclic, the node keeps
  its kind (and a processing instruction its target), its data is the new
  data, and every other node is unchanged.
- theorem_set_wrapper_wf and theorem_set_wrapper_host_acyclic, through
  lemma_set_wrapper_wf (no clause of wf_with reads a wrapper): the slot
  holds the given id and nothing else changes.

Two mutations, each killed with a certificate: set-data-keeps-old and
set-wrapper-ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ppers, DOMException

Item 7.12 over clazel-js's public API:

- xtask/src/bindings/glue.rs: cargo xtask bindings now also writes
  src/generated/bindings.rs from the vendored IDL: for each exposed
  interface a trait the platform implements (IDL values as Rust types;
  every method defaults to a NotSupportedError naming the member), a
  native function per member (this check, argument count, conversions,
  overload resolution, the call, the result), and the installation of
  interface objects, prototypes, constants, attributes and operations
  (WebIDL §3.7). Dictionaries, enumerations and unions become Rust types
  with their conversions (§3.2.18, §3.2.19, §3.2.24). Members it cannot
  bind are listed with the reason in the file's header. check keeps
  failing when the file is stale.
- convert.rs: §3.2 for every type used (ConvertToInt with EnforceRange
  and Clamp, float and double, DOMString with LegacyNullToEmptyString,
  ByteString, USVString, object, interface, callback interface and
  function, sequence from an Array).
- overload.rs: the effective overload set and the overload resolution
  algorithm (§2.5.8, §3.6).
- platform.rs: one wrapper per platform object, made on first access with
  its unforgeable members and kept by the platform; brand checks;
  [SameObject].
- install.rs: [Replaceable], [PutForwards]; exception.rs: DOMException.
- tests/bindings.rs: idlharness-style checks over a small platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripting::Page parses a document with the scripting flag on through
clazel-treebuilder's incremental driver and runs its scripts through
clazel-js's public API, its state in the engine's Host:

- "prepare the script element" (HTML 4.12.1.1) on ScriptReady: the type
  string, classic and module scripts, inline and external ones (fetched by
  the embedder: take_requests and fetched), async, defer, the pending
  parsing-blocking script, nomodule, event/for; mark as ready; execute the
  script element with document.currentScript; create and run a classic
  script, reporting exceptions, with a microtask checkpoint when the last
  script returns;
- the text mode's end tag script steps (script nesting level, parser pause
  flag, insertion point), the tokenizer blocked on a parsing-blocking
  script, abort a parser, and the end (deferred scripts, DOMContentLoaded,
  the load event's wait for async scripts);
- document.write, writeln, open and close, as edits of the input stream at
  the insertion point;
- module scripts' HTML half (module map, fetch a single module script,
  HostLoadImportedModule, fetch the descendants of and link, run a module
  script), which ends in the engine's NotImplemented today;
- evaluate a javascript: URL, and performance.now() coarsened to 100 us;
- the minimum globals before 7.12's bindings: document (write, writeln,
  open, close, currentScript), performance.now, a wrapper per node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion-timing pages

tests/scripting.rs checks each algorithm step: inline, external, async and
defer ordering, the parsing-blocking script, document.write (nested, split
tags, from external scripts), open and close, currentScript, javascript:
URLs, module scripts reaching the engine, performance.now's coarsening,
and a meta charset's reparse. It runs the six html5lib scripted_*.dat
tree-construction cases (2 pass, 4 listed: they need 7.12's DOM methods)
and 21 vendored WPT execution-timing pages with a stand-in for
testharness.js and testlib.js, which the engine cannot run yet (17 pass,
4 listed: eval, Location, DOM methods, timers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A click on a link whose URL is a javascript: URL sends no Navigate: the URL
is the page's to evaluate in its own renderer (item 7.15), and the kernel
never sees it. This renderer does not host scripting::Page yet, so the
click does nothing for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Page is the clazel-js host and clazel-webidl's platform (items 7.12, 7.13,
and 7.15's Window, Location, History, Navigator and console):

- Node, Document, DocumentType, DocumentFragment, CharacterData, Text,
  Comment, Element, NodeList, HTMLCollection, DOMTokenList and the exposed
  HTML element interfaces, over clazel-dom's proven operations (pre-insert,
  replace, replace all, remove, clone, attribute changes, set_data), with
  their preconditions checked first. A node's wrapper is kept in
  clazel-dom's wrapper slot, the others' in a side table.
- EventTarget, Event, CustomEvent, AbortController and AbortSignal over the
  events module's dispatch; listeners are JS values kept by handles, and a
  listener can read the event and change listeners while it runs; its
  exception is reported to the host's log. events::TargetId gains Object
  for targets that are not nodes.
- Window, Location (navigation through PageHooks::navigate), History
  (pushState and replaceState with "can have its URL rewritten", through
  PageHooks::update_url), Navigator with a fixed user agent string naming
  only Clazel, and console, written by hand (console.idl is not vendored),
  which logs to the host and never to the page.
- tests/bindings.rs runs script against parsed documents, with checks
  transcribed from WPT's dom/ and html/ tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Miri

The run took 201 s under Miri with every 7th page; two pages keep it near
130 s, well under the 300 s limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Miri found it: 4294967297 converted to long gave 0 under Miri and 1
natively, because step 10 used f64 %. Step 10 is now computed exactly on
the double's significand and exponent, and [Clamp]'s round-half-to-even
reads the parity of an integer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides made native closures re-entrant. One API: every closure is an
Arc<NativeFn> that is Send + Sync (#294's design); Scope::shared_function
(#295's name) stays as an alias of Scope::function, and SharedNativeFn is
an alias of NativeFn. Cargo.toml dependencies are the union.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne host (7.15, 7.12)

HTML's script processing and the WebIDL platform objects were each a
clazel-js Host. A runtime has one, so scripting's state is now a field of
page::Page (the parser's tree moves to Page::arena when the parser is done)
and Page forwards the module-loading and rejection hooks to it. Both sides'
tests pass unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vent loop (7.15, 7.17)

Page::for_document takes the renderer's parsed tree, reaches its script
elements in tree order through HTML's script processing, and installs the
bindings with the members HTML adds (timers, queueMicrotask,
requestAnimationFrame, performance.now, localStorage, document.write and
cookie, readyState, currentScript). The event loop drives timers and
microtasks, lifecycle events reach addEventListener listeners, and cookies,
storage and navigation go through PageHooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The graphical renderer hands the parsed tree to clazel-web's page and keeps
it running: scripts before the first paint, FetchScript for external ones,
timers and microtasks between messages, a restyle, layout and paint after a
script changed the document, a clicked javascript: link run in the page,
Navigate and UpdateUrl from location and history, and cookies and storage as
the kernel's messages waiting for their answers. The socket is shared with
the natives (page::link) and read with a timeout where the host allows one.

Phase 2's line scripts are retired: a kind 1 commit is JavaScript, run in an
empty document, with the same messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…un are JavaScript

Phase 2's kind 1 format is deleted with its parser. The host tests, the
adversarial run, the exit demo and the WPT cookies/ run send the same
messages from JavaScript; the cookie run writes any cookie text as a string
literal, so no case is skipped for not fitting a line. The bad-script test
now expects an uncaught ReferenceError on stderr and exit status 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the bindings (7.14)

- Vendor webref's pointerevents.idl (the only file that has MouseEvent and
  WheelEvent at the pinned commit), and drop MouseEvent and MouseEventInit
  from the generator's EXTERNAL list.
- The generator gives an event handler IDL attribute (EventHandler,
  OnErrorEventHandler, OnBeforeUnloadEventHandler: HTML 8.1.8.1) a getter and
  setter that call Platform::event_handler_get and event_handler_set with the
  event type's name, as [Reflect] ones call reflect_get; convert::event_handler
  is the [LegacyTreatNonObjectAsNull] conversion. Previously these attributes
  were left out.
- Expose UIEvent, MouseEvent, WheelEvent, KeyboardEvent, FocusEvent,
  InputEvent and UserActivation.
- Regenerated bindings; the model's counts and the test mock follow.

clazel-web does not build against this commit alone: the next one
implements the new traits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DOM 2.9 dispatch gains the activation target and the legacy-pre-activation,
activation and legacy-canceled-activation behaviors; the page implements UIEvent,
MouseEvent, WheelEvent, KeyboardEvent, FocusEvent, InputEvent and UserActivation, event handlers
(HTML 8.1.8: IDL attributes and content attributes, compiled on first use), user
activation (HTML 6.4), focus, and the input API the renderer calls: click, key,
wheel, scroll. Default actions: following a link, submitting and resetting a form
(through clazel-forms' submit_exec), checkboxes, radios, labels, Tab, Enter and
implicit submission. The "events are recorded, not dispatched" note is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(7.14)

A click Input is hit-tested through layout to an element and dispatched as
mousemove, mousedown, mouseup and click with the default actions (links, forms,
checkboxes, focus); a scroll Input is a cancelable wheel event and, if the page
scrolls, a scroll event; a key Input goes to the focused element. A page repaints
only if a listener or a javascript: URL ran. A POST form is the kernel's Submit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om/events through a stand-in harness (7.14)

- window.event is the event whose listener is running (DOM 2.10 inner invoke).
- document.createEvent for Event, CustomEvent, UIEvent, MouseEvent, KeyboardEvent
  and FocusEvent (DOM 4.5's table; the other interfaces are NotSupportedError).
- Event.timeStamp reads the page's clock, as performance.now() does.
- tests/wpt_events.rs runs 64 vendored dom/events pages with a stand-in for
  testharness.js: 38 pass (109 subtests), 26 are listed with the reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ppy's too_many_arguments

initMouseEvent and initKeyboardEvent have 15 and 10 arguments, more than clippy's
too_many_arguments (7), which the workspace keeps. The generator gives an
operation of more than 7 parameters one struct for its arguments. clippy and
tests of clazel-web, clazel-webidl and clazel-renderer are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan changed the base branch from claude/phase7-integration to main November 23, 2026 21:41
atiernan and others added 2 commits November 23, 2026 21:47
… sandbox; the engine makes no thread of its own

The Linux seccomp filter has no clone, so the engine's helper threads (a
256 MiB-stack thread for any source over 64 code points to parse and any
program over 256 AST nodes to compile) killed the sandboxed renderer with
SIGSYS as soon as a page ran a script of any size.

- clazel-js-syntax and clazel-js-vm: an off-by-default switch
  (exec::set_inline, clazel_js::set_inline_parsing) makes the two helpers run
  on the calling thread; a counter lets tests see that no thread is made.
- clazel-renderer: sandbox::enter_process (no_new_privs and the namespaces on
  Linux; Seatbelt on macOS, which confines every thread; the AppContainer
  check on Windows, which is the process's) on the only thread, then the
  renderer thread (256 MiB stack, inline parsing on) is made and calls
  enter_thread (Landlock, and the seccomp filter on every thread with
  SECCOMP_FILTER_FLAG_TSYNC, so the main thread, which only joins, is filtered
  too). The order differs from "spawn, then enter from inside" because
  unshare(CLONE_NEWUSER) fails in a multithreaded process, and the renderer's
  filter was installed without TSYNC (only the GPU process's was).
- Tests: three binaries (syntax, vm, clazel-js) fail if a thread is made with
  the switch on, and show the default still makes one.

No clazel-sys or allowlist change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… renderer's own stack

The thread made before the sandbox cannot be made: after unshare(CLONE_NEWPID)
clone with CLONE_THREAD fails with EINVAL (Linux repro: "cannot make the
renderer thread: Invalid argument"), and unshare(CLONE_NEWUSER) fails once
there is a second thread, so the thread can be made neither before nor after
the namespaces. The renderer is single-threaded again, with the engine's
inline-parsing switch on (so no helper thread, no SIGSYS). A source nested at
the parser's limit may overflow the main stack; that ends the renderer, inside
the sandbox. enter_process and enter_thread stay (enter() is both).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Linux the standard library reads a UnixStream with recv, which is the
recvfrom system call; the renderer's seccomp allowlist has read and leaves
recvfrom out, so a graphics renderer was killed with SIGSYS on its first
read (CI: browse_gpu, sheets, reftests). Set the timeout through the
UnixStream before the sandbox, then read through a File on the same
descriptor; SO_RCVTIMEO applies to read as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan temporarily deployed to full-verification November 23, 2026 23:13 — with GitHub Actions Inactive
…tays

Each builds a page with every generated WebIDL interface: about 290 s of
Miri time, almost all installation, over xtask's per-test limit in total
(the Miri job timed out at 6 h). a_page_with_the_bindings_runs_a_script
(262 s) keeps the installation covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan temporarily deployed to full-verification November 24, 2026 15:08 — with GitHub Actions Inactive
Both sides carry the accessor commit (4d0c1d5 here, 02c1cb2 on main,
rebased onto Promise/RegExp/Symbol). The engine files were merged with
4d0c1d5 as the base, so main's rebased accessor work, classes, Object,
Map/Set and Reflect come in whole, and this branch's later engine changes
(re-entrant natives, Scope::run_jobs, the inline-parsing switch) stay:

- clazel-js-vm (handlers, heap, interp, props), clazel-js-builtins (object,
  conformance_builtins), clazel-js tests/accessors: main's. This branch had
  nothing past the accessor commit in them.
- clazel-js (scope, state, native, lib, api tests): main's plus this
  branch's re-entrance and run_jobs; README open question 13 from main,
  14 (answered) from here.
- clazel-web Cargo.toml: clazel-js is already a dependency here, so main's
  second entry is dropped; the README no longer calls it dev-only.
- Cargo.lock: this branch's, then `cargo update -w` (clazel-js-builtins
  now names clazel-js-regexp).

Now that classes and for...of run, two WPT dom/events pages pass
(EventTarget-constructible, passive-by-default) and leave the expected
failures (40 pass, 226 subtests, 24 listed), and the scripting test of an
engine report uses a BigInt literal instead of a class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan and others added 8 commits November 25, 2026 03:13
A property slot with the ACCESSOR bit may hold a Cell::LazyAccessor: the
property exists, in its place and with its attributes, and the embedder's
maker is asked for [[Get]] and [[Set]] the first time something needs
either (Vm::accessor_pair), which turns the cell into an Accessor in
place. The four readers of a pair go through it; an own property's
enumerability is answered from its attributes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en first needed

Script cannot tell: tests/lazy_accessors.rs runs 28 first uses on an
object built each way and compares what the script saw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A page defines about 550 attributes (940 getter and setter functions) and
uses few. Miri time of a page with every interface and a one-line script:
292 s before, 192 s now (69 s with #305's heap).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at needs the realm

Page::for_document installs the interfaces before the first source text
is compiled for the realm, before a node is wrapped, or when the embedder
asks for the engine; a document with no script never does. The Miri
ignore reasons state the page's measured cost now (192 s, was 292 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…smaller big script

clazel-renderer: the two-page click and wheel tests are one test a page;
the tests that draw two frames use a 16 px wide viewport and, under Miri,
do not also draw the first frame alone; the GPU process test draws the
lists it already has under Miri. clazel-js: the inline-parsing script is
64 statements under Miri (still over both thresholds).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s-input (#300)

Conflicts in clazel-js-vm's interp.rs and clazel-js's runtime.rs: the
lazy accessor maker and main's world hook are both kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts-input (#300)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is tree (69 s)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan deployed to full-verification November 25, 2026 04:51 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
full-verification — 82839b39 Deployed Nov 25, 2026 by atiernan via Approve the proofs #831
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