Compare commits

..
Author SHA1 Message Date
feder-cr 1968b61fab hunt: why a 1024x1024 WebGL readPixels costs 250 ms in ours: readback cost per content (flat to per-pixel ramp), 2D control, arm ours_noproj (read-time canvas projection off), the diagonal-edge scene against retail, and a symbolicated profile of the reading process 2026-11-15 01:36:16 +01:00
feder-cr ae10391340 hunt: does our forced multisample make readPixels slow, and does MSAA change the pixels a page reads (arm ours_nomsaa, readPixels with antialias true and false in the same browser, a scene with diagonal edges, the byte diff) 2026-11-15 01:05:45 +01:00
feder-cr bf4d2a10f9 hunt: what a page reads of the compositor (rAF, CSS and WebGL animation, smooth scroll, readback timings, matchMedia, timer resolution) in ours, ours_vmretail, stockheaded and retail 159 launched by hand, with Troubleshoot's monitors and the OS refresh rate 2026-11-15 00:47:44 +01:00
feder-cr 21c6c878d5 hunt: hunt_encoding.py lists the real PNG chunks and checks them against the specification; the 'deBG' chunk is Mozilla's, not a parser error
The parser was right and the table was misleading: "chunks differ (IHDR,deBG,IEND)" meant that the ancillary chunk deBG differs, with IDAT left out of the names. deBG is upstream Mozilla's nsPNGEncoder::MaybeAddCustomMetadata (the four letters are set one by one, so git grep deBG finds nothing): 16 hex characters keyed by the session's fingerprinting randomization key.

- parse_png reads length/type/data/CRC as ISO/IEC 15948, checks every CRC, IHDR first and 13 bytes, IDATs consecutive, IEND last and empty, no trailing bytes.
- compare_png compares chunk by chunk and says only the deBG chunk differs / deflate only / filter only / pixels; byte_report gives the offsets and the chunk and field each falls in; the table prints the deBG text of every launch.
- selftest: a known 1x1 PNG (IHDR crc 1f15c489, IEND crc ae426082), a deBG layout, deBG-only, deflate-only, bad CRC, no IDAT, truncated; run first in the workflow.
- client retail: Mozilla's 159.0 launched by hand, to answer whether retail writes deBG with a different value in every launch.
2026-11-15 00:26:52 +01:00
feder-cr 4c3fdeaba4 hunt: the first 80 s of a new profile, retail against ours (CPU slices, threads, files, network), and what a page reads of it (EME, MediaCapabilities, WebRTC codecs) in fresh and used profiles 2026-11-15 00:21:19 +01:00
feder-cr 4de5f69ec7 hunt: same seed same bytes (PNG stability, 2 runners, PyPI 0.52.0, stock), ours_vmretail (retail's VM decisions), GPU process profile with no thread filter
- encoding-stability-hunt.yml + scripts/hunt_encoding.py: the 11 PNG keys that were not stable between two launches. The probe's new encoding mode puts the pixels of the draw, three toDataURL and three toBlob of one canvas in one page and the pixels the browser decodes; the script reads the PNG chunks, inflates and unfilters the IDATs and prints per arm and key whether pixels or only the encoding differ, per runner, per page, across a 2-leg matrix (windows-2022, max-parallel 2), for ours, invisible-playwright 0.52.0 from PyPI, stock headed and headless.
- scripts/hunt_vmretail.py + cpu-render-path-hunt-vm.yml: arm ours_vmretail = the declared feature table with the compositing features replaced by stock's own decision on the runner, gfx.webrender.software=true, gfx.webrender.software.d3d11=false, webgl.angle.force-warp=true, all through extra_prefs. Table printed per feature; support reads the prefs and Troubleshoot (windowLayerManagerType/Remote) back; baseline gains stockheaded, ours_swwr, ours_vmretail and says where compositing runs (parent or GPU process); byte diff and suites as for ours_swwr.
- profile --gpu --filters '*': every thread of the GPU process; the summary gets --thread-table (one line per thread with its self weight by module, the unnamed threads together, the sampler's CPU of the pid for coverage).
- cpu-render-path-hunt.yml is dispatch only now: its scripts are shared with the two new workflows.
2026-11-15 00:10:22 +01:00
feder-cr 88958a778b hunt: parent baseline (retail by hand, ours, ours reused), ours_swwr arm and a page-bytes diff, readable GPU-process profile, command lines of the short-lived processes
- scripts/hunt_cpu_baseline.py: one browser, 20 s; arms retail (Mozilla's installer unpacked with 7-Zip, subprocess, -no-remote, fresh profile, no automation; falls back to Playwright's firefox and says so), ours, ours_reused (profile_dir twice, the second launch measured). CPU per process type and per thread name.
- ours_swwr (gfx.webrender.software=true through extra_prefs, from the hunt only) in hunt_cpu_per_browser.py and in `support`.
- scripts/hunt_page_bytes.py + hunt_page_bytes_probe.js: canvas 2D, WebGL 1/2, text and strings read in both arms and diffed; hunt_extra_prefs_plugin.py runs the wrapper's byte suites under both arms.
- profile --gpu: thread filter limited to the GPU process, small buffer, short loop, waits for the processes to exit and checks each file is valid JSON; summary gains a process-wide module table.
- print_processes lists the command line of every process without a -contentproc type and groups the other short-lived ones.
2026-11-14 23:26:12 +01:00
feder-cr f6329cd1d0 hunt: quote the job name of cpu-render-path-hunt.yml (an unquoted 'headed: about:support' is not valid YAML) 2026-11-14 22:46:32 +01:00
feder-cr 731e4d8540 hunt: why our Firefox uses ~6x the CPU of stock with a window (about:support and prefs diff, CPU by process type, Gecko profiles of parent and GPU process) 2026-11-14 22:40:12 +01:00
Federico Elia b14d1deacd docs: canvas page says what holds across OSes, not byte-identical hashes (#452) 2026-11-14 18:31:06 +01:00
Federico Elia 0aae7f73f1 e2e: the dot() vectors reach the page as float bits, so the zeros keep their signs (#434)
The vendored client sends every Python 0.0 as -0 (value == float('-0') is true for both zeros), so the 64 rows of zeros of both signs reached the page with the wrong signs and the Windows gate failed on those lanes only (dot2 21, dot3 10, dot4 6 of 4096, all at indices >= 4032; the random lanes all matched the chain).
2026-11-14 18:31:00 +01:00
Federico Elia 9d217c4911 tests: the census counts its own server, and a module that leaves a browser open fails (#493)
* tests: the census of a closed context counts only its own server's objects

* tests: a module that leaves a browser open fails, and the unit tests that leaked close theirs

A BrowserDispatcher starts the thread "invpw-thread-starter" and stops it only when its connection's close listeners fire. A unit test that
builds one on a fake connection and never closes it left the thread alive, and with it the connection, the browser and every context for the
rest of the worker (23 files, 635 threads in one of them).

- tests/_browser_census.py, registered in conftest.py: a module-scoped autouse check. When the last test of a module has torn down, the live
  starters must be back to what they were before it (a short join: stop is asynchronous), else the module errors with "left N browser(s)
  open: close their connection". Module level, so a module-scoped browser is fine.
- tests/test_a_module_that_leaves_a_browser_open_fails.py: red on a module that leaks, green on one that closes and on one that shares a
  browser through a module fixture.
- the fake connections of the leaking files register themselves with closes_with_the_test(self) in their __init__; an autouse fixture ends
  them when the test ends with announce_closed(), the real path: it fires the close listeners the dispatcher registered. Nothing intercepts
  the starter, so a test that builds a browser on a connection it did not register still leaves the thread and the module check says so.
2026-11-14 14:25:14 +01:00
Federico Elia 45c7450b3e tests: the fake installer of the index wait counts its calls atomically (#495) 2026-11-14 14:00:41 +01:00
Federico Elia 9699a52df9 record 0.52.0 as published (#494) 2026-11-14 13:59:59 +01:00
Federico Elia 77d97d894d egress gate: OCSP of a context goes through its proxy; the Windows native sink is the engine log (#492)
* tests: the egress sink reads the engine log on Windows too, and the OCSP request of a trusted page is held to the proxy of its context

The native-lookup sink is the engine's own log on both systems (the getaddrinfo lines are in the parent process file under the sandbox of Windows and
Linux, run 43574494194): the Windows DNS-Client event-log sink is gone, a blind log raises BlindSink instead of answering nothing, and the suite
wrapper.e2e.context.sink now runs on Linux and Windows.

OCSP: a lab CA the engine trusts (put in the profile by the engine's xpcshell, no ignore_https_errors), a TLS page whose leaf names its OCSP responder by
a name and by an IP, a context behind the gateway that loads it (the request must go through the gateway and never be looked up natively, in user
context 0, or reach the responder), a no-proxy control that is asked of the responder, and an untrusted-issuer control that makes no OCSP request.
Expected red on firefox-63, green on firefox-64.

* tests: the OCSP cases let the engine trust the DoH of the context through the lab CA, so the page name resolves without ignore_https_errors

Run 43584815874: both OCSP cases behind the gateway failed with NS_ERROR_UNKNOWN_HOST before any handshake. The other cases accept the FakeDoh's self-signed
certificate with ignore_https_errors on the context; the OCSP cases cannot (it switches off the chain check, so no OCSP), so the DoH handshake was refused
(SSLV3_ALERT_BAD_CERTIFICATE at the gateway) and the name never resolved. FakeDoh.use_certificate lets the case serve a leaf of the lab CA for the DoH host,
which the profile trusts. Line endings of the touched files are back to those of main.

* required suites: wrapper.unit.udp is 249 (the DoH serving a lab-CA leaf)
2026-11-14 13:30:37 +01:00
Federico Elia e986a0b859 screencast: a frame that arrives while the start is being answered is held and acknowledged, not dropped (#491)
* screencast: a frame that arrives while the start is being answered is held and acknowledged, not dropped

The engine keeps one screencast frame in flight until the wrapper
acknowledges it (kMaxFramesInFlight is 1, and its heartbeat only repeats a
frame when none is in flight), so a frame the wrapper drops without an ack is
the last frame of the stream.

op_screencast_start stored the screencast id AFTER send("Page.startScreencast")
returned. The reader thread wakes the caller on the reply and goes straight on
to the next message, so a frame right behind the reply was handled while the
id was still None: dropped, never acknowledged, stream dead with start()
already returned.

The id, a "start in progress" flag and the frame that came in meanwhile are now
one state under a lock; the held frame is handed up and acknowledged once the
id is in. The ack uses the id the frame was accepted under, read once, and the
check-then-set in start/stop/detach is taken under the same lock.

tests/test_screencast_ack_race.py drives the engine's own flow control through
a reader thread shaped like Connection: 200 start cycles in 4 threads with
random gaps between reply and frame (84 of 200 stall on the old code, 0 on the
fix), stop in the middle of a frame, a refused start, and a page closed with a
running screencast.

Not reproduced in a real engine: 0 dead streams in about 1300 start cycles on
the old code, because the first frame comes at least 46 ms after the reply and
the window is only the time the caller thread takes to wake.

* tests: the hidden-desktop test serves its own page and says what the engine printed when no frame comes

It loaded https://example.com in both sessions; a gate does not use a real site,
so the page is served from 127.0.0.1 by the test. The checks are the same.

When no screencast frame arrives in 15 s, the assertion message now carries the
browser's lines that start with "screencast:" (the core keeps the last 200 lines
of the browser's output, Connection.output), so a failed run says whether the
engine could not start the capture or the frames did not reach the wrapper.

* tests: a screencast e2e that gets no frame says what the engine printed and how long each stream waited

The helper that reads the engine's "screencast:" lines out of the browser's
output moves to tests/_screencast_evidence.py, with a small Stream that keeps a
stream's frames and the time from the start reply to the first frame. The two
e2e in test_screencast.py (the JPEG of the whole window, and the higher rate
delivering more frames) and the hidden-desktop test now put both in the
assertion message when a stream delivers nothing.

A unit test covers the helper: only "screencast:" lines are kept, a lookup that
fails says so, and a stream with no frame says "never arrived".

* changelog: the screencast frame held during the start (0.52.0)
2026-11-14 12:31:30 +01:00
Federico Elia 64d86b4e8a Release 0.52.0: engine firefox-64 through invisible-core 64.69.0 (#490)
* tests: nothing of a context leaves but through its proxy (witness, engine log and nonce as the sink)

A context with a proxy and a session with none, one probe per road a page can
start: fetch, WebSocket, stun, turn over UDP, turn and turns over TCP, each by
name, by IP and by a .local name, behind SOCKS5 and behind an HTTP proxy. The
sink is a witness at an address of this host (no proxy forwards to it), the
watcher, the engine's own resolver log and the resolver trap where it runs.
The Windows second sink is one function that raises until it is written.

Taken unchanged from the minimal-engine port: the page work of the proxied
context and the TURN-by-name reproducer (its engine gate removed: red on
firefox-63, as it is).

* tests: a PeerConnection of a torn-down window leaves only through the proxy of its context (B3)

A PeerConnection built from the window of a detached iframe or of a closed
popup had no proxy config on the engine firefox-63: direct UDP and TCP from
the host, ICE server names looked up in the default context. Four cases (both
windows, behind SOCKS5 and behind an HTTP proxy) build one with a STUN and a
TURN-over-TCP server by name and judge it with the sinks of the suite; two
controls build the same PeerConnection from an attached iframe. A dead window
that refuses the constructor or never gathers passes the egress assertions and
says so (printed, recorded as dead_window_outcome).

Expected red on firefox-63, green on firefox-64.

* tests: the isolated page moves on when the test says so, not 500 ms after its load

On a loaded Windows runner more than 500 ms passed between domcontentloaded and the first read, which then met the second page or the
move itself (2 rounds in 20 under four workers, runs 43435932449 and 43439508625). The page now moves right after the read on it, by its
own location.replace. Still red on the release before the fix: 0.42.0 with firefox-52 answers 'Cannot find object with id = id-10' in
5 of 5 runs on Linux and Windows, green on 0.51.1 (run 43451615354).

* tests: two contexts alive at once resolve their TURN names each through its own proxy and DoH

Two contexts of one browser, each with its own proxy and its own FakeDoh (a
zone that does not know the other's name), each with a PeerConnection kept
open whose TURN server over TCP has a different name. The port of a CONNECT
(one witness per context, same address) says which context it came from.
Each name must reach only the DoH of its own context through its own proxy,
none the machine's resolver, no CONNECT the other proxy, nothing a witness
direct. Behind SOCKS5 red on firefox-63 and green on firefox-64; behind an
HTTP proxy green on both.

* server: no thread is started on the engine connection's reader; one long-lived starter does it

Thread.start waits until the new thread runs, and the reader is the thread every event of the engine waits behind. Browser.attachedToTarget
(one thread per adoption, _spawn_adoption) and Page.fileChooserOpened (one thread to announce the chooser) started a thread from the
reader. They now hand a Thread that is only built there to the browser's _ThreadStarter, one daemon thread made with the browser, which
starts it. The starter starts threads and does not run the work: an adoption waits for the engine without a limit, and a worker that ran
it would hold every later adoption (and new_page) behind a slow popup. The adoption keeps its own thread and its name.

Test: the real dispatchers over a scripted connection, events delivered from a thread of their own, Thread.start recorded; red on the old
code (two starts from the reader). The Page.eventFired(load) case is skipped with a core that still starts a Timer for networkidle.

* tests: a session without a proxy declares the DoH provider and builtin-excluded-domains = localhost

The core declares network.trr.builtin-excluded-domains = "localhost" (core #261: behind a proxy a *.local name goes to DoH
through the proxy, not to the host's resolver). The unit test pinned the old set of two keys and was red in the engine
candidate 43471799366, which runs the core of main.

* tests: the load case of the reader rule lives in the core, where its fix is; the wrapper keeps its two cases, no skip

* tests: the first browser run of the two context suites, test errors fixed

wrapper.e2e.context.sink: every probe by name behind SOCKS5 (and the TURN names of
the window and two-context cases) never connected, because the lab answers every
name with the address of this host, an RFC 1918 one on a runner, and the engine's
DoH client drops such an answer unless network.trr.allow-rfc1918 is true. The lab
now declares it. turns: by IP is refused by the browser itself ("TLS requires
FQDN, not IP address"), so that case shows no CONNECT and keeps every egress
assertion. The firefox-64 expectations of the three *.local probes were stale
(green in the run).

wrapper.e2e.context.egress: the push case waits for the page to leave pending
(30 s) and says the step it reached (registering, registered, ready,
subscription-read). The direct DoH connection of closing-context_only is an
engine behaviour and its assertion is unchanged.

unit.udp min_tests 233 -> 236 (three new unit tests of the lab).

* tests: the push page asks for its subscription again until the parent's push service answers

The parent process listens for the push requests of a content process only once its
PushServiceParent exists, which a first-window idle task creates (BrowserGlue
PushService.ensureReady); a request sent earlier is dropped, not queued. The page
of the push case now repeats getSubscription every 2 s (up to 15 times) and the
message says how many asks it took. The assertion is unchanged.

* tests: revert the retry of getSubscription and the longer wait (a page that retries hides a request that is never answered); keep the stage diagnostics

* Revert "tests: revert the retry of getSubscription and the longer wait (a page that retries hides a request that is never answered); keep the stage diagnostics"

This reverts commit fbd376c4c4.

* tests: say why the push page asks again (silent start-up, lost Push:Registration, same in stock Playwright), with file:line and the bounded wait

* tests: a process that reads no seccomp filter while it starts is read again before it is judged

Firefox pre-launches content processes and a child installs its filter only after its
own start-up, so a process sampled during start-up reads Seccomp 0 (run 43523960399:
the newest tab process). A pid that does not read 2 is now read again for up to 10 s;
none is dropped, and one that is still 0 fails with the same message. Two unit tests
hold it (a late filter is accepted, a process that stays unfiltered is not);
unit.udp min_tests 236 -> 238.

* Release 0.52.0: pins invisible-core 64.69.0 (engine firefox-64)

* server: say nothing about the launch counter (core 64.69.0 has no pref for it)

From invisible-core 64.69.0 (engine firefox-64) the launch counter has no pref: the engine's address is built in and the
counter is mandatory, so the core has no USAGE_PING_* constants. The server imported them at every launch to refuse the
two prefs, which raises ImportError with core 64. The refusal and its test go; a new test asserts that a launch composes
no launch-counter pref and that the server has no refusal (red on the old server). wrapper.unit.udp: 238 -> 228 tests.

* tests: the keyboard rhythm tests run on a clock that moves with each sleep

invisible-core 64.69.0 sends each key at its planned time measured from the start of the action. The rhythm tests replaced
time.sleep with a recorder and left the clock still, so every later wait carried the earlier ones (13 waits for "hello"
instead of 9, the caller's 120 ms gap never seen). The fixture now stands a clock in the keyboard's place that advances by
each sleep, as the core's own test does; every assertion is unchanged.

* tests: the tests of the shelved line wait for firefox-65

Fifteen e2e files are gated on engine_at_least("firefox-64"), set on 11/11 when firefox-64 was the name of the shelved line
(canvas text and ICC from DirectWrite/ucrt work, ucrt Math and calc, the NVIDIA fma chain, WebGL blending, system fonts and
colours, WebCodecs H.264, no host fontconfig/Mesa/libavcodec). The engine released today as firefox-64 is the context/UDP
line and carries none of that work (nor does core 64.x carry its core half), so the gates opened and the tests failed. The
shelved line is now firefox-65; the gates follow it, as they did at 0.50.0.

* Release 0.52.0: pins invisible-core 64.70.0 (64.69.0 refused a page built on the connection's reader)

* memprobe: stamp and write a row under one lock so the file stays in time order

The tick thread and the thread that closes a context both call write().
The row was stamped in sample() before the lock was taken, so a slow
sample (USS on Windows, a big gc) let a later row be written first.
Adds a test that holds the first sample after its stamp and lets a second
writer overtake it.

* Release 0.52.0: pins invisible-core 64.71.0 (a key never reaches the page closer than the plan allows)
2026-11-14 11:08:43 +01:00
Federico Elia c3e0570e6d record 0.51.1 as published (#487) 2026-11-13 15:19:08 +01:00
Federico EliaandClaude Opus 5.5 fcacd9c33d Release 0.51.1 (#486)
* juggler: a popup's page is handed from its buffer to its dispatcher in one step, so no commit or load between the snapshot and the hook is lost (DRAFT)

What the client is told of a frame comes from the initializer (a snapshot of what the lifecycle knew when the frame dispatcher was made)
and from the lifecycle's announcements through a hook that the page installs at the end of its construction. An event the lifecycle heard
after the snapshot and before the hook was told to nobody: the commit of a popup's destination left the client's frame at about:blank for
good, and the DOMContentLoaded/load held in the same period were dropped with every held event that is not a Network.* one. Measured on
Windows with the in-process client and no route on the context: the popup "is at about:blank", or wait_for_load_state("load") times out.

_hear_lifecycle installs the hook and reconciles the frames in one step with the lifecycle's lock held: frames born or gone, the document a
frame committed, its load states; each difference is said once (a frame dispatcher now remembers the load states the client was told). A
commit also drops the load states said before the announcement for the document it replaces, so the replay after the `page` event is the
destination's and not the blank page's.

Tests: test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once (the destination's commit, DOMContentLoaded and load at every
placement among four points of the passage: 16 of 20 orders red on the code as it was; and the commit before or during the announcement:
2 of 2 red), green on this change. The fixtures of two white-box tests get the attributes the page now keeps.

* juggler: the hand-over of a popup's page gives back EVERY event held while it was built, in the order it arrived (DRAFT, 0.51.1)

The page's own listener holds the events of the period between its construction and the end of _install_events, and the hand-over gave
back only the Network.* ones: a console message, a pageError, a dialog, a crash or any other event that came in that period was dropped.
A dialog is the worst: alert() blocks the page until the client accepts it, and a client never told of it cannot. Every held event is now
delivered, whatever its kind, in the order it arrived and once (the events the lifecycle owns are also reconciled, which is idempotent).

Tests: one event of each family (console, pageError, dialog, crash) in this order at every placement among four points of the passage,
35 orders, 34 red on the hand-over as it was; each is told once and in order, the dialog is known to the page and the console message is in
its log; and accepting a dialog opened during the passage sends the engine the answer that unblocks the page (3 points).

* juggler: an event beyond the cap of the hold is counted and said once; a file chooser opened during the hand-over reaches the client; CHANGELOG (DRAFT, 0.51.1)

The hold of a page being built keeps at most HELD_CAP events (it bounds the memory of a page that never finishes building). The events beyond
it are counted and, when the hold ends, said once with their count in a RuntimeWarning, instead of vanishing.

Tests: the cap (a loss said once, with its count), and a file chooser opened at each of four points of the hand-over reaches the client with
the handle of its input element and its isMultiple (the scripted engine answers the three commands the chooser needs). The fixture of
test_a_closed_page_says_nothing gets the counter the page now keeps. CHANGELOG: Fixed, for 0.51.1.

* ci: every leg launches with a GeoIP database made by the repository (same bytes every run, no download, no licensed data); the release alone looks at the real one

scripts/ci_lab_geoip.py writes a MaxMind DB with the six networks of the realness exits and the fields the core reads (an ip_version 6 tree, the types libmaxminddb checks),
refuses to go on when its bytes are not the sha256 of ci/geoip.json, exports STEALTHFOX_GEOIP_MMDB to the job, and says in 'evidence' which file a launch ran with;
scripts/ci_verdict.py judge --geoip --geoip-pin turns a leg that ran without it, or with another, red. tests.yml, e2e.yml and webrtc-e2e.yml make it before pytest;
user-install.yml is left alone. publish.yml (the release) runs scripts/ci_real_geoip_check.py before the upload: the product's own download road, the lab database against the real
one for the six exits, every time_zone of the real database known to the runner.

* tests: the two white-box fixtures that build a PageDispatcher by hand get the attributes the hand-over now keeps

test_navigation_response.py and test_same_document_navigation.py build a PageDispatcher with object.__new__ and set by hand the
attributes the code under test touches; the hook of the lifecycle (_on_lifecycle commit, _hear_lifecycle) now reads _announce_lock,
_announced, _said_before_announcement, _frames and _told_attached, and the frame stubs need frame_id and told_states. They are not marked
unit, so the first full run (-m unit) did not reach them; the run without the e2e marker does. No assertion is touched.

* tests: ONE picker for 'the same number on TCP and UDP', used by the HTTP/3 server, the witness and the resolver trap (for 0.51.1)

tests/_ports.py has the sequence of numbers (the system's own pick, then numbers drawn below the ephemeral range, 200 tries) and the picker that keeps every refusal with its code. The HTTP/3 server
calls it (repos-2e's own copy of the loop is gone), the witness walks the same sequence instead of its own, and so does the resolver trap when its port is 0; a port asked for (53 on the root leg)
is tried once per address as before. The test that holds a port for the trap picks it with the picker too: its own system pick fell in a refused UDP block on a work machine (WinError 10013).
Unit tests with a fake socket layer that refuses a contiguous block of 200 UDP ports, for the server, the witness and the trap.

* tests: the hand-over of a popup under concurrency, five sequences (RED on 7d934a6: a load told twice, an event that overtakes the held ones, a frame created after the page's dispose, a frame made twice, a same-address commit not told)

Test only. A-D go green with the changes listed in the review (E not tried).

* juggler: the hand-over of a popup holds under concurrency (a load told once, the held events keep their order, a document at the same address is told, a closed page is not given frames or announced, one dispatcher per frame) (DRAFT, 0.51.1)

From the concurrency review of 7d934a6 (five sequences, tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py):
- FrameDispatcher.emit tells a load state once; the replay after the announcement keeps one entry per (frame, state) even when the
  client knows it from the snapshot, and says it again on purpose.
- the hold ends only when a round finds it empty; the rounds are delivered outside the lock, so a live event never overtakes a held one.
- the reconciliation compares the place of the last commit, not only (url, name).
- _hear_lifecycle and _reconcile_frames do nothing on a closed page; announce() does not say `page` for a page closed before it.
- frame_for checks and creates under a recursive lock.
The five files of the hand-over are in wrapper.unit.page (62).

* juggler: the hold gives back in at most four rounds outside the lock, then the rest with the lock held (a page that prints in a tight loop cannot keep it open) (DRAFT, 0.51.1)

* juggler: a live event of the engine never overtakes the replay of the events a new page missed (the cause of the popups left at about:blank on engine 63) (DRAFT, 0.51.1)

The browser buffers the events of a session nobody reads yet and `PageDispatcher` is handed them (`replay`) after it subscribed its
lifecycle and injected script. The replay ran on the adoption thread while the engine's reader went on delivering live events to the same
subscribers: the destination's commit (live) fell into the middle of the replay of the popup's first events and the replay then brought
older ones after it - the initial about:blank (no id) and the navigationStarted of the same navigation. The lifecycle ended at about:blank
(a popup at about:blank), or had its navigation pending again (Execution context was destroyed). The second Page.frameAttached of every popup
in the traces of the proof is the replay: the engine sends each event once.

The reader takes a gate for each event of a session; the page takes it for "subscribe, then replay" as one step (BrowserDispatcher.events_gate),
with a bounded wait for the reader (5 s) so a holder that never lets go cannot stop the engine's stream.

Test: tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py, five stops of the replay, RED on the old code (the lifecycle
ends at about:blank), green with the gate. wrapper.unit.page 62 -> 67.

* juggler: the gate of the events belongs to the connection, looks the delivery up at each event, and bounds the hold, not each event (DRAFT, 0.51.1)

From the review of 80bc478:
- the wrapper froze the bound `dispatch_event` of the connection: a patch of the class made after the browser was built (the e2e fixtures that
  record the events) was bypassed. It looks the delivery up at each event, as the reader did.
- the 5 s bound was per event: a holder that never lets go made the reader pay 5 s for every event. After one timeout the reader delivers ungated
  for 30 s, and the connection records it (`handler_errors`).
- the gate is kept on the connection, so a second dispatcher over the same connection shares the one the wrapper takes.
Tests: a utility context created while the replay goes on is not undone by an older event (the injected script half), the class patch, the
hold bound; wrapper.unit.page 67 -> 71.

* juggler: a page that is being built waits at most 30 s for the gate of the events, and says it when it does not get it (DRAFT, 0.51.1)

From the reading of 15d1891 by repos-6b: the construction of a page waited for the gate with no bound, a new dependency on the reader. It now
builds without the gate after 30 s and warns. wrapper.unit.page 71 -> 72.

* tests: the 17 CodeQL alerts of PR 483 are fixed in the test code (TLS floor, exact host, own address, header from the dict's key, MD5 declared not for security)

py/insecure-protocol x11 (23-33): every client TLS context the fake servers' tests make sets minimum_version = TLS 1.2 (test_the_fake_doh_answers x7,
test_the_fake_doh_delays_and_refuses, test_the_h3_line_helpers, test_the_http_proxy_helper_asks_for_credentials, test_the_udp_chain_helper).
py/bind-socket-all-network-interfaces (37): the TURN stand-in listens on the address the browser is told to connect to, not on 0.0.0.0.
py/http-response-splitting (39): the Content-Disposition name is the dict's own key, found by comparison, nothing of the request is written back.
py/incomplete-url-substring-sanitization (38): the trap's description is compared whole, not searched for a host name.
py/weak-sensitive-data-hashing x3 (34, 35, 36): the TURN long-term credential key IS MD5(user:realm:password) (RFC 5389 15.4); the stand-in and its test
compute it with usedforsecurity=False. Whether CodeQL accepts that is seen on the next scan; no setting touched, no alert closed.

* tests: Control+A selects all in an input and a textarea, in-process and served to the stock client (e2e, red on the keyboard that held Shift for the capital A)

* ci: e2e.yml runs the Control+A e2e on Windows, on the published engine, as a job of its own (dispatchable alone with only=windows-control-a)

tests/test_control_a_selects_all_in_a_field_e2e.py (5 ways to press the shortcut x an <input> and a <textarea>, in-process and served to the stock
client) is red on the keyboard that held Shift for the capital A and was measured on Linux; the keyboard of a user is Windows. The new job
installs the wrapper (which pins the core of the release), fetches the published engine and runs that file on windows-latest with bash as the
shell, behind the same core-on-index gate as the Linux job: skipped with the reason in the summary until the core is on the index. The
workflow_dispatch input `only` lets it run alone (`windows-control-a`) without the 40 minutes of the Linux job.

* ci(install): the wait for the index asks both installers of the job (pip and uv), three rounds in a row, and a call that does not answer is a no

The job installs with two tools: the upgrade test with pip, the release test with uv (the README's way in). The wait asked only pip, so a green wait said nothing
about the page uv would be served, and one yes proves one request, not the next. Each round now asks `pip download` AND `uv pip compile` of
`invisible-playwright==X` (no cache, nothing installed); the job goes on after three rounds in a row in which both said yes (INDEX_WAIT_CONFIRMATIONS), 15 s apart,
a no starts the count again, a call that does not answer in 120 s (INDEX_WAIT_CALL_SECONDS) is a no; the bound of ten minutes is the same and the error says
which installer said no. The harness environment gets `uv` (a PyPI package: `python -m uv`), independent of the uv the release test installs in its own home.

Test: the script of the step runs with a pip and a uv that answer as plans say; red on the step of 299fc9f (8 of 10). The same remedy as invisible_core 2089b48.

* tests: the GeoIP check of e2e.yml anchors on the step's name on main ("..., without the root ones")

The rebase of the 0.51.1 stack over main (c70a396d, 3be9c0b) met the e2e step renamed by 0.51.0's root step; the database is
still made before it and verified after the root step.

* tests: the raw juggler e2e wait for Page.ready and the main frame, not a fixed 0.4-0.5 s

The Windows census of all the e2e (run 43307193708) and the recheck on 87a4e3b (run 43313222398) had 6-7 of these tests red
with "no frame: the page has not announced its main frame yet": on a Windows runner the page is announced after the sleep.
The page is the caller's when the engine says Page.ready, as Playwright hands it over (Lifecycle.wait_for_page_ready), and
then its main frame is there (wait_for_main_frame).

* ci: the sandbox e2e runs in a step that turns user namespaces on; the consecutive-port tests run serially; CHANGELOG for 0.51.1

The sandbox e2e (tests/test_the_socket_process_is_sandboxed_e2e.py) fails on a runner whose AppArmor refuses
user namespaces to a normal user. e2e.yml now leaves it out of the normal run by name (SANDBOX_FILES) and runs
it, after the run and the root step, in a step of its own that sets
kernel.apparmor_restrict_unprivileged_userns=0 first and refuses anything but exactly one passed test.

The two tests of test_declared_host_network_e2e.py that read a consecutive pair of host ports (N, N+1) carry
the wall_clock marker: the e2e run gives them the machine alone, so no other worker can take port N+1.

Each has a unit test that is red on the previous tree. CHANGELOG: the measured popup and Control+A results,
the test fixes, and the known issue this release fixes is removed.

* tests: no address is written out in the GeoIP lab table and its tests (built from numbers, as tests/_realness_support.py does); ci/geoip.json drops its unused network list

* tests: a DoH handshake the client dropped is not a refused certificate (Windows: ConnectionAbortedError 10053)

Windows census of 12/11 (run 43333574229): test_resolver_race_e2e[context_without_proxy_beside_a_proxied_one] read a
ConnectionAbortedError [WinError 10053], through the gateway of a context that HAS the certificate exception, as "a context
without the FakeDoh certificate exception used the DoH". A connection the browser drops before the handshake ends says
nothing about the certificate; only a TLS alert from the client (unknown CA, bad certificate) does. FakeDoh.certificate_refusals()
keeps those; the four e2e that judged every failed handshake (resolver race x2, context-only proxy, DoH under stress) judge the
refusals and still print every failure. Unit test red on the old FakeDoh (no certificate_refusals), green now.

* tests: the GeoIP lab database answers every public address that is not reserved with one declared record

A launch with no proxy asks the database for the runner's egress address, which is not known in advance (any provider, any region). With the six
exits alone the lab database ended those launches in 'egress IP not present in the geoip database' (run 43351424907: 495 errors of this one cause in
the e2e job, and 3 tests of the unit legs). The reserved ranges stay absent, as in the real database. Test red on the six-network database.

* tests: the two gather tests that compare a near and a far duration run alone, in the serial group

Run 43353896238 (Linux e2e, four workers): 765 passed, one failed with (350 - 84) <= 100, the host candidate of the far gather 266 ms after the
near one. The verdict is a difference of two wall-clock measures, which the e2e run gives the machine alone (wall_clock). A unit test reads the file and
refuses any test that compares a near and a far timing without the marker; it is red on the file as it was.

* tests: every suite of the gate and the e2e and unit tests of a pull request run on Linux and Windows, or say why not

Federico, 12/11: a test seen only on Linux proves nothing about the system the product imitates; where Windows behaves
differently the test adapts. A row of ci/required-suites.json names both systems, or a windows_twin, or a linux_only reason;
the jobs of e2e.yml that run scripts/run_e2e.py cover both runners between them; the unit job of tests.yml runs on both.
wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox are declared linux_only with their reason (the lab's exit address cannot
be held on the runner's adapter without taking the runner off the network; the sandbox twin needs a retail measurement).
Known-bad: the files of 12/11 (two Linux-only rows without a reason, e2e on ubuntu only) -> problems names each.

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

* ci: e2e.yml runs the e2e on Windows too, in four parts, without the linux_only suites

Before this, 562 of the 808 e2e had never run on Windows in any round (census of 12/11, run 43307193708, ~50 minutes in one
job). Four jobs "e2e (windows, part N)" on windows-2022, the published engine, scripts/run_e2e.py as on Linux; the sorted e2e
files split every fourth; the suites ci/required-suites.json declares linux_only are left out by reading the file, not by a
skip. scripts/e2e_is_green.py already reads every e2e check-run of the commit, so the release waits for the Windows parts too.
The root-step test finds the Linux run by its xvfb-run.

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

* ci: the unit tests run on Windows at both ends of the Python range (3.11 and 3.14), not on 3.12 alone

Federico, 12/11: every test on Linux AND Windows. Ubuntu keeps the whole range.

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

* ci: webrtc-e2e.yml goes (dispatch only, Linux only); its file runs in e2e.yml on Linux and Windows and in the gate

Its one test file, tests/test_webrtc_realness.py, is e2e: e2e.yml collects it on every pull request on both systems, and the
gate's wrapper.e2e.udp lists its UDP-line tests. A workflow that only a person can start is not a round; it is deleted, not
left off.

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

* ci: the Windows parts of e2e.yml launch with the repository's GeoIP database and verify it, as the Linux run does

tests/test_ci_workflows_build_the_geoip_database.py judges each leg of e2e.yml on its own (the Linux job, the Windows parts)
and no longer names webrtc-e2e.yml, which is gone.

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

* tests: the raw juggler e2e subscribe the page's Lifecycle and injected script on the attach, not after it

Windows CI of 13/11 (run 43373058301, e2e windows part 2): test_juggler_actions [engine-approach] waited 30 s and "the
engine never said Page.ready (frames seen: [])". The connection hands each event to the listeners of that moment
(EventListeners.dispatch_event copies the list); these tests built the Lifecycle from the test thread after polling for the
attach, so the page's first frameAttached and Page.ready, delivered in between, reached no one. Built in the attach
listener, on the reader thread, they are subscribed before the next event of the session.

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

* tests: the fake HTTP/3 server closes its event loop on its own thread (a loop left to the garbage collector hung Windows runs)

PR #486, e2e windows part 1, twice; the Windows hunt of 13/11 (run 43377799126) three runs of fifteen: a test of
test_http3_through_the_proxy_e2e.py stood for minutes and was killed by the timeout. The server had answered every call;
the test thread was in base_events.__del__ -> proactor_events.close -> windows_events.close -> _poll in all three dumps.
H3Server.close() stopped its loop and never closed it, so BaseEventLoop.__del__ closed it later on whatever thread the
garbage collector ran in, and the Windows proactor waited for ever for the UDP receive still pending on it. The loop is now
closed on its own thread after the QUIC server, and close() joins the thread. Unit test red on the old server, green now;
wrapper.unit.udp counts 222.

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

* tests: the late element is scheduled by the test, and the cross-origin button is waited for before it is counted

Windows CI of 13/11 (PR #486, run 43383366904), two reds of the tests themselves:
- test_juggler_transport::test_the_public_API_WAITS_for_an_element_that_arrives_late: the page's timer (800 ms from its
  load) had already added the element when the test first read it ("the element was already there"); the test now empties
  it and schedules it itself, 800 ms from its own read.
- test_cross_origin_iframe::test_cross_origin_iframe_frame_locator_resolves_button: Locator.count() does not wait, and the
  cross-origin document of the iframe, in its own process, loaded after the count (0 elements); the button is waited for first.

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

* Pin invisible-core 63.68.0 (the font-manifest cache on Windows, host environment, GeoIP once a day)

* tests: core 63.68.0 no longer declares gfx.webrender.all (a pref that does nothing)

* tests: a move with a button held carries buttons=1 and pressure 0.5 (core 63.68.0); the timed typing test runs in the serial group

* tests: the first-STUN-datagram timing runs in the serial group (419 ms under four parallel browsers on Windows)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 13:26:47 +01:00
Federico Elia fd104e231a Point every GitHub location at oss-invisible (#485)
* Point every GitHub location at oss-invisible

The repository and its companions moved to the oss-invisible organization:
invisible_playwright is now oss-invisible/playwright, invisible_core is
oss-invisible/core, invisible_playwright_mcp is oss-invisible/playwright_mcp
and firefox_antidetect_patch is oss-invisible/firefox_antidetect_patch.
README, docs, package URLs, release/counter scripts and the tests that pin
them now use the new locations. PyPI package names are unchanged.

* docs: keep one doc line as it is (the local name guard)

* Version 0.51.1: the files that go into the wheel changed since v0.51.0 (package URLs)

* CHANGELOG: the 0.51.1 heading the version bump needs
2026-11-13 03:05:06 +01:00
github-actions[bot]andfeder-cr 3be9c0bf39 record 0.51.0 as published (#484)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-12 22:21:13 +01:00
c70a396d94 Release 0.51.0: engine firefox-63 through invisible-core 63.66.0 (#483)
* docs: the agent links and the command name the repo as it is now

Two things were broken for a reader on main, not one.

Thirteen links pointed at github.com/feder-cr/AIHawk. GitHub redirects a
NAME to the OBJECT that carried it, not to the content: after the September
swaps that name belongs to invisible_dots, which has seven wiki pages, so
AIHawk/wiki/<page> lands on its wiki Home. It answers 200 with different
content, which means a reader who clicks does not find the page and a search
engine sees a soft-404 across about 150 indexed URLs.

Seven occurrences said `uvx aihawk`, a command that does not exist. One sat
in a front-matter description, which is the snippet search engines show, and
one in a block meant to be copied: `claude mcp add stealth -- uvx aihawk`.
The command is invisible-playwright-mcp, on PyPI at 0.70.16.

All eight link targets were checked one by one and resolve to themselves with
the page title, no redirect.

Three things stay as they are, which only reading them showed. The
`pip install invisible-playwright` line matches what this engine's own README
teaches for the library, so the page is consistent rather than broken.
CHANGELOG.md keeps the old name because a changelog entry says what was true
then. And the fixture in scripts/sync_article_pixels.py keeps it because it is
the deliberate wrong case, a pixel for ANOTHER repo.

One sentence went away instead of being renamed: "shipped inside AIHawk" made
sense when AIHawk was the larger product containing the server. The server and
the repository are now the same thing, so "shipped inside itself" was circular.

(cherry picked from commit d9c8e46dce)

* test: the docs name the MCP server's repository and command as they are now

feder-cr/AIHawk now leads to an unrelated repository and answers 200, which no
link checker reports; `uvx aihawk` does not exist. The README and docs/ are
read for both.

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

* tests: the Fission bench counts the processes that host a site, not every new content process

test_same_site_other_port_stays_in_process was red on the e2e of the 0.50.0 commit ("a same-site frame
started a process: [13443]"): the bench counted every `-contentproc ... tab` pid, and the engine starts a
preallocated content process to refill its pool whenever it gets to it. On Linux the engine names a content
process by its remote type (ContentChild::SetProcessName, prctl PR_SET_NAME): "Isolated Web Co" once it
hosts a site of strategy 1, "Web Content" while preallocated. Measured on firefox-62: a cross-site frame
renames a preallocated process and a new "Web Content" refills the pool; a same-site frame changes neither.
The two tests that count processes skip off Linux, where no process carries a name.

Unit test with the measured processes: 3 red on the old bench, 3 green here. e2e on firefox-62 (candidate
#6, Linux): the bench file 17 passed; the two counting tests 15 of 15 runs green.

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

* tests: a closed context is checked for the processes of its sites, not for every content process

test_closed_contexts_with_a_never_stopping_service_worker_leave_no_process was red on the e2e of the 0.50.0
tag ([2, 2, 2, 5, 5], 5 <= 2). Measured on firefox-62 (Linux), the test's own scenario 10 times with every
process named: no "Isolated Web Co" left after any close; the 3 more are "Web Content", the engine's pool of
preallocated processes filling up behind the closed contexts (5 runs of 10, new pids each time). Not a leak:
the count read the refill.

The helper of the bench moves to tests/_processes.py and both tests use it. The context test counts the
processes that host a site: at least one while the page is open (or the count proves nothing), none a few
seconds after `close` answers (the engine waits for them inside close and kills the ones that stay). Off
Linux it skips, as the bench's two counting tests do: no other system names the process.

Unit tests (tests/unit/test_processes_counts_sites.py) from the measured processes, the closed-context case
included. e2e on firefox-62 (candidate #6, Linux): the context test 10 of 10; run_e2e.py on the two files and
the unit test 18 passed. The old counter, same scenario: 5 of 10 runs would fail.

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

* Release 0.50.1: 0.50.0 with the process-counting e2e corrected (0.50.0 never reached the index)

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

* tests: the same-site control puts its frame in the shown page; CHANGELOG: 0.50.0's entry is 0.50.1's

The e2e of #451 saw a new "Isolated Web Co" once after a.test/plain -> a.test/same-site ([10878] -> [10878,
11208]). Not a process of an earlier test: it was created after the first read and only this worker's
descendants are counted. It is the top-level navigation: when the old document may enter the back-forward
cache, the browsing context is replaced (mReplaceBrowsingContext, dom/ipc/ProcessIsolation.cpp) and the new
one may be placed in another process of the same site (dom.ipc.processCount.webIsolated = 4). Measured on
firefox-62 (candidate #6, Linux): 0 of 30 runs alone (bfcache on and off), 0 of 57 under 4 workers. The test
was written for the frame, so the frame is now added to the page already shown and the top never navigates:
20 of 20 runs green.

0.50.0 never reached the index, so the changelog gate refused its heading; its entry now opens 0.50.1.

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

* UDP line: the e2e of the proxy for a context, the chain by name, the declared host network, and the wrapper that declares it

Squash of the local integration branch (one branch for the candidate):
- e2e behind a gateway with coherent UDP (the cost of a gather, two contexts, a proxy without UDP, TURN over TCP of a context,
  HTTP/3 through the proxy) and one hermetic SOCKS5 gateway helper under them;
- the whole UDP chain by name behind a gateway at 130 ms (hermetic);
- the declared host network e2e (interfaces, ports, two connections);
- the wrapper declares the host network from the session seed (no srflx, no UDP verdict, no host_ip any more);
- the integration test follows the declared network and the DoH of the session proxy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* dev extra: aioquic, so the two HTTP/3 e2e run in the gate instead of being skipped by importorskip

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: networkidle through a served browser whose context routes every request, on a reused page

launch_server() plus a stock Playwright client, a context route that aborts image/font/media and continues the rest, a
page with sendBeacon, the same font twice, a frame of another site, a worker, redirects, requests the page cancels while a
slow route decides, 100 requests at once, and a slow client that answers concurrently (async). Every shape reaches
networkidle on firefox-62; one page reused for twelve addresses too. The leak that tf-fetch meets on real sites needs
end events the engine loses, which no local page produces: its deterministic red/green is in the core
(tests/test_networkidle_on_a_reused_page.py of invisible-core); this file guards the remote path end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: the answer to a request the browser has already closed is not an error (Cannot find request), as stock sendMayFail

A page cancels requests while a route is deciding (a fetch aborted, an image replaced, an iframe removed, a beacon with
its document). The engine takes the request out of its held set at once and the late continue/abort/fulfill meets
"Cannot find request". Stock Playwright sends the interception commands as may-fail and tells the client nothing; ours
passed the error up, the client kept it as the error of the whole connection and raised it on the NEXT route command,
which was then never sent: its request stayed held in the engine, its handler failed too, and so on down the page. Seen
on a real news page: six held requests in a row, one a beacon, and networkidle never came.

RouteDispatcher._send now treats "Cannot find request" and a closed target as done (still disposed); any other protocol
error still reaches the client.

Tests: the e2e with a plain handler (no try) on a page that removes an iframe whose requests are held (red before: networkidle
never, 25 s; green after; the fetch and image shapes were green before too), and a static guard that every op of
RouteDispatcher (abort, continue, fulfill, redirect) goes through _send and that _send swallows exactly those two.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stock Playwright client is required by the networkidle e2e (explicit failure, never a skip); the dev extra pins it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a page reached over IPv6 gathers host candidates on a machine declared without IPv6 (hermetic, [::1], no proxy)

Red on an engine before ddaf867f03: the gathering is empty. Needs the firefox-63 build to run: not run here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the names of a proxied session go to DoH through the proxy (written ahead of the engine)

E2E for the contract of core-19/motore-18, plus the hermetic helpers they stand
on, which are unit-tested now: a hand-written DoH server (h2 and HTTP/1.1), a
SOCKS5 gateway and an HTTP proxy that hand the DoH CONNECT to it and tag each
query with their name, a connection watcher and a resolver trap. The e2e skip
without a binary and cannot be green before the engine that keeps the contract.
test_integration follows the core: no host_ip pref, no DNS gate switch, TRR mode 3.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the TURN name of the udp chain is resolved by the DoH through the proxy, not by the gateway

Chain is now a DohGateway (one SOCKS5 gateway in tests/): a CONNECT to the DoH goes to a FakeDoh whose zone is the TURN and
the page names, the datagram to TURN_IP goes to the TURN server by address (type 1), a name on the relay or a query to port 53
is dropped and recorded. DnsServer and the type-3 branch are gone. DohGateway takes the Gateway options (UDP relay, rtt) and
delays its tunnels by half the round trip like the base gateway. explain() lists what the DoH, the gateway, the TURN server and
the page saw, and says why.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the UDP line e2e need the engine that carries it (firefox-63); a missing websockets, aioquic or h2 is a failure, not a skip

The dev extra installs all three; a gate that skips for want of one proves nothing. main's e2e fetches the published engine 62, where the
declared network, the DoH through the proxy and the SOCKS5 UDP layer do not exist: those tests skip there and run on the candidate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: networkidle through a served browser whose context routes every request, on a reused page

launch_server() plus a stock Playwright client, a context route that aborts image/font/media and continues the rest, a
page with sendBeacon, the same font twice, a frame of another site, a worker, redirects, requests the page cancels while a
slow route decides, 100 requests at once, and a slow client that answers concurrently (async). Every shape reaches
networkidle on firefox-62; one page reused for twelve addresses too. The leak that tf-fetch meets on real sites needs
end events the engine loses, which no local page produces: its deterministic red/green is in the core
(tests/test_networkidle_on_a_reused_page.py of invisible-core); this file guards the remote path end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 47182f0cd85fea08fc45e36f1c91d2d570722f14)
(cherry picked from commit e46f2dcf3eb361e6af0fedcdf6e1189f0ac330b6)

* server: the answer to a request the browser has already closed is not an error (Cannot find request), as stock sendMayFail

A page cancels requests while a route is deciding (a fetch aborted, an image replaced, an iframe removed, a beacon with
its document, the favicon of the page a goto just left). The engine takes the request out of its held set at once and the
late continue/abort/fulfill meets "Cannot find request" or NS_BINDING_ABORTED. Stock Playwright sends the interception
commands as may-fail and tells the client nothing; ours passed the error up, the client kept it as the error of the whole
connection and raised it on the NEXT route command, which was then never sent: its request stayed held in the engine, its
handler failed too, and so on down the page. Seen on a real news page: six held requests in a row, one a beacon, and
networkidle never came.

RouteDispatcher._send now treats "Cannot find request" and a closed target as done (still disposed); any other protocol
error still reaches the client.

Tests: the e2e with a plain handler (no try) on a page that removes an iframe whose requests are held (red before:
networkidle never; green after), and a static guard that every op of RouteDispatcher goes through _send and that _send
swallows exactly those two. The same defect was found a month earlier by richardpowellus (#351), with the favicon of the
previous page: his test is added in the next commit.

Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stock Playwright client is required by the networkidle e2e (explicit failure, never a skip); the dev extra pins it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 91223226f5bba25edff9af0e8b1fd6b5bfea2227)
(cherry picked from commit 612b18c02b95e9b5833d62b6595d4a0ff324aac2)

* tests: answering a route the next navigation already aborted does not raise (the case of #351: the favicon of the page just left)

Sixty sequential routed gotos on a loopback page: 4-12 of them failed on the old server, every failing continue_ being
the previous document's favicon, aborted by the next navigation while the route sat with the handler. Red on main (in-process
path), green with the fix of RouteDispatcher._send.

Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.50.1: pin invisible-core 62.64.0; CHANGELOG for the networkidle fixes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit e63ef8e61ea42e7f8df7c1bde206f3bf86fc18f7)

* ci: the list of mandatory suites and its one judge (ci/required-suites.json, scripts/ci_verdict.py)

The list names three suites with the least number of tests each must collect (wrapper.e2e.udp 51,
wrapper.e2e.doh 8, wrapper.unit.udp 86). ci_verdict.py prints the pytest arguments of a suite and judges
its junit: a failure, an error, a skip, too few tests, a required file or node id that did not pass, and
a list that lost a suite, a minimum or a test against main are all red, each said with its reason.

The leak watcher's file defined a test that skipped on every host; the two resolver-trap tests now exist
one per host (collected, never skipped), so the unit suite allows no skip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH negative control does not skip where the resolver trap cannot run (Windows reaches the page by a name the system resolves by itself)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the verdict judge closes the holes a review found (main comparison, complete, exact counts, xunit2, commit, list validation, DoH trap)

- main: --main-required compares when the file is there; --main-has-no-list (the gate's declaration that main was checked
  out and has none) passes declared; a missing path without it is red. A failed download is no longer "main has no list".
- complete: every (suite, os) of the list reported a green result, no stranger, one commit, one binary per OS.
- exact: every row says whether collected must equal min_tests; the result json carries verdict green|red.
- the junit must be xunit2 (classname present, no file/line); the commit is --commit or git HEAD, never GITHUB_SHA;
  --binary is mandatory and must exist; --seal is read (it carries no sha256 of the binary: said, not compared).
- the list is validated by args, judge and complete (exit 2 with the reason); against main also exact, os, tests, marker.
- DoH e2e: with INVPW_REQUIRE_TRAP=1 a resolver trap that cannot run or bind is a failure, not a silent skip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH prefs follow the new split (the core declares the provider, the engine the state and the excluded names)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the git identity of the verdict test is a plain word

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A route answer the engine refuses is the engine's business, whatever its wording

The server took one wording ("Cannot find request") of an answer to a closed request as done and passed every other
protocol error up to the client. The engine also says "NS_BINDING_ABORTED
[nsIInterceptedChannel.resetInterceptionWithURI]" when the channel was cancelled while the answer was on its way: the
same event, and the client kept it as the error of the connection and raised it on its next route command.

Stock Playwright sends the three interception commands as may-fail and tells the client nothing, whatever the engine
says. So does RouteDispatcher._send now: every ProtocolError is swallowed, the route is disposed after it.

Tests: the static guard no longer allows a re-raise inside the handlers; a unit test feeds three wordings (red on the
old code for two of them).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wrapper: every context carries the position the core declares for the session

The geo step is asked with the session seed (launcher, async_api, the served
browser, the default session) and the core's SessionGeo.geolocation_override()
(latitude, longitude, accuracy) becomes the standard `geolocation` context
option in _default_context_kwargs: the default context, each new_context /
new_page and each context of a remote client get Browser.setGeolocationOverride
through the existing path (server.py _apply_context_options). A geolocation given by the
caller wins; no coordinates, nothing is sent; the permission is never granted
here. Tests written ahead: tests/test_the_session_position_reaches_every_context.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wrapper: a proxy given to a context declares its measured UDP exit (udp) in Browser.setContextProxy

The core measures where a SOCKS5 proxy's UDP leaves from and the answer is the optional
field `udp` of the proxy declaration. The wrapper hands it on:

- the launcher, the async launcher and launch_server pass the udp their geo step measured
  to configure_proxy(udp=), so it reaches Browser.setBrowserProxy;
- the server's launch (a client that composed no session) declares the proxy with what the
  geo step remembered, never coherent without a measurement;
- BrowserDispatcher._apply_context_options, the one place new_context(proxy=...) of the sync,
  async and remote clients ends in, measures the context proxy BEFORE Browser.setContextProxy
  is sent (the core discovers the TCP exit through it and measures the UDP beside it, once per
  proxy, cached by endpoint and a hash of the credentials) and the result goes in `udp`.

Tests: a recorder in place of the engine, the fake SOCKS5 gateway with a UDP relay and a STUN
server only the relay reaches, declared through STEALTHFOX_UDP_STUN_SERVERS.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wrapper: the STUN servers are a launch parameter kept on the session (udp_stun_servers); the caller never declares udp

- InvisiblePlaywright(..., udp_stun_servers=None) (sync and async) and launch_server(...,
  udp_stun_servers=None) take "ip:port" IPv4 literals (None = the core's two public defaults;
  a name or a bad port raises ValueError naming the parameter) and keep them on the session.
  The launch's geo step uses them, and so does every later new_context(proxy=...): the server
  keeps the list on the browser it launches (the list rides to the server in the launcher's
  composed prefs like the session seed and is taken out before the profile is written), so the
  per-context call needs no new parameter. Nothing of it reaches the browser's environment,
  argv, prefs or pipe (tested).
- The proxy command is built by the core's context_proxy_command / launch_proxy_command: the
  `udp` field is the measurement, never what the caller wrote; configure_proxy(udp=) is gone
  and the launch's measure reaches Browser.setBrowserProxy through the core's per-proxy memory.
- The constructor-signature pin records the new keyword.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the e2e of the UDP relay hand the core the STUN server its gateway answers (udp_stun_servers), and the dropped-UDP cases expect the new behaviour

The core now MEASURES the UDP exit of a SOCKS5 proxy before declaring it; only `coherent`
makes the engine send UDP to the relay. A gateway of the tests that is not asked the right
way is declared `no` and its e2e would fail for a reason that is not the product's.

- _socks_servers: MEASURE_NUMBER (the fake STUN by a number of its own, so the measurement
  is told apart from the page's STUN_NUMBER), Gateway.measure_servers, silent_udp() (relay
  granted, STUN never answered -> unmeasured), relay_host on every factory.
- _udp_line (new): measure_servers, egress_by_proxy (the TCP exit of each gateway: a context
  proxy is measured against its own), declared_udp (what the launch measured; absent is not
  `unmeasured`), one place for every e2e.
- test_webrtc_realness: one launch helper behind a gateway; the relay tests, the two-contexts
  and the TURN-over-TCP tests use the exits of their own gateways; the dropped-UDP case is one
  helper with three roads (refused: no, another exit: no, never answered: unmeasured) that
  asserts the declared udp, no srflx, 701, and that the page's UDP never reached the relay.
- test_the_whole_udp_chain_by_name_e2e: the chain is told its own TCP exit (it was a
  documentation address the chain's UDP does not leave from, i.e. `no`) and asserts coherent.
- test_the_udp_line_helpers (unit): the real measurement of the core against each gateway
  and the chain; the helper's list is `ip:port` IPv4 literals the core takes.
- ci/required-suites.json: wrapper.e2e.udp 51 -> 53 (two new tests, listed by name).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: HTTP/3 is judged on three visits of one page (h2, h3, h3 with UDP free; h2 three times without), as a retail Firefox reads them

Reference: retail 159 Linux, 15 of 15 each way (invisible_WebRTC captures/h3-fallback): with
UDP free the first visit is h2 and the second and third h3; with UDP dropped every visit is
h2 and the later loads are as fast as the first.

- _h3_server: the TCP side speaks HTTP/2 by ALPN (h2 library; HTTP/1.1 only for a client that
  offers nothing else), carrying Alt-Svc: h3; it answered HTTP/1.1 only, so the first visit
  could never read h2. One HTML document over TCP and QUIC; tcp_alpn recorded.
- test_http3_through_the_proxy_e2e: the retail method (one context, three gotos, a pause of 2 s
  after each load, nextHopProtocol of the navigation entry) on six roads: no proxy and a SOCKS5
  with coherent UDP -> h2,h3,h3 (QUIC through the relay, the server never sees this host);
  SOCKS5 that refuses UDP / leaves from another address / never answers (the declared udp is
  asserted) and an HTTP proxy -> h2,h2,h2, no QUIC at the server, no page datagram at the relay,
  visits 2 and 3 no more than 1.5 s slower than visit 1. An h3 on visit 1 is named as an error.
- _udp_line: expected_protocols / judge_visits (the sequence and the judgement, unit-tested).
- test_the_h3_line_helpers (unit): the server really negotiates h2, says Alt-Svc, answers the
  same document over h3; the judge names each mistake.
- ci/required-suites.json: wrapper.e2e.udp 53 -> 57 (the http3 file has 6 tests, was 2).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A keepalive fetch is a request of the page for the client, in a real browser

e2e: the page sends a plain fetch, a keepalive fetch (cors and no-cors) and a beacon; the client must hear a `request`
for each and an end for each. Measured on the firefox-62 engine: the server received the keepalive fetches and the client
heard no `request` for them (stock Playwright's Firefox reports them). Red until the engine attributes the request to
its page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the no-proxy gather is a required test of wrapper.e2e.udp (58 tests)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the descriptors of the spawn are asserted by running it, not by reading the core's source

test_the_spawn_keeps_the_two_hardwired_descriptors asserted that the source of the core's _spawn_posix contains
`pass_fds=(its_read, its_write, 3, 4)`. Core 62.64.0 starts the engine with posix_spawn and file actions, so the words are gone
and the test failed on every Linux unit suite although the behaviour is the same (and better).

The test now runs the spawn: a parent with nothing open on 3 and 4 and its pipes far from them launches a program that reads
fd 3 and answers on fd 4 (the contract of nsRemoteDebuggingPipe.cpp), and the answer must come back and the child must hold no
descriptor above 4 of the parent's. Same shape as the core's own test
(test_the_pipe_of_the_engine_reaches_its_fixed_descriptors). No skip: the file is already POSIX-only.

The other tests of the file do not read source text (checked: no getsource/inspect/read_text left).
Ran the parent program on Linux with core 62.64.0 (image tetra-invisible:run1b-final): pong:ping:0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the fake DoH of the e2e uses a name that is not HSTS-preloaded (doh.gateway.test at 192.0.2.53), declared through extra_prefs

Firefox refuses certificate overrides for HSTS-preloaded/pinned hosts, so a self-signed fake for
mozilla.cloudflare-dns.com could never be accepted. The test now declares its own provider
(network.trr.uri, network.trr.bootstrapAddr) and counts every connection of the browser, including
the background traffic of the default context whose TLS fails by design, at the gateways.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the chain by name declares the FakeDoh's own provider (doh.gateway.test): the DoH of Mozilla is HSTS-preloaded and takes no override

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the h3 e2e turn off Firefox's check of third-party roots (a self-signed test server stops HTTP/3 otherwise: measured)

The Alt-Svc is learned and the QUIC handshake of validation passes with the override, then Firefox closes the connection itself because the chain
ends in a root it does not know, and every visit stays h2. With network.http.http3.disable_when_third_party_roots_found off the three visits read
h2, h3, h3 (3 runs of 3, no proxy, on the engine of the first round).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the ICE server name of a PeerConnection is resolved in the context of its page, by the proxy of that context (red until the resolver carries the OriginAttributes)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the ICE-name e2e is part of wrapper.e2e.doh (11 tests)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the first datagram of a PeerConnection does not wait for a UDP association (red on the giro 2 binary: 396 ms)

The pool of UDP associations was warmed only in the process of the HTTP connections (the parent); the sockets of the PeerConnections
are made in the socket process, which found it empty and made its association from scratch: three answered steps before the first
STUN datagram. A gateway that answers every step after 130 ms makes it visible: on the giro 2 binary the first datagram leaves 396 ms
after the birth of the PeerConnection. The test asserts it leaves within 250 ms, and that an association was granted before.

The gateway of the tests now also keeps the wall-clock origin of its times and the instant of every accepted connection.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A TURN server over TCP is connected to and waited for, direct and behind SOCKS5 (e2e)

A TCP stand-in for a TURN server on this machine's address accepts, reads and closes N ms after the accept; the page asks for a
TURN allocation over TCP. A retail Firefox connects, sends the Allocate request and hears 701 when the server closes (accept
at 48 ms, 701 and the gathering complete at 850 ms with N=800). The candidate engine never connected: no accept, no bytes, 701 within
9-28 ms with the gathering complete, direct and through the gateway alike.

Red on the firefox-63 candidate build; green expected with the engine commit that binds the wildcard of the declared family.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the warm-pool and the TURN-over-TCP e2e are required in wrapper.e2e.udp (61 tests)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the gather without a proxy and the ICE-name e2e wait for the engine that carries the UDP line

test_the_gather_is_real_without_a_proxy (in wrapper.e2e.udp) had no the_udp_line, unlike the other tests of its file, and the
ICE-name e2e (wrapper.e2e.doh) resolves a name through the proxy of a context, which the engine firefox-63 does. On an older
engine they skip with the reason; on the candidate (firefox-63-candidate) they run, so the exact lists of
ci/required-suites.json are unchanged. The networkidle e2e stays ungated: it needs no proxy and no UDP, and is fixed by the
Python of the core and the wrapper on any engine. Review finding 14.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the declared-network e2e no longer sets variables the engine does not read

STEALTHFOX_WEBRTC_PUBLIC_IP and STEALTHFOX_WEBRTC_DISABLE_IPV6 are not read by the engine or the core (the unit test of the
declaration bans them in the environment); the e2e set and deleted them and imported _FAKE_EGRESS only for that. Dead setup
that said the egress still feeds WebRTC. Review finding 27.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: one helper for the address of this host, computed before any server starts, a host without a default route skips

this_host_address() and its two copies connected a UDP socket to 192.0.2.1 and raised OSError on a host with no default route;
in the chain it was evaluated as an argument after the TURN server, the resolver and the page were already listening, so the
test errored and leaked three listeners instead of skipping. The helper is now tests/_host_address.py (OSError => pytest.skip),
the chain asks it first, and the three copies are gone. Review finding 29.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ProxyEgressNonVerificabile: the docstring says what goes unconfirmed (timezone and locale), not an address

The engine no longer declares an egress address (the host network is drawn from the seed); only the timezone and the locale are
decided from the egress. Reworded like ProxyEgressDrifted, with a test on the text that fails on the old wording. Review
finding 30.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a context that is the only proxy resolves its names by DoH through it (red while TRR stays mode 0 for context-only proxies, green with engine 9bff9cf8de)

A session launched with no proxy, a context made with its own SOCKS5 gateway, a page at a name only the FakeDoh can resolve: the
name must be asked to the DoH by that gateway, the page reached by address through it, nothing to the DoH directly and no
question about the zone to the resolver of the machine. Review finding 4 (the e2e that was missing).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the context-only-proxy DoH e2e (wrapper.e2e.doh, 12) and the host-address helper unit tests (wrapper.unit.udp, 97) are required

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The page dispatcher waits for Page.ready before the page is handed over (needs invisible-core with Lifecycle.wait_for_page_ready)

Same defect and fix as in the core's page (see the core commit): a goto sent right after new_page could meet the page's initial about:blank.
The pin of invisible-core moves with the core release that carries wait_for_page_ready.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Pin invisible-core==62.65.0 (a page handed over when the engine says it is ready); changelog

The core that carries Lifecycle.wait_for_page_ready is invisible-core 62.65.0 (draft PR invisible_core#238), not on the index yet:
the pin check of this push is skipped on purpose (INVISIBLE_PIN_CHECK=skip).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stand-in engine of the registry test says Page.ready, as the real one does (the page is handed over on it)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a context with a proxy resolves by DoH through it and a context without one never uses the DoH; the first navigation of a fresh context never asks the system resolver (written ahead of the engine)

The context-only test also asserts that the DoH log holds no name but the proxied context's, that no handshake failed and that the
default context's background lookups reach the system resolver (the trap, where it runs). New race test: eight contexts created
and navigated back-to-back, a launch-proxy variant, and a proxied context beside one without a proxy. The DoH e2e docstrings
follow the per-context rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH of a proxied context when it is slow (2 s per answer) and when it refuses a name once; FakeDoh gains delay_s, delay_names and fail_first (written ahead of the engine)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the refused-once e2e shortens the DNS negative cache, so it measures a temporary block and not Firefox's 60 s failure cache

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: new_page and a popup are handed over only when the engine says Page.ready (red without the wait in PageDispatcher, green with it)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the resolver-race and DoH-under-stress e2e (wrapper.e2e.doh, 17) and the FakeDoh levers unit tests (wrapper.unit.udp, 110) are required

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the refused-once e2e says what it measures and what it does not

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the engine never reads the host's hosts file, with a proxy or without (MOZ_LOG per process, with a control)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the hosts-file e2e is required in wrapper.e2e.doh

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: h3 behind a proxy follows the definitive retail (never h3 at visit 1, h3 within 5 visits, h2 every visit without usable UDP)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A page is built at once and announced when the engine says Page.ready (the wait inside the constructor held a popup's first request behind a page that did not exist yet, and lost its commit and load)

- PageDispatcher no longer waits in __init__; wait_until_ready() is called by the adoption between the construction and the announcement
  (context 'page' event, newPage answer). A detach while waiting ends the wait; a page that is not ready in time is disposed.
- The main frame's initializer carries what the lifecycle already knows (url, name, load states), as every other frame's does.
- Tests: unit (a popup exists and listens while it waits; what it does before its ready reaches its frame; red on 6a60dce) and e2e
  (a popup of a link, noopener or window.open reaches an in-process and a stock client of a served browser within 2 s, with and
  without a context route; 15 of 16 red on 6a60dce, 16 green).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stand-in pages say wait_until_ready; the popup e2e reaches the stock client as the other served tests do

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the popup reaches the client from another site too (a link, noopener, window.open: 16 more cases, in-process and through a served browser)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A popup is reported on Page.ready as Playwright's is: no limit and no warning, with the address of the commit that came with the ready

- Stock Playwright 1.62 (measured): a 204 or a silent destination gives no page event, one that answers after 4 s gives it at 4 s with the
  destination already. The adoption of a popup waited 20 s and dropped it with a warning; now only a page a caller asked for
  (newPage) has the 20 s; a popup waits until the engine says Page.ready, the target goes away, or its context closes
  (BrowserDispatcher.end_waits_of), and says nothing.
- The ready and the commit of the document that made the page ready come in the same turn: the page is announced after a round trip to the
  engine (settle_events), so the frame reads the destination at the page event (3 of 4 slow popups said about:blank).
- In-process the slow popup arrived 0.9 s later than stock: it is the humanised click (1.1 s of pointer movement before the click returns),
  the popup arrives 4.02 s after the click in both modes.
- Tests: unit (limit None for a popup and 20 s for a requested page; a popup with no ready ends with its context and says nothing; the
  address at the page event is the commit's) red on b09d620; e2e (204 and silent: no event; 1.5 s: url is the destination; 25 s: reported
  then) in-process and through a served browser: the 25 s ones red on b09d620.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A download started by a popup that is not announced yet is reported on its opener, as Playwright reports it

- Browser.downloadCreated names the tab the download came from. A tab opened for an attachment (a target=_blank link, a window.open) never gets
  a Page.ready and the engine closes it at once, so it is not among the announced pages and the download was lost: no download event
  anywhere (a21e1de had it, on the popup). Playwright's ffBrowser._onDownloadCreated reports it on the opener of a page that is not
  reported yet; so does this, from the opener recorded when the target was attached (BrowserDispatcher._openers). The abort of the
  navigation that became the download still goes to the page that owns the frame.
- Tests: unit (red on fbceeaf); the e2e of the destinations and of the popup matrix of the fake-web branch (73f1e8d): 16 + 34 cases against
  the reference measured on stock Playwright 1.62 - on fbceeaf 4 of the 16 were red (the download), now 50 of 50 green.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the page and popup suites of 0.50.1 are required (wrapper.e2e.page 96, wrapper.unit.page 17), wrapper.unit.udp counts 113 after the merge

* ci: the drive gate launches through the core (the engine waits for the session's road; bare Playwright never sends it); the declaration test does not resolve an engine

* A popup tells its listeners the load it reached before it was announced; an unannounced frame has no address of its own

- The popup is announced when the engine says Page.ready, which is when its document commits, so its domcontentloaded and load may be said
  before the client has the page: page.on('load') registered in the handler of the page event never fired (Playwright's does, measured by
  the independent run: destinations of 4 s and 25 s). FrameDispatcher.emit records those two states while the page is not announced and
  PageDispatcher.announce says them again right after the page event, in their order and under one lock; the first time they already set
  the state wait_for_load_state reads, so it returns at once. Only popups: a requested page is announced as before.
- The main frame is created with the address the lifecycle knows, '' if it has committed nothing (an attachment's empty tab), not
  about:blank: Playwright says '' there.
- Tests: unit (the two states after the page event, in order; red on 2f153c7); e2e: a listener registered in the handler of the page event
  hears the load of a slow popup, wait_for_load_state in the handler returns in under 2 s (in-process and a stock client over a served
  browser, window.open and link).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the first visit of the h3 e2e is h2 because the fixture has no HTTPS record (the retail read h3 first in 3 sessions of 15); the FakeDoh never serves type 65 and the tests assert it

* A popup whose target goes away while its page is being built is announced and closed, not waited for for ever

A download's empty tab is closed by the engine within milliseconds; on a loaded machine its page is still being built when the detach arrives.
_handle_detach recorded it as early (nobody in _building to tell) and the adoption then waited for a Page.ready that never comes: the
popup was never announced (test_popup_destinations_e2e, the download on the opener, failed once in a full suite run). The adoption now
looks at the early detaches when it registers the page as waiting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A command of the adoption that finds the target's session gone announces and closes the popup, as a detach before the ready does

The independent run on a quiet machine lost one link-into-attachment popup in a hundred: the engine closed the tab WHILE the adoption was
initializing it, answered 'cannot find session' to Page.setInitScripts, and the popup was discarded with a warning - no page event - where
Playwright's is announced and closed. PageDispatcher._build now treats an initialization command that fails because the target or its session
is gone (one test: _target_is_gone) as the same case: the page is built, flagged gone_while_building, and the adoption announces it and closes
it right after. Test: a fake engine answers 'cannot find session' to each command of the adoption in turn (parametrised): the page event and
the close arrive, no warning; red on b05741f for Page.setInitScripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the page and popup suites count the tests of release/0.50.1 6200bc2 (e2e.page 100, unit.page 24)

* ci: test_a_page_that_moves_on_e2e.py is required in wrapper.e2e.page (114): the e2e of the engine fix for a navigation the page overtook

* tests: the resolver trap says why it could not bind (the error of the socket)

* tests: the helper of the popup destinations does not shadow the browser fixture (ruff F811)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the resolver trap takes the first loopback address it can bind for port 53 (a hosted runner can hold 127.0.0.1:53) and writes that address in resolv.conf

* tests: two connections on one page are judged on the road they take, not on the clock of the machine

The test asserted a median of 30-55 ms, the time of a fast machine. On a GitHub runner the same healthy engine takes 67 ms (Windows) and
122 ms (Linux) and the gate was red on both: an absolute time is a verdict on the machine.

Every one of the five cold launches is now judged on what the machine cannot change:
* the data channel opens and echoes;
* each connection gathered a UDP host candidate named by mDNS (a run without UDP is the reserved-port failure: the socket could not bind and
  the connection fell back to TCP);
* the nominated pair, read from the browser's own statistics, is host to host over UDP at both ends (no road through TCP; a succeeded pair
  means the other connection's mDNS name was resolved);
* it opens in less than the responder's first retry (3 s): a name that does not come back opens only at the retry.
The time is printed beside the retail window, as a measure.

Run on the firefox-63 candidate engine: passes, [38, 39, 39, 73, 77] ms.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a caller that asks for the ICE in the content process, or for no socket process, gets the srflx through the relay all the same (the engine locks both prefs)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: wrapper.e2e.udp counts 68 (the three ICE rows of test_webrtc_realness: default, content process asked, no socket process asked; the engine locks both prefs)

* tests: the popup tests do not fail on the machine's speed (no 2 s limit)

A runner with four workers delivered a popup in 2.013 s (the limit of the test was 2 s). The verdict of these tests is that the popup arrives with
its address and its load; the wait is generous (30 s) and the check of the time is gone. The wait_for_load_state of the handler is bounded by 8 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the popup tests do not fail on the machine's speed (no 2 s limit)

A runner with four workers delivered a popup in 2.013 s (the limit of the test was 2 s). The verdict of these tests is that the popup arrives with
its address and its load; the wait is generous (30 s) and the check of the time is gone. The wait_for_load_state of the handler is bounded by 8 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the fixtures that several e2e files share are in conftest.py, not imported from a sibling file (ruff F811, the lint of the tests job)

A fixture imported from a twin file and then named as a test argument is a redefinition: 60 F811 in the new tests of the UDP line, the
same error that turned the 0.50.1 CI red. The collection does not change: the same 2187 tests (1422 by default), the same setup plan
(fixture order and scope per test, compared with --setup-plan before and after).

- conftest.py: doh, gateway, trap, watcher, pages (DoH e2e), socks5_tcp_only, local_https_page (WebRTC e2e) and browser (the two-transport
  fixture of the popup tests). The heavy imports are inside the bodies, so a run without the e2e extras still collects.
- _doh_support.py (ZONE, Pages) and _socks_servers.py (Socks5TcpOnly, was _Socks5TcpOnly in test_webrtc_realness.py): the plain code the
  fixtures need, in support modules, not in a test file.
- The twin files keep what is not a test argument (the autouse _hermetic_session and the helpers, imported by name); the sibling files
  stop importing the fixtures. The four `# noqa: F811` of test_popup_destinations_e2e.py are gone: ruff passes with --ignore-noqa.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the trap-policy test reads the trap fixture in conftest.py (6b moved it there with the lint of the fixtures)

* The adoption of a target is one explicit state machine, proved over every order of the engine's events

Four patches of the same race (a detach before the ready, during the build, between the build and the wait, a command answered 'cannot find
session') and a fifth the exhaustive test found (a detach while the adoption waits for the main frame of a tab the engine never announced:
the wait went on for 20 s and the popup was discarded; this is the order the runner produced for the download popups: 3 of 4 lost).

- _Adoption: the single record of a target between its attach and its announcement: state (attached, building, waiting, announced), gone
  (set by the engine's detach AT ANY MOMENT), page, opener, context. It replaces _adopting, _building, _openers and _detached_early.
- Every wait of the adoption looks at gone (the main-frame wait polls it), every state change is one method (_enter_building, _enter_waiting,
  _enter_announced), a command that finds the session gone ends in the same place as a detach, a closing context takes away every adoption
  of it in any state (end_waits_of).
- Invariant: an attached target that is not a page a caller asked for gives the client exactly one page event, at its ready or at its
  disappearance (and its close right after), unless its context closed first.
- Test: test_every_order_of_the_events_of_a_popup_gives_one_page_event stops the adoption thread at six points of its own and delivers the
  engine's events (frame, commit, ready, detach, in every prefix) at every one of the eight moments: 635 orders, none sampled. Mutation
  check: without the gone-aware main-frame wait 24 orders break, without the tolerance of the command error 42, without the close after the
  page 374; without the early-gone check of _enter_waiting the adoption hangs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The adoption keeps a short trace per target and writes it where a popup is dropped or fails

The log of a CI run says that a popup was not announced and not in which order the engine's events came. Each target in flight keeps (in memory,
at most 60 short strings, nothing afterwards) what the engine said (frame, commit, ready, detach) and what the adoption did (building, waiting,
announced), with the milliseconds since the attach. It is written in the warning of a failed adoption, in the error the newPage waiter gets, in
the timeout of a requested page, and in browser._dropped (the last 16 targets dropped with their context).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The WebGL determinism test says why the browser could not make a context

One run in 31 of the e2e on a loaded Linux runner failed this test with "reason='gl null'" and nothing else: getContext('webgl') gave the page null. The browser
says why in the `webglcontextcreationerror` event (statusMessage: the failure list, e.g. "tryNativeGL (FEATURE_FAILURE_EGL_LOAD_3)", "Initializing WebGL backbuffer
failed.", "GL error 0x505 occurred during OpenGL context initialization"), and each of the paths that can produce null on Linux in our engine writes a different one
(library not loaded, display not initialised, context not created, GL out of memory, backbuffer not allocated). The test reads the event and puts it in the
assertion, and tries webgl2 on a fresh canvas (the old canvas already had the failed type).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the same-site control of the Fission bench measures the frame, not the process pool

The control counted the processes that host a site between two reads, with the default pool of three preallocated content processes: a pool
process handed to a site after the first read moved the count without the frame having asked for anything ([63248] -> [63248, 63386] on a
four-worker runner; the same family as 5402da4, ff2123e and fef0bc5). The control now runs in a browser with dom.ipc.processPrelaunch.fission.number
at 0, where a process of a site appears only because a site needed one, and says so if the page of the site has no process to compare with.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH e2e declare the exit the UDP measurement asks for; the gateway's page is reached by an address; e2e.udp is split in e2e.udp and e2e.web; the trap says who holds port 53

* tests: two connections on one page may nominate a peer-reflexive end; the road is what is judged

On the round 3 gate (Linux, run 43164943499) the nominated pair was host to prflx: the other connection's mDNS name was not resolved yet when its
connectivity check arrived, and the address the check came from is learned as peer-reflexive. That is the same direct local road, so the test accepts
host or prflx at each end, over UDP at both ends, and refuses what is a different road: a relay, a server-reflexive candidate (through the proxy or the
network), or TCP. The open time stays judged against the responder's first retry, and printed beside the retail window.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a port 53 that cannot be bound is redirected from 127.0.0.2 to a free port (iptables nat OUTPUT), the rules go with the trap

* tests: the resolver trap ends its threads before it closes its sockets, so its port is free for the next test (no more "Address already in use" on 127.0.0.1-8:53)

The answering threads sit in accept()/recvfrom(); on Linux a close() from another thread does not wake them and the kernel keeps the socket
bound until the call returns, which it never did: every trap left its address taken, and the eighth trap of a run found all eight taken
(reproduced here in a container: 19 DoH e2e, the 6 tests after the 8th trap are errors; alone, the same file passes). The loops now wake every
0.2 s to look at a flag; the teardown sets it, joins the threads, and then closes the sockets.

- test_a_closed_trap_gives_its_port_back_at_once (wrapper.unit.udp 139 -> 140): a trap on a free port is closed and a second one on the same
  port must bind 127.0.0.1 again; red on the old code on Linux.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The download of a tab that is not announced yet is said after the page event of the tab

The tab opened for an attachment is announced when the engine takes it away, a few milliseconds after it says the download; the download
(reported on the opener) went to the client first, the popup after: the order the other way round from Playwright's, and a client that read
the popup the moment the download arrived found none on a one-CPU machine (the 4 download cases of GitHub, 3 of 4 red; the same on a one-CPU
container: 1, 0, 2 of 50 on a90dadc). The adoption holds the download on its record and says it right after the page event (never lost: also
when the tab is dropped or fails).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the discovery of the exit of a context stays covered now that the DoH e2e declare it away

The DoH e2e declare the exit the core asks for (their subject is the roads of the browser). The discovery itself keeps its own test: it goes
through the gateway of the context, by name, only to the services of the core, never through another context's gateway, and a gateway that
refuses them never makes the measurement say coherent. wrapper.unit.udp 140 -> 142.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the iptables fallback of the resolver trap is gone (the cause was the trap's own threads holding the port, fixed in 4933f8c); wrapper.unit.udp 141

* tests: the realness check without a real proxy - six declared exits, the values a page reads, and the judges

The manual check drove the browser through a paid proxy and compared what a page reads with the proxy's exit. This is the
same check against a local SOCKS5 gateway that declares its exit: a local site that tells a connection the gateway opened from
a direct one, FakeDoh for the names, and the core's own geo database as the truth for the zone and the country.

* test_realness_behind_a_declared_exit_e2e.py: one launch per exit (six, in six countries), read by five tests (the address a
  site sees and no connection past the gateway; nothing of the host in the WebRTC candidates and SDP; the names reach the gateway
  and not the system resolver; the zone, the offsets read two ways and a worker; the language of the page, a worker and the
  Accept-Language header against the exit's country), plus the vendored detection page loaded behind the gateway.
* _realness_support.py: the exits, ExitGateway (remembers the ports of the connections it opened), the site, the reads, the judges.
* test_the_realness_helpers.py: the judges and the gateway/site correlation held to golden reads, no browser.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the realness e2e (32) is a required suite, its helpers (24) join wrapper.unit.udp (165)

* A download is taken with the record's removal in one step, and the opener of a target not announced is remembered: no step of the adoption can lose it

The failure branch said the pending downloads BEFORE it removed the record: a download created between the two found the record, queued on it, and
nobody said it. Taking the pending downloads and removing the record are now one step under the browser's lock, in the three branches
(announced, dropped with its context, failed); the opener of a target that ended without being announced is kept for the last 16 targets, so a
download that comes after the record is gone is still said, on the opener. Test: the download is forced into the gap of the failing adoption
(red on 65f7580: said 0 times, now once).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: wrapper.unit.page counts the popup-order test and the changed page tests of release/0.50.1 8049df3 (32)

* wrapper: the opener kept for the downloads of a target whose adoption failed lives until the engine detaches the target, and none is made for a target already detached; unit tests (unit.page 34)

* tests: the first datagram of a PeerConnection is judged with the session's UDP declared coherent, and the core's own probe is not counted as the engine's association

The giro 3 gate was red on this test: with a fixed time zone the core does not discover the TCP exit, so it cannot compare it with the UDP probe's mapped
address and declares the UDP of the proxy unmeasured; the engine then treats the proxy as a router that drops UDP, asks it for no association and sends
nothing (measured on the giro 3 Linux binary: the gateway saw ONE ASSOCIATE for the whole test, the core's probe; the layer was pushed on the PC's
socket and what was sent was dropped). The test gives the core the gateway's TCP exit as every e2e of the line does (egress_by_proxy), and it no longer counts
the probe's association (the first of the gateway, made before the browser exists) as one that was ready before the PeerConnection - it passed an
engine that asked for none. Green on the giro 3 Linux binary (run 43164943499).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the CONNECT helper of the HTTP proxy tests reads the answer one byte at a time, so the first bytes of the tunnel are not lost with the head; unit test (unit.udp 166)

When the far side wrote and closed at once, the 200 and the first bytes of the tunnel could reach the socket in one segment, and _connect_raw dropped everything after the blank line: the caller read the end of the stream instead of the data (run 43176569993, test_a_connect_to_loopback_is_relayed_and_one_that_would_leave_it_is_refused).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the chain by name allows loopback in ICE, because the lab's exit is 127.0.0.2 and a retail Firefox throws away an answer whose mapped address is loopback

The giro 3 gate was red on test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick. Measured on the giro 3 Linux binary (strace of the socket
that talks to the relay + the gateway's own log): the gateway delivers the TURN server's 401 and then its success (type 0x0103) within 5 ms, the browser
reads both, answers the 401 with credentials, and never accepts the success: it retransmits the same Allocate 5 times in the 2 s of the page. The
success carries XOR-MAPPED-ADDRESS 127.0.0.2 (where the gateway's datagrams leave from, by design of the test) and nICEr rejects a loopback mapped address as
bogus (stun_client_ctx.cpp nr_stun_transport_addr_check) unless the ICE context allows loopback (turn_client_ctx.cpp; the flag is set from
media.peerconnection.ice.loopback in nricectx.cpp). The same TURN server answers a direct browser at a non-loopback address and the allocation completes in
60 ms, so the chain is sound. With the pref the chain test passes at 130 ms of round trip on the giro 3 binary; without it it fails at 0, 65 and 130 ms.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the comment of the first-datagram test says why the core's discovery of the exit fails in the lab (no echo service is reachable), not that a fixed time zone skips it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH, stress and ICE-names e2e ask for a virtual display on a Linux machine that has none; unit tests (unit.udp 173)

Run 43176569993: 19 of 19 of wrapper.e2e.doh on Linux died at the launch with "no DISPLAY environment variable specified". Those files launched a headed browser without a screen (the runner has none, and the suite runs under sudo). The other e2e launch with headless=True, which is a headed browser on an Xvfb the wrapper starts itself. A machine with a display, and Windows, are left as they are.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the chain by name reads its srflx and its relay from the page with a gateway exit that is not loopback, and the loopback pref is gone

The exit of the lab is 198.51.100.9 (documentation, RFC 5737), held on lo with ip addr add for the length of the test; nICEr accepts it as a mapped
address (nr_stun_transport_addr_check rejects only wildcard, loopback and link-local), so the product's own setting is what is under test, not a pref that
is off in production. The page must read a srflx equal to the gateway's exit and the relay candidate of the TURN server it asked.
The file moves to a suite of its own, wrapper.e2e.udp.exit (Linux only, root): adding an address to an interface needs administrator and changes the network
of the host, so the Windows suite does not collect it (a skipped test would turn the verdict red). Chain takes exit_host; the TURN helper test runs for two exits.
Red on the old code: with the 127.0.0.2 exit and no pref the test fails at 0, 65 and 130 ms; green on the giro 3 Linux binary at 130 and 0 ms (container).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH, stress and ICE-names e2e always launch on a virtual display (headless=True, as the UDP and realness e2e); the helper that looked at the display of the host is gone; unit tests (unit.udp 177)

A test does not behave differently by the display of the machine it runs on. Replaces the helper of 302af97.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the QUIC of the gateway test works on Windows: the relay leaves from the host's address, is told by its port, and a send that fails is said; unit tests (unit.udp 176)

On Windows the e2e read h2 on five visits and 'the server saw QUIC from []': the relay of the gateway sent from 127.0.0.1 to an address of its own
host (WinError 10051, nothing sends from loopback to the host's address there) in a timer that ignored every OSError, after logging the datagram as carried.

- the coherent gateway of the h3 test leaves from the host's address on every system (exit_host), and its fake STUN is bound there too (Windows sends
  neither from the host's address to loopback, 10049, nor the reverse); the relay is told from a client that came direct by the PORT it sends from
  (Gateway.exit_ports, H3Server.quic_peer_addrs); it forwards only to this host (forward_only_to): the browser's own QUIC to the Internet stays in the lab.
- Gateway._later records a send that raised (send_errors) and the report of the test shows it; the test asserts there is none.
- the relay's sockets turn SIO_UDP_CONNRESET off on Windows and a ConnectionResetError no longer ends the thread that reads.
- unit tests: a failing send is recorded and reported; a relay that leaves from the host's address reaches a server there, by a port in exit_ports and not
  one of a direct client; the fake STUN answers through it. Red on the old helpers (they have no exit_host/exit_ports/send_errors).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: three e2e modules of the UDP line are bound to the engine that carries it, as the others are

test_networkidle_through_a_served_browser_with_routes_e2e.py (red on firefox-61 and 62: its engine fix, 0972db59da, is in the 63), test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py
and test_turn_over_tcp_is_tried_for_real_e2e.py (red before the UDP line) had only pytest.mark.e2e, so the e2e job of main, which fetches the PUBLISHED engine, would run them
against it. They now carry usefixtures(the_udp_line): they skip on an older engine and run on the candidate (REVIEW-63 #14). The collected counts do not change
(21, 1, 2); the ids stay in ci/required-suites.json, and a skip on the candidate is still red there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the chain by name keeps its walk on Windows (exit of the lab on loopback, with the pref) beside the one without the pref (wrapper.e2e.udp.exit, Linux)

d41ea7e moved the whole file to the Linux-only suite. Now the file holds two tests: the walk with an exit that is not loopback and no pref (wrapper.e2e.udp.exit, Linux, root), and the walk with the exit on 127.0.0.2 and media.peerconnection.ice.loopback (wrapper.e2e.udp, Linux and Windows). Selected by node id; wrapper.e2e.udp 41 again; the notes of the two suites say why.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* request.resource_type agrees with the pinned driver: a beacon is `beacon`, a CSP report `cspreport`

The table that turns a Juggler cause into a Playwright resource type was a copy of the driver's and had gone stale: the pinned
driver (1.61, coreBundle.js ffNetworkManager) says `beacon` for TYPE_BEACON and `cspreport` for TYPE_CSP_REPORT; ours said `other`
for both. Measured on cnbc.com and scmp.com, our engine and Playwright's own Firefox side by side: the same POSTs (2 and about 8
per page) are `other` here and `beacon` on stock, so a client or a route filter that looks for beacons saw none.

Test (red on the old table): the driver's own table is read from the installed package and every cause it names must map to the
same type here; the next driver version that changes it fails the test, nothing is updated by hand.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The old table test expects beacon for TYPE_BEACON, as the pinned driver says

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the DoH session built by hand launches on a virtual display too, and a test reads every direct InvisiblePlaywright(...) of the DoH and realness files (unit.udp 181)

Run 43188313516: test_a_session_without_a_proxy_resolves_with_the_system_resolver died with "no DISPLAY environment variable specified": it builds its
session by hand (not through _launch) and was not covered. The new test parses the files of the two suites and fails on a construction without headless=.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the resolver trap counts the questions of the user that runs the test, by the owner of the socket (/proc/net), not by name; unit.udp 189

Run 43188313516: on a runner the agent of the runner asks for github.com, api.github.com and its orchestrator through the /etc/resolv.conf the trap
rewrites, and the trap blamed the browser (6 realness tests and 1 DoH test). A question whose socket belongs to another user is answered and
listed in trap.foreign, not counted. The owner is read on receipt, before the answer: measured on Linux, 3000 questions that wait for their answer,
0 unreadable; one that cannot be read counts as the browser's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: a loss is not a drop - behind a proxy that cannot carry the UDP of a PeerConnection, nothing of the browser reaches a witness direct (suite wrapper.e2e.udp.exit)

The e2e that check 'no srflx' cannot tell the fail-closed rule from a leak: at an address nothing routes a datagram sent direct arrives nowhere, exactly as a dropped one.
A witness (_witness.py: a STUN server and a TCP listener at 198.51.100.10, held on lo, reachable by the browser directly) hears who contacts it, and the gateways leave from ANOTHER
documentation address (the exit, 198.51.100.9; the test gateway's TCP now leaves from it too, opt-in: tcp_from_exit). In each fail-closed scenario - a SOCKS5 proxy that refuses UDP, one whose UDP
leaves from another address, one whose relay never answers, an HTTP proxy - the witness hears no datagram and no connection from a source that is not the exit; a send direct is red. The controls
that make the green mean something: the same page with no proxy IS heard by the witness (datagram and connection), and behind a coherent gateway the witness hears the exit only.
Proved in the container on the giro 3 Linux binary (green, 7 tests of the suite). The witness and the gateway's source binding have unit tests (192). Counts: wrapper.e2e.udp.exit 7, wrapper.unit.udp 192.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* launcher: preload_newtab, the option of the core that turns off the preloaded New Tab page

InvisiblePlaywright(preload_newtab=...) (sync, async and launch_server)
hands the core's option of the same name over, only when it is not None:
a wrapper paired with a core that does not know it cannot meet a
TypeError for a caller who never used it. None keeps the retail's
behaviour; False writes browser.newtab.preload false (no privileged-about
process); True says the retail's value aloud; a pref in extra_prefs wins.

Tests: the kwarg reaches the core only when asked and is a parameter of
every entry point; the e2e reads the process types from the engine's log
(MOZ_LOG=Process:5): privilegedabout exists by default and is absent with
the option, on every platform.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: wrapper.unit.udp counts the three tests of preload_newtab (195); its e2e is in no suite until it has been seen green

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the constructor signature knows preload_newtab; the witness takes TCP first (Windows excluded ranges); the preload_newtab e2e (seen green as root on Linux) joins wrapper.e2e.udp.exit (9)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: wrapper.e2e.udp.sandbox (Linux, a normal user, the browser's sandbox on): the socket process and a tab process must have a seccomp filter, plus the three situations of the UDP line (a proxy with UDP, no proxy, a proxy without UDP with the ICE name by DoH)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the preload_newtab e2e moves to wrapper.e2e.udp (seen green on Windows, 10 runs of 10): udp 43, exit 7

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the UDP witness binds TCP and UDP on one number even where the system's picks fall in a refused UDP range

Witness("127.0.0.1") failed with WinError 10013 in three unit tests of
wrapper.unit.udp on a Windows work machine, while the push before had passed
them. Windows hands out ephemeral TCP ports in sequence and keeps excluded
ranges of a hundred ports for UDP in the same zone: the witness asked the
system for a TCP port twenty times, got twenty consecutive numbers inside one
UDP range, and gave up.

Now each try binds TCP and then UDP on the same number, and if either is
refused both are released and another number is tried: the first is the
system's own pick, the others are drawn at random below both Windows'
dynamic range and Linux's ephemeral range, so they are not the next of a
sequence. 200 tries at most, then an error that names the address and the
last refusals. A port asked for is tried once and its refusal raised.

Test, red on the old code (2 of 3): a fake socket layer whose TCP picks are
sequential and whose UDP refuses 50000-50199. Real sockets on that machine,
20 runs of the witness tests each: old 19 of 20 green, new 20 of 20.

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

* ci: wrapper.unit.udp counts the three tests of the witness port pick (198)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the sandbox leg finds the tab processes (forked by the fork server, their argv has no 'tab' at the end): the kind comes from the last word, else from the Name in /proc/<pid>/status

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the resolver trap counts the questions of the processes of the test (the socket's inode, the process that holds it, its parents), not of a user; a question of any other process is listed with its pid and command

Runs 43188313516 and 43211837926: on the runner the agent of the runner, as root like the browser under sudo, asks for github.com, api.github.com and its orchestrator
through the trap's /etc/resolv.conf, and a user filter cannot tell it from the browser (6 realness tests red). Measured on Linux, 40 questions of a descendant and
40 of an orphan process of the same user: 40 counted, 40 foreign, each with its pid and command. One whose process cannot be traced is judged by its user, one whose
socket is gone counts as the browser's.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the resolver trap counts the BROWSER (a browser process and what it starts), not the test process nor the core it runs: the core asks github.com for the latest GeoIP tag as root, the test says the browser asked

Measured on Linux: a process named firefox and its child counted 20 of 20 each; the test's own python and an orphan of the same user foreign 20 of 20 each.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* juggler: a download that finished before it was announced is finished

BrowserDispatcher._on_download_finished keeps the error of a download whose
artifact does not exist yet; a successful download has no error (None), and
_on_download_created popped it with a None default and tested `is not None`,
so the artifact was never marked finished and save_as, path and failure
waited forever. A module-level sentinel tells "nothing recorded" from
"finished with no error". The entry is also popped before the
unknown-context early return, so it no longer stays in the dict.

Tests: unit file (red on the old code for the success and the gone-context
cases) and a served-browser e2e with ten 300-byte and ten 1-byte downloads.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* juggler: an early download finish lives only as long as it can be read

The review of 6a50ad1 found three cases where an entry of _finished_early
stayed for the life of the browser: (a) a download announced while its
context was already closed, whose finish came after; (b) a finish after the
client released the artifact; (c) a finish of a uuid never announced.

The browser now keeps, per announced download, the context it belongs to,
until its finish or the end of that context. A finish whose download was
announced and whose artifact is gone writes nothing; only a finish of a
download not announced yet leaves an early entry, and those are bounded (64,
the oldest dropped first). The end of a context forgets its downloads that
never finished.

Tests, red on 6a50ad1 (4 of 10): (e) gone context, (f) released artifact,
(g) never-announced finishes are bounded, (h) the end of a context forgets.

NOT proven: that the engine ever sends a finish after the end of a context,
or a finish before the announcement. On one connection Juggler says a
download's creation before its end (TargetRegistry.js interceptDownloadRequest
then onDownloadComplete), so the early path is defensive. The e2e of tiny
downloads is a proof of use, not of the order; its docstring says so.

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

* Release 0.51.0: engine firefox-63, pin invisible-core 63.66.0; CHANGELOG for the UDP line

* Release 0.51.0: the README says what the launch counter is and how to turn it off; the CHANGELOG says what is known to be wrong (popups opened without a route, as measured)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.51.0: the served launch cannot turn the launch counter off (a client's firefoxUserPrefs, bare or marked, are refused with the core's message); the history says it is no longer possible

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the two tests that ask the resolver trap from the test process say that the test stands for the browser

Since fc10e257ca the trap counts only the questions of a browser process, found by the process that holds the socket in
/proc/net. That is only possible on Linux; on Windows every question counts, so the pre-push (Windows) stayed green
while test_the_trap_counts_a_query_it_is_sent_and_refuses_what_it_cannot_answer failed on Linux (republish run
43230437094, wrapper.unit.udp/linux: 1 failed, 218 passed): the test asks from its own python, which is not a browser,
and the question went to `foreign`. The same holds for the resolv.conf test of the root legs.

Both tests now pass is_browser=lambda pid: True. The trap itself is unchanged, so the realness leg judges the same code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the HTTP/3 test server finds a port that TCP and UDP both bind where the system's picks fall in a refused UDP range

wrapper.e2e.web on the Windows runner (republish run 43230437094) failed three tests with "no port free for both TCP and UDP",
and the pre-push failed the same way on a work machine: Windows hands out ephemeral TCP ports in sequence and keeps excluded
ranges of a hundred ports for UDP in the same zone, so the old loop (fifty times the system's pick) got fifty consecutive numbers
inside one refused range. The first try is still the system's pick; the others are drawn at random below the dynamic range, as
the witness already does (same constants), and the refusals are named in the error.

Two tests with a fake socket layer (TCP picks 50000, 50001, ...; UDP refuses 50000-50199): the old loop is red on it, this one
finds a number outside the range; and a server that can bind nothing says so after a bounded number of tries. wrapper.unit.udp
goes from 219 to 221 tests (ci/required-suites.json).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.51.0: the CHANGELOG and the README say only what is proven (counter: what the package refuses and whose repository counts; the real name of the async class; the popup numbers of the register; Windows memory only; addBinding out)

Markdown only. Following the fact check of the release texts: the launch counter is refused by the package's launcher and server
(not "not optional" for the engine alone) and counted in the engine's repository; preload_newtab names the async class by its real
path and keeps only the Windows numbers that have a saved run, with the engine they were taken on; the protocol mirror line about
Page.addBinding is out (not shown for the pinned engine); the differences section no longer claims a comparison run nobody saved;
the popup known issue states where, with which client, on which engines and with how much load it was seen, with the numbers of the
register, and that the correction is in 0.51.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* user-install: the wait asks pip, not the JSON page of the index, and fails saying what is missing; the upgrade test installs the version its listing named

Ledger #476 of 0.50.1: the Linux job failed in test_upgrade_e2e ("the upgrade did not move the wrapper", '0.49.1' != '0.49.1') three
minutes after the upload. The step that waits for the index had asked the per-version JSON endpoint, which answered; the listing of
`pip index versions` had 0.50.1; the `pip install --upgrade` that followed was still served the 0.49.1 page.

The wait now runs `pip download --no-deps --no-cache-dir invisible-playwright==X` (the client and the index the install uses), for at most
ten minutes, and ends in "::error::the index does not have X yet, after N minutes" instead of a warning and a run that fails later. The
upgrade test takes previous and latest from one listing and installs `WRAPPER==latest`. Four unit tests run the script of the step with a
pip that fails until its Nth call; the core's install_job gate still passes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the fake pip of the wait test is a regular package, so the pip of the environment cannot shadow it

CI (runs 43196645121, 43196645144): 2 tests of the wait for the index failed on every Python of both systems. The shim was a directory with a
__main__.py and no __init__.py: a namespace package, which loses to the regular package `pip` of an environment that has one (a local uv venv
has none, so it passed there). The real pip ran, said "No matching distribution" for 9.9.9 and the shim was called 0 times. Reproduced in a venv with pip;
red without the __init__.py, green with it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: ask for the processes of a site by its name, never count between two reads

The e2e tests that looked at content processes compared the set of
"Isolated Web Co" processes before and after an action. The browser starts
processes of its own: the pool refill, and a process for a Mozilla site
(webIsolated=https://mozgcp.net) that the New Tab page starts about a second
after its own, with any page. Under load it was born between the two reads:
the same-site control was red in 14 of 30 runs of the whole e2e suite
([P] -> [P, P2]), the cross-site test could pass on that process alone, and
the service-worker test could read it as a process left behind.

With the test-only pref fission.processSiteNames a content process that hosts
a site is named by that site (http://a.test^u on Linux, cut at 15
characters). tests/_processes.py now returns the processes of one site by that
name; the bench and the service-worker test use it. Linux only, as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the popup process case has a browser that starts no process by itself, and asks by name on Linux

test_the_other_site_popup_runs_in_another_process counted every content process
between two reads, so a process the browser starts by itself (the pool refill,
the preloaded New Tab page and, in some countries, a process for a Mozilla
site) was taken for the popup's doing. It now has a browser of its own, on each
transport, with no preallocated processes and no preloaded New Tab page
(test-only prefs), so the count between two reads is the popup's. On Linux it
also asks by name that one of the new processes is the process of localhost.

It still runs on Windows, with no skip: the required suite wrapper.e2e.page
collects this file on both systems with an exact count, which is unchanged (34).

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

* tests: the popup process case runs its own browser in a thread of its own

The e2e of the previous commit failed at setup: the module's browser of the
matrix keeps a sync client open in the test's thread, and a second sync client
refuses to start inside its loop ("Sync API inside the asyncio loop"). The case
now opens its quiet browser in a thread with no loop and hands back its result
or its error. Same count of tests (34), still no skip on any system.

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

* Release 0.51.0: the CHANGELOG line of the process tests says only what is proven

Markdown only. The line that came with the end-to-end process tests carried a count of red runs and a cause of the extra
process that nothing saved; it now says that these are tests only and what they ask for.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.51.0: pin invisible_core==63.67.0 (the protocol mirror agrees with the published engine); the popup known issue says what the correction measured

invisible-core 63.66.0 carried a protocol mirror that differed from the Protocol.js of the published firefox-63 (the e2e job's
`--check` said DRIFT: a header count and the `ref` of two optional points of Page.getFrameOrigin); 63.67.0 is 63.66.0 with the mirror
regenerated from that engine. The pin moves to it.

The popup known issue: both causes found are in the wrapper (the hand-over of a new page to the client, and the replay of a new
page's events while live ones are being delivered). The correction of the first alone lowers the red cases over 20 runs from 15 to 2
with the firefox-62 engine but only from 17 to 13 with the firefox-63 engine; the correction of the second is under test. No version
is promised.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the SOCKS5 proxy test uses the suite's gateway that carries the DNS-over-HTTPS (the old fake answered the DoH with nothing); the CHANGELOG says what a SOCKS5 proxy now receives

test_socks_still_goes_out_through_the_proxy_after_the_roads_were_merged was written for the road where the browser handed the
SOCKS5 proxy the NAME (socks_remote_dns). Since the DoH road (decision core-19) a browser behind a proxy asks the name to a
DNS-over-HTTPS server THROUGH the proxy (network.trr.mode 3, no fallback) and connects to the address it gets. Its fake accepted
every CONNECT and answered nothing to the DoH, so the name never resolved: `Page.goto: domcontentloaded not reached in 30s`
(on Windows the launch itself failed first: "could not discover the egress IP through the proxy: the proxy accepted the connection
and then never answered"), and its second assertion (the name reached the proxy) could not be true by design.

The test now runs on the fixtures `doh`, `pages` and `gateway` (the suite's SOCKS5 gateway that serves the DoH and relays the
loopback): the page loads, the DoH asked the name through the gateway, the page was reached by address, and the NAME never reached
the gateway. The fake and its fixture are gone (nothing else used them). Red on the old test and green three times on the new one,
on Windows, with the published firefox-63.

CHANGELOG [0.51.0], Changed: one sentence for what a SOCKS5 proxy now receives (addresses, not names) and what a proxy that cannot
carry HTTPS to the DoH server resolves (no name). Said for SOCKS5 only: for an HTTP proxy the e2e of the DoH keeps it as an
assumption that an http page's name still goes to the proxy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* e2e.yml: the seven root e2e (wrapper.e2e.udp.exit) run in a root step as the gate runs them, and the run of the runner user leaves them out by name

Run 43262636367 of PR 483: the seven tests whose lab exit is 198.51.100.9 added to `lo` errored when collected as the runner user ("cannot hold ... needs root
and iproute2"). The new step copies the engine to /opt/ff and runs exactly those under `sudo -H -E env -u PYTEST_ADDOPTS -u XDG_RUNTIME_DIR INVPW_REQUIRE_TRAP=1`,
no rerun plugin, and reads its own junit: exactly 7 tests, no failure, error or skip. The full run gets --ignore/--deselect of the same tests (ROOT_FILES / ROOT_NODES),
so nothing is skipped silently and nothing runs twice.

Test: tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py reads the list from ci/required-suites.json and the workflow as text (no PyYAML); red on e2e.yml as it was.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* e2e.yml: the root e2e run AFTER the run of the runner user, and a diagnostic step says what root left behind

Run 43271443150 (PR 483): with the root step first, every launch of the run that followed waited for the browser's
readiness line until its timeout (46 stacks in connection.launch -> wait_for_ready) and the job was cancelled at 40
minutes; the same head without the step had 748 green. Now the root step comes after the full run
(if: success() || failure()), and the next step prints the files root left under the runner's home and /tmp,
/etc/resolv.conf and the addresses on lo (it decides nothing).

tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py now holds the order too: red on a5606dd's workflow
(the root step comes BEFORE the run of the runner user), green here.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
2026-11-12 19:55:32 +01:00
Federico EliaandClaude Sonnet 5.5 285e3ba93e ci: never cancel a run of main, one run per pull request commit, and test it (#477)
e2e.yml and tests.yml already ran once per commit of a pull request (push is
filtered to main, pull_request to PRs against main), but their concurrency
group was keyed on the ref and cancelled in progress everywhere. For a push to
main the ref is always refs/heads/main, so the next push cancelled the e2e
run of the commit before it, and scripts/e2e_is_green.py refuses a release
whose e2e check-run is `cancelled`. The group is now keyed on the pull request
number and cancels only on pull_request; every other event gets a group
unique to the run, so nothing on main is cancelled or replaced while pending.

user-install.yml had a group keyed on the ref that cancelled its own weekly
run when a manual one started on main; it follows the same rule. publish-wiki
no longer cancels a publish in progress. Triggers, workflow and job names
(`e2e`, `e2e (linux, xvfb)`, `gate`) are unchanged.

tests/test_ci_runs_once_per_commit.py pins the triggers the release reads, the
cancel rule and the hunt cap (max-parallel <= 8), with known-bad inputs for
each checker. It reads the workflows with a small parser because PyYAML is
not a dependency of this package.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 11:55:02 +01:00
Federico EliaandClaude Fable 5.2 15d7608867 tests: no_wait_after is judged on the order of events, not on seconds (#478)
The test said the click must come back in under 2.5 s while /slow slept 3 s.
That measured the runner: on a loaded one the click alone took longer (2 of 30
runs of the suite, every run on one CPU) with nothing wrong in the product.

/slow is now an answer the server holds until the test lets it go. The click
with no_wait_after=True must come back while the answer is still held (the
order is: click returned, then answered; the url is still the old one). A new
test holds the other half: a plain click on the same link does not come back
until the answer is given, and returns on the new page.

Known-bad input, run before trusting it: the same test with no_wait_after
removed from the click is red on the order (answered, then click returned).

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 11:32:43 +01:00
Federico EliaandClaude Fable 5.2 2d9cf3a82f CHANGELOG 0.50.1: the known differences from stock Playwright, and two fixes the entry had left out (#480)
Under [0.50.1], after the record of its publication:
- Fixed: a popup reaches the client as with Playwright's own Firefox (no limit
  of time, the destination's url, load reachable), and the opener's download
  event comes after the popup's page event.
- Known differences from stock Playwright, each with its measurement: the url
  of a popup that turns into a download, the url of a frame of another site at
  DOMContentLoaded, the longer click of the library client, and back/forward
  restoring the page from the back-forward cache.

Documentation only: no published byte changes.

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 11:32:17 +01:00
github-actions[bot]andfeder-cr fb888c09cf record 0.50.1 as published (#476)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-12 10:53:57 +01:00
b46e5a32d3 Release 0.50.1: networkidle on a reused page and on a routed served browser, a page handed over when ready (pin invisible-core 62.65.0) (#455)
* docs: the agent links and the command name the repo as it is now

Two things were broken for a reader on main, not one.

Thirteen links pointed at github.com/feder-cr/AIHawk. GitHub redirects a
NAME to the OBJECT that carried it, not to the content: after the September
swaps that name belongs to invisible_dots, which has seven wiki pages, so
AIHawk/wiki/<page> lands on its wiki Home. It answers 200 with different
content, which means a reader who clicks does not find the page and a search
engine sees a soft-404 across about 150 indexed URLs.

Seven occurrences said `uvx aihawk`, a command that does not exist. One sat
in a front-matter description, which is the snippet search engines show, and
one in a block meant to be copied: `claude mcp add stealth -- uvx aihawk`.
The command is invisible-playwright-mcp, on PyPI at 0.70.16.

All eight link targets were checked one by one and resolve to themselves with
the page title, no redirect.

Three things stay as they are, which only reading them showed. The
`pip install invisible-playwright` line matches what this engine's own README
teaches for the library, so the page is consistent rather than broken.
CHANGELOG.md keeps the old name because a changelog entry says what was true
then. And the fixture in scripts/sync_article_pixels.py keeps it because it is
the deliberate wrong case, a pixel for ANOTHER repo.

One sentence went away instead of being renamed: "shipped inside AIHawk" made
sense when AIHawk was the larger product containing the server. The server and
the repository are now the same thing, so "shipped inside itself" was circular.

(cherry picked from commit d9c8e46dce)

* test: the docs name the MCP server's repository and command as they are now

feder-cr/AIHawk now leads to an unrelated repository and answers 200, which no
link checker reports; `uvx aihawk` does not exist. The README and docs/ are
read for both.

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

* tests: the Fission bench counts the processes that host a site, not every new content process

test_same_site_other_port_stays_in_process was red on the e2e of the 0.50.0 commit ("a same-site frame
started a process: [13443]"): the bench counted every `-contentproc ... tab` pid, and the engine starts a
preallocated content process to refill its pool whenever it gets to it. On Linux the engine names a content
process by its remote type (ContentChild::SetProcessName, prctl PR_SET_NAME): "Isolated Web Co" once it
hosts a site of strategy 1, "Web Content" while preallocated. Measured on firefox-62: a cross-site frame
renames a preallocated process and a new "Web Content" refills the pool; a same-site frame changes neither.
The two tests that count processes skip off Linux, where no process carries a name.

Unit test with the measured processes: 3 red on the old bench, 3 green here. e2e on firefox-62 (candidate
#6, Linux): the bench file 17 passed; the two counting tests 15 of 15 runs green.

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

* tests: a closed context is checked for the processes of its sites, not for every content process

test_closed_contexts_with_a_never_stopping_service_worker_leave_no_process was red on the e2e of the 0.50.0
tag ([2, 2, 2, 5, 5], 5 <= 2). Measured on firefox-62 (Linux), the test's own scenario 10 times with every
process named: no "Isolated Web Co" left after any close; the 3 more are "Web Content", the engine's pool of
preallocated processes filling up behind the closed contexts (5 runs of 10, new pids each time). Not a leak:
the count read the refill.

The helper of the bench moves to tests/_processes.py and both tests use it. The context test counts the
processes that host a site: at least one while the page is open (or the count proves nothing), none a few
seconds after `close` answers (the engine waits for them inside close and kills the ones that stay). Off
Linux it skips, as the bench's two counting tests do: no other system names the process.

Unit tests (tests/unit/test_processes_counts_sites.py) from the measured processes, the closed-context case
included. e2e on firefox-62 (candidate #6, Linux): the context test 10 of 10; run_e2e.py on the two files and
the unit test 18 passed. The old counter, same scenario: 5 of 10 runs would fail.

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

* Release 0.50.1: 0.50.0 with the process-counting e2e corrected (0.50.0 never reached the index)

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

* tests: the same-site control puts its frame in the shown page; CHANGELOG: 0.50.0's entry is 0.50.1's

The e2e of #451 saw a new "Isolated Web Co" once after a.test/plain -> a.test/same-site ([10878] -> [10878,
11208]). Not a process of an earlier test: it was created after the first read and only this worker's
descendants are counted. It is the top-level navigation: when the old document may enter the back-forward
cache, the browsing context is replaced (mReplaceBrowsingContext, dom/ipc/ProcessIsolation.cpp) and the new
one may be placed in another process of the same site (dom.ipc.processCount.webIsolated = 4). Measured on
firefox-62 (candidate #6, Linux): 0 of 30 runs alone (bfcache on and off), 0 of 57 under 4 workers. The test
was written for the frame, so the frame is now added to the page already shown and the top never navigates:
20 of 20 runs green.

0.50.0 never reached the index, so the changelog gate refused its heading; its entry now opens 0.50.1.

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

* tests: networkidle through a served browser whose context routes every request, on a reused page

launch_server() plus a stock Playwright client, a context route that aborts image/font/media and continues the rest, a
page with sendBeacon, the same font twice, a frame of another site, a worker, redirects, requests the page cancels while a
slow route decides, 100 requests at once, and a slow client that answers concurrently (async). Every shape reaches
networkidle on firefox-62; one page reused for twelve addresses too. The leak that tf-fetch meets on real sites needs
end events the engine loses, which no local page produces: its deterministic red/green is in the core
(tests/test_networkidle_on_a_reused_page.py of invisible-core); this file guards the remote path end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 47182f0cd85fea08fc45e36f1c91d2d570722f14)
(cherry picked from commit e46f2dcf3eb361e6af0fedcdf6e1189f0ac330b6)

* server: the answer to a request the browser has already closed is not an error (Cannot find request), as stock sendMayFail

A page cancels requests while a route is deciding (a fetch aborted, an image replaced, an iframe removed, a beacon with
its document, the favicon of the page a goto just left). The engine takes the request out of its held set at once and the
late continue/abort/fulfill meets "Cannot find request" or NS_BINDING_ABORTED. Stock Playwright sends the interception
commands as may-fail and tells the client nothing; ours passed the error up, the client kept it as the error of the whole
connection and raised it on the NEXT route command, which was then never sent: its request stayed held in the engine, its
handler failed too, and so on down the page. Seen on a real news page: six held requests in a row, one a beacon, and
networkidle never came.

RouteDispatcher._send now treats "Cannot find request" and a closed target as done (still disposed); any other protocol
error still reaches the client.

Tests: the e2e with a plain handler (no try) on a page that removes an iframe whose requests are held (red before:
networkidle never; green after), and a static guard that every op of RouteDispatcher goes through _send and that _send
swallows exactly those two. The same defect was found a month earlier by richardpowellus (#351), with the favicon of the
previous page: his test is added in the next commit.

Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stock Playwright client is required by the networkidle e2e (explicit failure, never a skip); the dev extra pins it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 91223226f5bba25edff9af0e8b1fd6b5bfea2227)
(cherry picked from commit 612b18c02b95e9b5833d62b6595d4a0ff324aac2)

* tests: answering a route the next navigation already aborted does not raise (the case of #351: the favicon of the page just left)

Sixty sequential routed gotos on a loopback page: 4-12 of them failed on the old server, every failing continue_ being
the previous document's favicon, aborted by the next navigation while the route sat with the handler. Red on main (in-process
path), green with the fix of RouteDispatcher._send.

Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.50.1: pin invisible-core 62.64.0; CHANGELOG for the networkidle fixes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit e63ef8e61ea42e7f8df7c1bde206f3bf86fc18f7)

* A route answer the engine refuses is the engine's business, whatever its wording

The server took one wording ("Cannot find request") of an answer to a closed request as done and passed every other
protocol error up to the client. The engine also says "NS_BINDING_ABORTED
[nsIInterceptedChannel.resetInterceptionWithURI]" when the channel was cancelled while the answer was on its way: the
same event, and the client kept it as the error of the connection and raised it on its next route command.

Stock Playwright sends the three interception commands as may-fail and tells the client nothing, whatever the engine
says. So does RouteDispatcher._send now: every ProtocolError is swallowed, the route is disposed after it.

Tests: the static guard no longer allows a re-raise inside the handlers; a unit test feeds three wordings (red on the
old code for two of them).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the descriptors of the spawn are asserted by running it, not by reading the core's source

test_the_spawn_keeps_the_two_hardwired_descriptors asserted that the source of the core's _spawn_posix contains
`pass_fds=(its_read, its_write, 3, 4)`. Core 62.64.0 starts the engine with posix_spawn and file actions, so the words are gone
and the test failed on every Linux unit suite although the behaviour is the same (and better).

The test now runs the spawn: a parent with nothing open on 3 and 4 and its pipes far from them launches a program that reads
fd 3 and answers on fd 4 (the contract of nsRemoteDebuggingPipe.cpp), and the answer must come back and the child must hold no
descriptor above 4 of the parent's. Same shape as the core's own test
(test_the_pipe_of_the_engine_reaches_its_fixed_descriptors). No skip: the file is already POSIX-only.

The other tests of the file do not read source text (checked: no getsource/inspect/read_text left).
Ran the parent program on Linux with core 62.64.0 (image tetra-invisible:run1b-final): pong:ping:0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The page dispatcher waits for Page.ready before the page is handed over (needs invisible-core with Lifecycle.wait_for_page_ready)

Same defect and fix as in the core's page (see the core commit): a goto sent right after new_page could meet the page's initial about:blank.
The pin of invisible-core moves with the core release that carries wait_for_page_ready.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Pin invisible-core==62.65.0 (a page handed over when the engine says it is ready); changelog

The core that carries Lifecycle.wait_for_page_ready is invisible-core 62.65.0 (draft PR invisible_core#238), not on the index yet:
the pin check of this push is skipped on purpose (INVISIBLE_PIN_CHECK=skip).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stand-in engine of the registry test says Page.ready, as the real one does (the page is handed over on it)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: new_page and a popup are handed over only when the engine says Page.ready (red without the wait in PageDispatcher, green with it)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A page is built at once and announced when the engine says Page.ready (the wait inside the constructor held a popup's first request behind a page that did not exist yet, and lost its commit and load)

- PageDispatcher no longer waits in __init__; wait_until_ready() is called by the adoption between the construction and the announcement
  (context 'page' event, newPage answer). A detach while waiting ends the wait; a page that is not ready in time is disposed.
- The main frame's initializer carries what the lifecycle already knows (url, name, load states), as every other frame's does.
- Tests: unit (a popup exists and listens while it waits; what it does before its ready reaches its frame; red on 6a60dce) and e2e
  (a popup of a link, noopener or window.open reaches an in-process and a stock client of a served browser within 2 s, with and
  without a context route; 15 of 16 red on 6a60dce, 16 green).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the stand-in pages say wait_until_ready; the popup e2e reaches the stock client as the other served tests do

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the popup reaches the client from another site too (a link, noopener, window.open: 16 more cases, in-process and through a served browser)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A popup is reported on Page.ready as Playwright's is: no limit and no warning, with the address of the commit that came with the ready

- Stock Playwright 1.62 (measured): a 204 or a silent destination gives no page event, one that answers after 4 s gives it at 4 s with the
  destination already. The adoption of a popup waited 20 s and dropped it with a warning; now only a page a caller asked for
  (newPage) has the 20 s; a popup waits until the engine says Page.ready, the target goes away, or its context closes
  (BrowserDispatcher.end_waits_of), and says nothing.
- The ready and the commit of the document that made the page ready come in the same turn: the page is announced after a round trip to the
  engine (settle_events), so the frame reads the destination at the page event (3 of 4 slow popups said about:blank).
- In-process the slow popup arrived 0.9 s later than stock: it is the humanised click (1.1 s of pointer movement before the click returns),
  the popup arrives 4.02 s after the click in both modes.
- Tests: unit (limit None for a popup and 20 s for a requested page; a popup with no ready ends with its context and says nothing; the
  address at the page event is the commit's) red on b09d620; e2e (204 and silent: no event; 1.5 s: url is the destination; 25 s: reported
  then) in-process and through a served browser: the 25 s ones red on b09d620.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A download started by a popup that is not announced yet is reported on its opener, as Playwright reports it

- Browser.downloadCreated names the tab the download came from. A tab opened for an attachment (a target=_blank link, a window.open) never gets
  a Page.ready and the engine closes it at once, so it is not among the announced pages and the download was lost: no download event
  anywhere (a21e1de had it, on the popup). Playwright's ffBrowser._onDownloadCreated reports it on the opener of a page that is not
  reported yet; so does this, from the opener recorded when the target was attached (BrowserDispatcher._openers). The abort of the
  navigation that became the download still goes to the page that owns the frame.
- Tests: unit (red on fbceeaf); the e2e of the destinations and of the popup matrix of the fake-web branch (73f1e8d): 16 + 34 cases against
  the reference measured on stock Playwright 1.62 - on fbceeaf 4 of the 16 were red (the download), now 50 of 50 green.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A popup tells its listeners the load it reached before it was announced; an unannounced frame has no address of its own

- The popup is announced when the engine says Page.ready, which is when its document commits, so its domcontentloaded and load may be said
  before the client has the page: page.on('load') registered in the handler of the page event never fired (Playwright's does, measured by
  the independent run: destinations of 4 s and 25 s). FrameDispatcher.emit records those two states while the page is not announced and
  PageDispatcher.announce says them again right after the page event, in their order and under one lock; the first time they already set
  the state wait_for_load_state reads, so it returns at once. Only popups: a requested page is announced as before.
- The main frame is created with the address the lifecycle knows, '' if it has committed nothing (an attachment's empty tab), not
  about:blank: Playwright says '' there.
- Tests: unit (the two states after the page event, in order; red on 2f153c7); e2e: a listener registered in the handler of the page event
  hears the load of a slow popup, wait_for_load_state in the handler returns in under 2 s (in-process and a stock client over a served
  browser, window.open and link).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A popup whose target goes away while its page is being built is announced and closed, not waited for for ever

A download's empty tab is closed by the engine within milliseconds; on a loaded machine its page is still being built when the detach arrives.
_handle_detach recorded it as early (nobody in _building to tell) and the adoption then waited for a Page.ready that never comes: the
popup was never announced (test_popup_destinations_e2e, the download on the opener, failed once in a full suite run). The adoption now
looks at the early detaches when it registers the page as waiting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A command of the adoption that finds the target's session gone announces and closes the popup, as a detach before the ready does

The independent run on a quiet machine lost one link-into-attachment popup in a hundred: the engine closed the tab WHILE the adoption was
initializing it, answered 'cannot find session' to Page.setInitScripts, and the popup was discarded with a warning - no page event - where
Playwright's is announced and closed. PageDispatcher._build now treats an initialization command that fails because the target or its session
is gone (one test: _target_is_gone) as the same case: the page is built, flagged gone_while_building, and the adoption announces it and closes
it right after. Test: a fake engine answers 'cannot find session' to each command of the adoption in turn (parametrised): the page event and
the close arrive, no warning; red on b05741f for Page.setInitScripts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the helper of the popup destinations does not shadow the browser fixture (ruff F811)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the popup tests do not fail on the machine's speed (no 2 s limit)

A runner with four workers delivered a popup in 2.013 s (the limit of the test was 2 s). The verdict of these tests is that the popup arrives with
its address and its load; the wait is generous (30 s) and the check of the time is gone. The wait_for_load_state of the handler is bounded by 8 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The adoption of a target is one explicit state machine, proved over every order of the engine's events

Four patches of the same race (a detach before the ready, during the build, between the build and the wait, a command answered 'cannot find
session') and a fifth the exhaustive test found (a detach while the adoption waits for the main frame of a tab the engine never announced:
the wait went on for 20 s and the popup was discarded; this is the order the runner produced for the download popups: 3 of 4 lost).

- _Adoption: the single record of a target between its attach and its announcement: state (attached, building, waiting, announced), gone
  (set by the engine's detach AT ANY MOMENT), page, opener, context. It replaces _adopting, _building, _openers and _detached_early.
- Every wait of the adoption looks at gone (the main-frame wait polls it), every state change is one method (_enter_building, _enter_waiting,
  _enter_announced), a command that finds the session gone ends in the same place as a detach, a closing context takes away every adoption
  of it in any state (end_waits_of).
- Invariant: an attached target that is not a page a caller asked for gives the client exactly one page event, at its ready or at its
  disappearance (and its close right after), unless its context closed first.
- Test: test_every_order_of_the_events_of_a_popup_gives_one_page_event stops the adoption thread at six points of its own and delivers the
  engine's events (frame, commit, ready, detach, in every prefix) at every one of the eight moments: 635 orders, none sampled. Mutation
  check: without the gone-aware main-frame wait 24 orders break, without the tolerance of the command error 42, without the close after the
  page 374; without the early-gone check of _enter_waiting the adoption hangs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The adoption keeps a short trace per target and writes it where a popup is dropped or fails

The log of a CI run says that a popup was not announced and not in which order the engine's events came. Each target in flight keeps (in memory,
at most 60 short strings, nothing afterwards) what the engine said (frame, commit, ready, detach) and what the adoption did (building, waiting,
announced), with the milliseconds since the attach. It is written in the warning of a failed adoption, in the error the newPage waiter gets, in
the timeout of a requested page, and in browser._dropped (the last 16 targets dropped with their context).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The WebGL determinism test says why the browser could not make a context

One run in 31 of the e2e on a loaded Linux runner failed this test with "reason='gl null'" and nothing else: getContext('webgl') gave the page null. The browser
says why in the `webglcontextcreationerror` event (statusMessage: the failure list, e.g. "tryNativeGL (FEATURE_FAILURE_EGL_LOAD_3)", "Initializing WebGL backbuffer
failed.", "GL error 0x505 occurred during OpenGL context initialization"), and each of the paths that can produce null on Linux in our engine writes a different one
(library not loaded, display not initialised, context not created, GL out of memory, backbuffer not allocated). The test reads the event and puts it in the
assertion, and tries webgl2 on a fresh canvas (the old canvas already had the failed type).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the same-site control of the Fission bench measures the frame, not the process pool

The control counted the processes that host a site between two reads, with the default pool of three preallocated content processes: a pool
process handed to a site after the first read moved the count without the frame having asked for anything ([63248] -> [63248, 63386] on a
four-worker runner; the same family as 5402da4, ff2123e and fef0bc5). The control now runs in a browser with dom.ipc.processPrelaunch.fission.number
at 0, where a process of a site appears only because a site needed one, and says so if the page of the site has no process to compare with.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The download of a tab that is not announced yet is said after the page event of the tab

The tab opened for an attachment is announced when the engine takes it away, a few milliseconds after it says the download; the download
(reported on the opener) went to the client first, the popup after: the order the other way round from Playwright's, and a client that read
the popup the moment the download arrived found none on a one-CPU machine (the 4 download cases of GitHub, 3 of 4 red; the same on a one-CPU
container: 1, 0, 2 of 50 on a90dadc). The adoption holds the download on its record and says it right after the page event (never lost: also
when the tab is dropped or fails).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A download is taken with the record's removal in one step, and the opener of a target not announced is remembered: no step of the adoption can lose it

The failure branch said the pending downloads BEFORE it removed the record: a download created between the two found the record, queued on it, and
nobody said it. Taking the pending downloads and removing the record are now one step under the browser's lock, in the three branches
(announced, dropped with its context, failed); the opener of a target that ended without being announced is kept for the last 16 targets, so a
download that comes after the record is gone is still said, on the opener. Test: the download is forced into the gap of the failing adoption
(red on 65f7580: said 0 times, now once).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
2026-11-12 09:51:23 +01:00
Federico EliaandClaude Opus 5.5 b6d32402f2 README: browser launches up top, in a big badge row (#453)
The launch count was a small badge at the very bottom. It now opens the
README, under the banner, next to engine downloads and stars. The daily
counters job also writes launches.json and downloads.json on the badges
branch; shields.io draws the big badges from them, so the numbers still
come only from our snapshot.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:15:12 +01:00
Federico EliaandClaude Opus 5.5 82d88c848f Release 0.50.0: engine firefox-62 (Fission strategy 1), pin invisible-core 62.63.0 (#450)
* grant_permissions: the permission names are the engine's, a name outside the table is refused, and no origin is every origin

The wrapper passed the web names (geolocation, notifications) to the engine, which keeps a grant under its own
(geo, desktop-notification) and stored one under a name it never reads: a page of a context that had been granted
geolocation and given a position was still denied. The table is the Playwright client's for this browser
(playwright-core ffBrowser.js, doGrantPermissions); a name outside it is an error, as there. A grant with no
origin was sent as the empty string, which the engine's lookup reads as false and answers with '*', where nothing
was held: it is now '*'. Tests: the table and the refusals as units, and the position of a granted page as an e2e
that fails on the old code (denied, or no answer).

* tests: the sentinels of the isolation strategy hold strategy 1, not 0

The baseline of a core that runs Fission (strategy 1, autostart, four isolated content processes) is what the
firefox-62 engine is built for: the Juggler reaches an iframe of another process like any other. The four unit
tests of test_cross_origin_iframe.py held the opposite (strategy 0, autostart off, one isolated process) and are
turned round: strategy 1, autostart on, fission.autostart.session absent (the parent writes it), four isolated
processes, the default of a translated profile 1, and an override to 0 only when a caller sets it. They fail on
invisible-core 61.62.0 and pass on a core with the strategy-1 baseline (invisible_core ffced25); the pin moves with
that core. The module text says why a harness of two ports of one host is one site and where the iframes that leave
the process are held.

* changelog: Fission (strategy 1) and the permission names, to be confirmed by the firefox-62 build

* e2e: the bench for Fission strategy 1 (a.test / b.test, a -> b -> a): two tests that hold it, eight that say what is not done yet

The prefs are an overlay of the file (strategy 1, autostart, four isolated processes, the test hosts through
network.dns.localDomains); the wrapper's baseline stays at strategy 0. Tests 1 and 2 pass today (a cross-site
frame adds a content process, a same-site one does not); tests 3 to 10 fail today on the empty url of a frame of
another process, the missing context, the missing parent chain, describeNode on a cross-origin element, the init
script that does not reach the other process, and the console that does not arrive.

(cherry picked from commit a8edf34d5f2da5e5e142359efe0dfaa801f5d57d)

* e2e: the bench of Fission strategy 1 reads the client's events while it waits, and holds three cases of step 1

The sync client takes the engine's events only inside its own calls: the waits of the bench now go through
page.wait_for_timeout. Added: a context of the top survives a frame of another process coming and going (a guard),
the frame of another process comes back after the top is restored from the back-forward cache, and a removed frame
of another process leaves page.frames and the page keeps answering.

(cherry picked from commit b9483514bb0be7712f378e1fbdc9ffd5701634b3)

* e2e: the bench splits the restore from the back-forward cache in the frames that come back and the url and contexts that come with them

The first is green with the parent re-announcing the frames it knows; the second stays red until the parent's
registry of navigations (step 3) and the mux's re-announcement of contexts (step 2b). set_extra_http_headers is not
in the wrapper's perimeter, so the removed-frame test uses the init script alone.

(cherry picked from commit 47a9d6f59ab237e173fe3c271fa37cbafe6e0668)

* e2e: element-to-frame and iframe geometry across processes (Fission strategy 1)

(cherry picked from commit 3ec3752333e76baaebdbbd78263028237fdda86a)

* tests: the crash of an iframe's process leaves the tab (firefox-62, Fission)

Kills the process that holds the iframe (found through the engine over Marionette, required to differ from the top's) and asserts the tab stays, no Page.crashed or close, and the page answers. Red on firefox-61: the unpatched engine closes the tab.

(cherry picked from commit 1e90ff23b3c3827cac943f926f30eeccaa6ec3aa)

* tests: the mouse events of the page and of a same-process iframe keep their order and values

Sequences recorded on firefox-61 (click, double click, right click with contextmenu, moves with the button down), through page.mouse; the test passes there and has to pass on the engine whose mouse takes the APZ route (a click on an iframe of another site needs the hit test).

(cherry picked from commit 4374fcab3c3e6718239cd36bad9c2970e1626aec)

* Test that the identity is the same in the top document and in every iframe

One local server on 127.0.0.1, 127.0.0.2 and 127.0.0.3 serves a top page with an
iframe on a second site (holding a nested frame on the top's own site) and an
iframe on a third site. Each document reads a fixed canvas drawing, a fixed
OfflineAudioContext buffer, the WebGL debug renderer info, the Intl time zone,
the navigator language and user agent, the screen geometry, the pixel ratio and
a font of the bundle, and posts them to the top; the test asserts they are equal
everywhere. screenX and screenY are read and not compared.

It runs under strategy 0 (what the core writes today) and under strategy 1
(fission.autostart and webContentIsolationStrategy=1 as extra_prefs). Each run
proves where the iframes ran from inside the page: one iframe spins for 400 ms
and the top times a 10 ms timer, which stalls only in a shared process.

The negative case is the machine the seed describes (WebGL renderer and screen),
because the 2D canvas and the audio buffer carry no per-seed value. The pure
comparison has unit tests with known-bad inputs.

(cherry picked from commit 76cae1a19abd65b30b72ea317dc42110541c8745)

* e2e: an iframe nested too deep names no frame, and a frame of another process comes out of the cache with the top

(cherry picked from commit 7f71460d799d8271346f470b0b2ad06c0a5315fb)

* e2e: the Fission tests that firefox-61 cannot pass wait for firefox-62

Measured on the released firefox-61 (Linux, run_e2e.py, 4 browsers): these twelve fail there and nothing else in
the six Fission files does. Ten of the bench (the steps that are not in firefox-61) and two of the
element-to-frame file (an <embed> of another process and the detach of a removed iframe). They now take
engine_at_least("firefox-62"), so the gate on firefox-61 is green (43 passed, 13 skipped) and the candidate runs them.

* e2e: a navigation that changes the process is stopped, replaced, refused or cut the way one that does not is

* e2e: an iframe whose src goes to another site shows the new address in the frame list

* A frame that left the page answers a call with "Frame was detached", not "Target page, context or browser has been closed"

The server disposed the dispatcher of a frame as soon as the lifecycle retired it, so the next call on the Frame object (an
iframe a script or a framework removed) named a guid that no longer existed and was answered as if the page had closed.
Measured with a process per site and without it: frame_element, evaluate, content and query_selector on a removed iframe,
all four. Playwright's driver never disposes a Frame at detach; the call reaches its dispatcher, which refuses it with
"Frame was detached". The frame stays registered (collected with its page or by its bucket, as the driver's), refuses every
call, and its element handles go with it.

Test: test_a_detached_frame_answers_detached.py (7 of its 10 fail on the old server code); test_frame_dispatch.py still
passes; test_a_removed_iframe_is_detached (the Fission e2e) passes on an engine with the Juggler of the integration.

* e2e: a worker leaves with its page for the back-forward cache and comes back the same (Fission strategy 1)

A document starts a worker that counts; the top goes forward (same site or another, by page.goto or by the page's
own location.href) and comes back from the cache (pageshow.persisted is checked). The protocol events the client
receives must say: workerCreated, workerDestroyed before the new page commits, workerCreated again with the same
workerId once after the restore's contexts are cleared, no workerDestroyed after it, one live worker that answers 3.
The worker lives in the top or in a frame of another site. engine_at_least("firefox-62"): it skips on firefox-61.

Measured on repacks of fission/integration (Linux, strategy 1): red on bdf02eb9d8 and on 1e9ff6dec0. In the top the
worker comes back under a new workerId; in the out-of-process frame it is not announced again.

* changelog: the Fission and permission-name entries are under 0.50.0

* e2e: the frames have their urls when goto returns (an iframe of another site, 50 runs, nothing waited for)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* e2e: a goto to the address the page is at ends, 20 times, on nine kinds of page (sites isolated)

Plain, big, revalidated with a 304, fresh in the cache, never stored, a frame of its own site, a frame of another
site (also revalidated), a -> b -> a, and the same query twice. Red on the engine of fission/integration 14e826b7b5
(load not reached, navigation started and neither committed nor aborted), green with the Juggler fix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* A launch that names no session gets one: op_launch writes a composed session into every profile

A bare BrowserType.launch on the server (Playwright's own suite, any client of invisible_playwright._pw)
sent no prefs, and op_launch wrote into user.js only what the client sent: the engine came up with
Mozilla's defaults, no persona, every value a page reads taken from the machine. On Linux the first window
then also held the first-run policy tab of TelemetryReportingPolicy (the Terms of Use the core declares
accepted were not), and the first new_page failed with "Browser.newPage: Unexpected number of tabs in the
new window: 2": 15 of 15 bare launches on firefox-61 and on the firefox-62 candidate; with
datareporting.policy.firstRunURL emptied alone, 1 tab every time.

The launcher marks what it composes (COMPOSED_PREF, taken out before user.js like the seed); an unmarked
launch gets the session InvisiblePlaywright() composes with the server's defaults (new seed, humanize off as
in launch_server), with the caller's prefs on top. launch_server already sent a composed session: its e2e
and a unit test on the mark guard it. The one network step of composing (the egress IP) has one name,
_session.session_geo, which the unit tests answer offline.

Tests: test_a_launch_without_a_session_gets_one.py (4 unit: red on the old code, the profile held 0 prefs),
test_a_launch_without_a_session_gets_one_e2e.py (a bare launch has one tab and says Windows on the Linux
engine: red on the old code with "Unexpected number of tabs: 2"; every context of a served browser is the
same Windows machine). Unit suite 1128 passed on the firefox-62 candidate image.

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

* A launch that names no session also gets the session's environment variables

The variables `build_env` adds (the font manifest, the display backend, the crash reporter, the WebRTC
declaration with a proxy) are added to the environment of a launch that names no session, wherever the
caller named none of the same name. Unit tests: the manifest reaches a bare launch, a variable the caller
names wins, a composed launch gets nothing it did not send.

Measured before keeping it: no page-visible difference. On the firefox-62 candidate (Linux) and on
firefox-61 (Windows) a page of a bare launch lists the same families with and without the manifest: the
bundle's (Segoe UI, Calibri, the substitutes such as Helv and MS Sans Serif), none of the host's (FreeSans,
Unifont, Liberation Sans in the container; Segoe UI Variable on the Windows host). The engine uses its
packaged copy when the variable is absent.

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

* The session of a bare launch is composed through the launch's proxy; e2e: behind a proxy the page reads the egress as its srflx

`launch(proxy=...)` reaches `session_for_launch`, and the session is composed through it as
`InvisiblePlaywright(proxy=...)` composes: the egress measured there is the address the session's
environment declares for WebRTC (STEALTHFOX_WEBRTC_PUBLIC_IP). The engine is still told the proxy by
op_launch (Browser.setBrowserProxy), as before.

e2e test_a_bare_launch_behind_a_proxy_declares_the_egress_as_its_srflx: a bare launch behind the local
TCP-only SOCKS5 of test_webrtc_realness.py, the egress answered with 203.0.113.7 (RFC 5737). The page must
read a srflx of that address. Red on the prefs-only commit (no srflx of the egress: host candidates only)
and on release/firefox-62 (the two-tab refusal); green here. Unit suite green on the firefox-62 candidate.

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

* tests: the named environment of an unmarked launch carries the session's variables, and still nothing of the server's

test_the_launch_handler_hands_the_named_environment_to_the_engine asserted the engine got exactly the named
variables (plus the session's TMP). An unmarked launch now also gets the variables of the session the server
composes for it (font manifest, display backend, crash reporter): the test reads them from
_session.default_session and keeps its point, WAYLAND_DISPLAY of the server's own process stays out.
It went red on 36cffac, which I committed without running the whole unit suite.

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

* tests: the same-document navigation test attaches the frame it reports on

The engine announces a frame (Page.frameAttached) before any event of it, and from invisible-core's fix on
release/firefox-62 the lifecycle makes frames of that event alone: an event of a frame it does not know is
dropped. The three tests of this file reported events of a frame "F1" they never attached, which only the old
auto-creation accepted. Green with the old core and with the new one.

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

* tests: the gates of the shelved line ask for firefox-63 again; firefox-62 is the Fission release

#444 renumbered the engine gates when the shelved line (idwr text, canvas colours and ICC readback, maths,
media decoding, WebGL arithmetic, the Linux system-theme refusal) was firefox-62. That line is firefox-63 now
and firefox-62 is Fission (one process per site), which has none of those properties: on the firefox-62
candidate 14 of those tests ran and failed (WebGL dot, canvas text, ClearType, ICC, fonts and colours,
WebCodecs). The seventeen files #444 touched ask for firefox-63 (comments and docstrings too), conftest.py
names the same number, and tests/unit/test_engine_at_least.py checks that 61 and 62 skip a gate that asks 63.
The Fission tests (bench, worker, crash, oop_frame_element, goto to the same url, raw launch, mouse events,
cross-origin iframe) keep firefox-62. Default suite: 1131 passed, 8 skipped; the three reds are the install
metadata of the shared Python.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the hand-built InjectedScript of the adopt test has the detached frames the wait for a world reads

invisible-core 62's wait for a frame's world ends at the frame's detach and reads InjectedScript._gone, which __init__
makes. test_adopt_is_one_wire_call_for_both_crossings builds the object without __init__ and sets what __init__ gives
it by hand; it now sets _gone too. (Red on the core with the detach wait: "no attribute '_gone'".)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Release 0.50.0: pin invisible-core 62.63.0 (engine firefox-62, Fission strategy 1)

CHANGELOG 0.50.0: the engine entry, and the fixes of the bare launch and of a detached frame; the
Fission and permission-name entries were waiting for the firefox-62 build, which shows them (candidate #6).

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

* tests: the docstring of the bare-launch e2e says what the served browser is for, not who runs it

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

* tests: the gates of the shelved line ask for firefox-64; firefox-63 is the coherent UDP

The 16 e2e files of the shelved line (idwr text, colours, maths, media, WebGL, host-free Linux),
conftest's description of engine_at_least and its unit test: firefox-62 and firefox-63 skip them.

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

* tests: the refused iframe's address is read by scheme and host, not by a prefix of the string

CodeQL (incomplete URL substring sanitization) flagged the startswith on the frame's url; the
split url says the same thing and cannot match a longer host. The file passes on firefox-62 (5 of 5).

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 12:39:30 +01:00
github-actions[bot]andfeder-cr e2a006d1c9 record 0.49.1 as published (#449)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-10 20:17:23 +01:00
Federico EliaandClaude Sonnet 5.5 c33b9dd8f2 0.49.1: the firefox-61 engine through invisible-core 61.62.0 (#448)
* Add INVPW_GC_EVERY_NAV: optional Heap.collectGarbage every N main-frame navigations

Off by default. The collection is sent from a daemon thread (never from the
reader thread, which would deadlock), with at most one in flight; a round
due while one runs is skipped and counted, and every error is swallowed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* INVPW_GC_EVERY_NAV: send the collection with the page session; fix page.request_gc

Juggler answers Heap.collectGarbage from its page handler. Sent with the
browser-level connection it fails with 'Handler for does not implement method',
so the first version of the option counted every collection as failed, and
page.request_gc() has been failing the same way.

The option now sends with the session of the page that committed (a thread of its
own, one in flight); op_request_gc uses the page session too. Tests fail on the
old code and pass on the fix; measured on the engine: collections take 0.02-0.09 s
and the values a page reads are identical with the option on and off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* INVPW_GC_MODE=minimize: the option can send Heap.minimizeMemory, with a fallback to gc

INVPW_GC_MODE=gc|minimize (default gc) says what INVPW_GC_EVERY_NAV sends. minimize sends the
Juggler command that runs about:memory's "Minimize memory usage" (engine commit 2423b7c242 of
the engine's juggler/minimize branch); on an engine without it the first round logs one
warning and falls back to Heap.collectGarbage for that round and every later one (the
engine's answer, "method '...' is not supported", is the sign).

Unit tests for the mode, the fallback and the other errors; e2e (engine_at_least firefox-61)
that the engine takes the command and, as documentation, that minimize evicts the bfcache
(pageshow.persisted false on go_back) where nothing sent leaves it true. Measured on the
engine with the command, and on the one without: the first and third e2e fail there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* INVPW_GC_MODE: the command must be named in the error that makes minimize fall back to gc

A fallback on any error saying "is not supported" would turn the mode down for good on an
unrelated error; the sign of an engine without the command is its answer naming it
("method 'Heap.minimizeMemory' is not supported", or 'does not implement method "..."').
Also the docs say what the command is: the memory manager's MinimizeMemoryUsage.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the minimize e2e uses a plain protocol client, and the protocol-name scan lets the engine-gated name through

The e2e imported the installed Playwright (test_fork forbids it) and the vendored client has no
connect: it now speaks the protocol over the served WebSocket, like the other served-browser e2e.
Re-run on an engine with the command (all three pass) and on one without (the first and the third
fail, with the fallback warning).

Heap.minimizeMemory is written by navgc.py for an engine the published core's protocol mirror does
not describe yet, behind a fallback to the older command. test_protocol_names_are_declared keeps it
in AHEAD_OF_THE_MIRROR, still checks every other name, and a last test fails when the mirror gets
the command, saying to delete it from the list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The periodic collection option is out: only the page.request_gc() fix stays

The engine has no behaviour that stock Playwright's Juggler lacks, and a server option that
sends a memory command on a schedule is one. INVPW_GC_EVERY_NAV and INVPW_GC_MODE, navgc.py,
the hook in the commit path, their unit tests, the e2e of the engine command and the entry in
the protocol-name scan leave the branch.

What stays is a defect of the standard API: page.request_gc() sent Heap.collectGarbage on the
browser connection, whose handler does not have it, so it failed on every call; it is now sent
with the session of the page. The test fails on main's server.py and passes here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* 0.49.1: page.request_gc() works on a served browser

A change to the package's code takes a new version and a changelog entry: 0.49.0 is published.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the web fonts of closed contexts leave WebRender's shared archive (firefox-61)

A probe opens N contexts, each with a page that loads a web font of its own
bytes, closes them, and reads explicit/gfx/webrender/resource-cache/fonts from
a memory report (Marionette, chrome scope) before, with contexts open, and
after. On firefox-60 the archive keeps ~1 MB per closed context (10/20/40
contexts: 10.4/19.8/40.7 MB, measured); the test asserts it is back at what it
was from firefox-61 and is skipped on an older engine.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Disable the context cache while a route is active, as upstream

Playwright's ffBrowser.doUpdateRequestInterception sends
Browser.setCacheDisabled with the same flag as Browser.setRequestInterception.
The server sent only the second, so a routed context filled the engine's cache2
on disk. op_set_interception now sends both, for the same context.

* tests: a context that ends leaves no content process (e2e, from firefox-61)

A page that registers a service worker whose script is `for (;;) {}` kept its content process alive
after its context was closed. The test closes three such contexts and counts the web content
processes after each; on an engine without the fix the count grows by one per context ([4, 5, 6]),
with it it does not. Skipped on an engine older than firefox-61.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* 0.49.1: the firefox-61 engine through invisible-core 61.62.0 (prepared, not pushed)

Pin to the core that carries the firefox-61 seal (the core is not published yet) and the changelog of the
engine's four fixes, on top of the four open branches this release carries: page.request_gc() (#442), the
context route and the cache (#447), the web fonts of closed contexts (#445) and the processes of an ended
context (#446).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* tests: the process count of an ended context is compared from the second context on, over five

On the Linux gate the count after the three contexts was [2, 3, 3]: the first context adds one process
that is not the leak (a spare content process the engine starts when the first page takes one) and
then the line is flat, and counts[2] <= counts[0] failed on the engine WITH the fix. Five contexts, and
the last must not be above the second: with the fix [.., 3, 3, 3], on the old engine every context adds
one ([4, 5, 6, 7, 8] measured on Windows). Run on both engines locally.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 19:46:25 +01:00
Federico EliaandClaude Sonnet 5.5 ebaed54e0e tests: the engine gates that ask for firefox-61 ask for firefox-62 (#444)
The corrections release is firefox-61 now, and the shelved line (idwr text, canvas colours and ICC
readback, maths, media decoding, WebGL arithmetic, the Linux system-theme refusal) is firefox-62.
The seventeen files whose engine_at_least gate asked for firefox-61 ask for firefox-62, comments and
docstrings too; conftest.py names the same number in its comment and docstring.

tests/unit/test_engine_at_least.py: the engines firefox-61 and firefox-61-candidate are skipped by a
gate that asks for 62. With the old minimum (61) three of its cases fail; with 62 the file passes.

Default suite in a clean checkout: 1084 passed, 9 skipped.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 16:55:10 +01:00
github-actions[bot]andfeder-cr 8de4cd2c9f record 0.49.0 as published (#443)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-10 15:03:28 +01:00
Federico EliaandClaude Opus 5.5 087117dfc6 0.49.0: the firefox-60 engine through invisible-core 60.61.0 (#441)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 14:27:39 +01:00
Federico EliaandClaude Sonnet 5.5 b85c8f49a1 tests: the body of a document the tab left is evicted (e2e, from firefox-60) (#440)
The engine of firefox-60 evicts, when the main frame commits a navigation, the bodies of the documents the tab
left, as Chromium does; a body over the cap already answered 'evicted'. The test serves two pages from a local
server, reads the bodies of the current document, then of the one that was left, and checks that the second
context and the page still work after the bodies are gone.

Gated with engine_at_least('firefox-60'): skipped on firefox-59 (checked with the real gate), and run by hand
against a copy of the firefox-59 engine with the fix it passes, against the unmodified one the first test fails
with 'DID NOT RAISE'.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 12:07:59 +01:00
Federico EliaandClaude Sonnet 5.5 e82ae18bac tests: the engine gates that ask for "firefox-60" ask for "firefox-61", the name of the shelved line (#439)
Seventeen e2e files skip unless the engine is at least "firefox-60": the idwr text, the canvas
colours and ICC readback, the maths, the media decoding, the WebGL arithmetic, the Linux system
theme refusal. Those are the goals of the line that is now called firefox-61. The name firefox-60
is the next release of the engine (firefox-59 plus the Juggler memory fixes), which has none of
them: with the gates at 60 they would have run on it and failed. They ask for 61 now, and a unit
test says that engines 60 and 60-candidate are skipped by a gate that asks for 61 (it fails with
the old minimum, which let 60 run).

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 12:01:53 +01:00
github-actions[bot]andfeder-cr b1887220a3 record 0.48.1 as published (#438)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-10 11:03:31 +01:00
Federico EliaandClaude Sonnet 5.5 f3d083aa85 0.48.1: the browser never opens its crash reporter, launch_server is public (#437)
* e2e: the run stops at the first refusal of the engine instead of launching for 26 minutes

Against a firefox-59 engine whose gate wanted a declaration the core no longer made (59.58.0), the
suite went on for 26 minutes, launching the browser for each test, being refused each time with the
same sentence, and opening a crash window per refusal on the desktop. tests/engine_refusal.py reads
the text of a failed e2e report and, when it holds the engine's own refusal ("stealth: X is not
declared. Engine rule 7" or the scale refusal), stops the run with that sentence as the reason:
session.shouldstop on the serial path, the controller's shouldstop under xdist (a worker is never
stopped alone). A test that expects a refusal passes, so it never reaches the plugin; a unit test
that only quotes the sentence does not count.

The unit tests read the sentence; the integration tests run pytest over twenty e2e-marked tests of
which the second fails with the refusal, serial and with -n 2: the old suite ran all twenty (the two
fail without the plugin, and a failure that is not a refusal still runs all twenty).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* launch_server, launch_server_async and RemoteServer are on the package; the README shows a server and a client

The server API was reachable only through invisible_playwright._juggler.remote, a private path.
`from invisible_playwright import launch_server` now works, with launch_server_async and
RemoteServer, and they are in __all__. The README section "Serving one browser to many clients"
gets a complete example: a server with launch_server() and a Playwright for Python client that
connects to its ws_endpoint, how to install the extra, where it listens and how the browser ends,
and one line for a client in another language. The example was run against the real engine (the
server printed its address, the client read "Example Domain" and closed, the server's browser stayed
up until Enter).

The test checks the exports and reads the README block against the package; four of its five tests
fail on the old code.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* 0.48.1: invisible-core 59.60.0 (the browser never opens its crash reporter), launch_server on the package

Pins invisible-core 59.60.0, whose launch environment carries MOZ_CRASHREPORTER_DISABLE=1. The
version is 0.48.1 and the CHANGELOG names the crash reporter, the exported launch_server with its
README example and the e2e run that stops at the engine's first refusal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:29:20 +01:00
github-actions[bot]andfeder-cr 8f86007065 record 0.48.0 as published (#436)
Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com>
2026-11-10 09:16:28 +01:00
Federico EliaandClaude Sonnet 5.5 1ff8ed5785 0.48.0: launch_server, and the engine firefox-59 through invisible-core 59.59.0 (#435)
* wire: a protocol message is JSON, and a transport that proves it

_juggler/wire.py: dumps/loads/round_trip, and WireError naming the path of the first
value JSON would change or lose (bytes, sets, objects, non-string keys, NaN/inf).
JsonWireTransport (INVPW_WIRE=json) puts that wire between the client and the server
of the in-process transport, in both directions: a non-JSON client message raises from
send, a non-JSON reply fails its call with the path, a non-JSON event is recorded in
wire_errors. Local use is unchanged (no JSON unless asked).

tests/test_the_wire_is_json.py: 12 unit tests; the reply-that-is-not-JSON test fails
when emit_message forwards unchecked. The unit suite has the same results with and
without INVPW_WIRE=json; running the e2e suite on the wire is the next step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wire: the server reads a 1.62 message like a 1.61 one, fixed at Dispatcher.handle

Playwright 1.62 moved the call's timeout from the parameters to the metadata,
so a 1.62 client's timeout was lost and every call waited 30 s. handle() now
folds the variants into one shape (_juggler/variants.py), with no version
check: a timeout in the parameters wins, one in the metadata fills the gap,
unknown fields pass unread. scroll is ignored on purpose (documented); a
webp screenshot, screencastFrameAck, waitForFunction on a selector and
virtual credentials refuse that one command with their reason.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wire: a 1.62 screencastFrameAck is accepted and does nothing

The server already acknowledges each screencast frame to the engine, so a client that
acknowledges every frame (1.62's does) is answered, not failed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* wire: a Dialog is an object of the protocol, and the server stops reading the client's registry

The Dialog was a fused class: no __create__, no guid, no channel. The server
built it with Server.twin(page guid), looked into the client's guid registry
(bind_impl_objects/bind_twins) and called BrowserContext._on_dialog through
Connection.deliver_event.

Now DialogDispatcher (TYPE Dialog, parent the Page, initializer type/message/
defaultValue/page, methods accept/dismiss) is announced with __create__ and
then carried by the context's `dialog` event; _dialog.py is a ChannelOwner as
in Playwright, with its case in _object_factory.py, and the event reaches the
listener through Connection.dispatch like any other. Removed: _emit_fused_dialog,
send_async, Server.bind_twins/twin/deliver/run_blocking/call_soon, the
transport's bind_impl_objects/run_blocking/call_soon, Connection.deliver_event
(dispatch is upstream's again) and the bind calls in both context managers.
The reader's pause stays: accept/dismiss answer through
PageDispatcher.answer_dialog, in the worker. diff_protocol no longer lists
Dialog as an expected difference.

Tests: test_a_dialog_is_a_protocol_object.py fails on the old code; the pause
test now covers the answer over the channel.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* remote: launch_server() serves one browser to any protocol client over a WebSocket

One launch, one registry, a connection per client: objects are owned by the
client that made them, a client leaving closes its contexts and not the browser.
initialize answers with BrowserType, LocalUtils, Browser and a Playwright root
carrying preLaunchedBrowser. No version check, no limit of ours; the identity
stays the server's. A dialog, which cannot cross the wire, is dismissed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* remote: the Playwright initializer names every required type of spec 1.62

A client built on the 1.62 spec (playwright-go's newPlaywright) reads chromium, firefox, webkit,
android and electron from the Playwright initializer without checking for a missing one and
panics: 'fromChannel: expected *channel, got <nil>'. chromium and webkit are BrowserTypes whose
calls refuse with a reason; Android and Electron likewise. Announced before Playwright.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* pin invisible_core 59.57.0 (the pin PR 413 proposes), engine firefox-59

One core for the image that serves this wrapper: the unit suite and a quick e2e (the served
browser answering a plain client, add_script_tag, dialog pause) run on core 59.57.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: "no-override" is not sent to the engine as a colour scheme, motion or forced-colors value

The Go client (and Playwright's null) says "not overridden" with the string
"no-override". The server passed it to Browser.setColorScheme (and the motion
and forced-colors commands), whose enum has no such member, so the engine
refused the whole newContext. Now nothing is sent and the context keeps the
persona's declared theme; explicit dark/light/no-preference still go out.
Page.setEmulatedMedia treats it as a reset (field left out, empty medium).

Tests: unit (6 of 11 fail on the old server) and an e2e with a light and a
dark persona that reads prefers-color-scheme through a Go-style context.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* remote: the pointer's walk is drawn by the server, once, for every client

The in-process client patched Frame._click/hover/dblclick/tap/check,
Mouse.click and Mouse.wheel and sent N mouseMove before each action; a
client that is not ours sent one Frame.click and the page saw one
mousemove (measured with humanize=True on a served browser). The walk
(approach, off-centre landing, idle fidget, scroll detents) moves to
_juggler/pointer.py, built per page from the session seed, the page's
number and the humanize budget, and called by FrameDispatcher and the
Page mouse ops. The in-process client now sends the plain action.

- an explicit mouse.move stays the caller's: the server walks it only
  when the in-process client marks it (humanise); a standard client's
  move reaches the page as the exact point it named
- who draws travels in the launch prefs (invisible.server.pointer), so
  the engine's own expansion and INVPW_CURSOR_ENGINE=off are not
  humanised twice
- golden from 5d9ad70 (tests/data/pointer_golden.json, with its origin
  and generator): a Frame.click reaching the server draws the same
  engine events, same coordinates and instants, as the client did

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: Mouse.click puts one mousemove on its point, not two

Pointer.click_at sent the endpoint as a move of its own and then Actions.click_at
moved onto it again as its own approach before the press: the engine got two
mousemove with the same coordinates at the same instant, which no mouse reports
and a page can count. The defect predates the move of the walk to the server
(it was the client's Mouse._click); it is corrected at the source instead of
being preserved, for every transport (op_mouse_click is the one path).

- pointer.py: click_at sends the stroke and lets the click's own approach be the
  one move onto the point; the hand is re-synced after the click.
- golden: only the explicit_pointer session (the one with a Mouse.click)
  changes, regenerated by tests/data/pointer_golden_origin.py
  --revise-mouse-click, which refuses unless the result is the old session minus
  that one repeated move; the origin says why.
- tests: no two consecutive equal mousemove in a humanised Mouse.click (fails on
  the old code), plus an e2e with one real browser that counts them in the page.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: a stroke from standstill does not open with the point it stands on

The first waypoint of a stroke is its start. When the engine has already been
told the pointer is on that pixel (a move that stopped there, then a pause), the
stroke sent it again: a zero-displacement mousemove no mouse reports. Pointer.
_travel now skips a first waypoint that coincides with the position the engine
knows; a pointer the engine was never told about (the page's first movement,
from the seeded start point) still opens with its first waypoint.

- golden: only the explicit_pointer session changes (one mousemove fewer; t, x,
  y and type of every other event unchanged, latency draws follow the ordinal),
  regenerated by pointer_golden_origin.py --revise-standstill, which refuses
  unless the other three sessions equal the server's run event for event.
- tests: no repeated or zero-displacement mousemove from standstill after 0, 0.2
  and 5 s, for click and move (fail on the old code); e2e with one real browser.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: a closed context leaves nothing in the registry, the browser's lists or the wire's error log

The three children of a context (Debugger, Tracing, APIRequestContext) were
announced under the browser and adopted by the context on the wire, but dispose
forgets a subtree by walking parent, so they outlived every context: 3 registry
entries per context (500 contexts: 1,500). browser.contexts kept every closed
context with its options and owner, browser._artifacts every download, and a
Stream's file stayed open when its parent's dispose forgot it (the cascade does
not call dispose on a descendant). New Dispatcher.released(), called for the
object and for each descendant the cascade forgets, lets go of what other
objects hold of it. RemoteEndpoint.wire_errors keeps the last 32, not all.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* remote: an opt-in memory probe (INVPW_MEM_LOG) and malloc trim (INVPW_MALLOC_TRIM), both off by default

INVPW_MEM_LOG=<file> writes a JSON line every INVPW_MEM_LOG_INTERVAL seconds
(default 2) and at each context close: uss/rss, registry objects, contexts,
clients, the bytes and messages queued in the clients' outboxes (read from the
queue at sampling time, free when the probe is off), gc counts and glibc
mallinfo2. INVPW_MALLOC_TRIM=1 calls malloc_trim(0) after each message of 64 KiB
or more has been sent and at each context close (Linux only; elsewhere ignored
with one warning). With both off nothing is built or loaded and the wire is
byte-identical.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: the guid registry collects its oldest dispatchers like Playwright's server

Per bucket (the object's type; Frame is MainFrame or Frame), past the limit the oldest
tenth is disposed with __dispose__ {reason: "gc"} to its owner and its subtree silently,
as dispatchers/dispatcher.ts of Playwright 1.62 does: 10000, JSHandle and ElementHandle
100000, one value per type in dispatcher.GC_LIMITS (INVPW_GC_LIMITS lowers some without
editing code). The registry is walked once per batch, not once per object. An event on a
disposed object is dropped, a request or frame already collected is not named again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: a request and a response keep what they hold, not what the wire carried

Measured on a real browser (one context, 95 navigations, ~100 subresources each) a Request
was 4.5 KB and a Response 6.0 KB: headers as a list of dicts kept twice (initializer and
raw_headers), the POST body and the timing in the initializer. Headers are now a tuple of
interned (name, value) pairs rebuilt on demand, the certificate is one object per distinct
certificate, the remote address a pair, and the initializer is replaced after the
__create__ by a copy without headers, postData and timing (a new dict: a message waiting in
a queue still holds the old one). Dispatcher.announced() is the hook; released() clears a
request's and a response's state when they leave the registry. 0.84 KB each, and the same
run ends at 73 MB instead of 149 MB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* server: Request, Response and Route collect at 2000, and nothing younger than 10 s is collected

Two declared differences from Playwright's collector (dispatcher.GC_LIMITS, docstring):
the three network types have a limit of 2000 instead of 10000, and an object younger than
GC_MIN_AGE_S is never a victim, so what a client was just handed (the Go client uses a
request inside the callback of its event) stays valid however fast the bucket fills.
Measured on a real browser, one context, 95 navigations of pages with ~100 subresources
and heavy headers: 193 MB at 10000, 74 MB (flat from navigation 25) at 2000.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* remote: malloc_trim is on by default on Linux; INVPW_MALLOC_TRIM=0 turns it off

After a context closes and after each message of 64 KiB or more is sent, the served browser
calls malloc_trim(0) when the libc has it (glibc on Linux). Slack's runs of 95 navigations: the
free memory glibc held (fordblks) went from 13 MB to 177 MB by default. Off Linux, with musl or
a libc without the function, nothing is called and nothing is said. No mallopt here:
MALLOC_ARENA_MAX=2 is process-wide, the launcher's to set (README). The probe stays off
and free unless INVPW_MEM_LOG is set.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs: the registry's collection limits and what they mean for a program that holds many old requests

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* release 0.48.0: launch_server, and the engine firefox-59 through invisible-core 59.57.0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the missing-websockets message is spelled by the installer, and two tests share a fixture without redefining it

The message named a written pip install, which the way-in check refuses; it is built with
invisible_core.installer now, as _engine.py does. The two tests imported a fixture and
took it as an argument (F811); they bind it by assignment instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: the pointer test reaches its fixture module the way the other tests do, not through a tests package that CI does not have

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test: the trim test waits for the trim, which the writer runs after the send

A fixed read of the trim count right after the reply failed on a slow runner (the client
holds the reply before the writer's next line runs). A delayed trim fails the old test and
passes this one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test: the WebGL e2e looks at the engine processes below its own test, not at the first one on the machine

With several workers in /proc the scan over every process could be handed another worker's
browser, which had not drawn yet and maps only the host's libgallium (GTK's GLX): red on one run of
the Linux gate and green on the next, same engine and core. The test now walks the tree under its
own process, asks that at least one process there maps the engine's libEGL and libgallium and that
none maps a host libEGL; a unit test with two trees on one machine fails a whole-machine scan.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test: a click's stroke is judged by its shape, not by how many mousemoves reached the page

The pacer drops a sample it cannot send on time, so the same stroke is 15 events on an idle machine
and 6 to 9 on a loaded one (Windows with 32 busy processes; the Linux gate with four workers got
9). The e2e asked for more than 10 and failed on the gate with a real stroke: it left from
(1116, 731), came in steps and ended on the click. It now asks that the stroke left from far away,
came in at least one step and ended on the target with no repeated mousemove; the standstill test
asks for something before the landing, not for 6 events. The unit test holds the gate's page events
as data: the old rule refuses them, the shape rule accepts them, and a jump, two events, a miss, a
start on the target and a repeat are refused. Ten idle runs and three loaded runs pass on Windows;
the old test fails under load.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Pin invisible-core 59.58.0; the pinning page drops the two keys that core no longer accepts

59.58.0 is on PyPI. Besides the same numbers from a seed on Python 3.11 to 3.14 (the red
py3.11 job), it stops declaring the glyph coverage ladder and forces no sRGB output profile, so
the pin keys font.alpha_ladder and desktop.srgb_output are refused by the validator; the pinning
page listed both and test_pinning_doc caught it. Their rows are gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Pin invisible-core 59.59.0 (59.57.0 and the version-independent float arithmetic)

59.59.0 is 59.57.0 plus only the fix for the two builtins that differ between Python versions
(sum() of floats and math.log2), which was the red py3.11 job. It keeps the glyph coverage
ladder the firefox-59 engine's declaration gate requires and the sRGB output pin, so the
pinning page lists font.alpha_ladder and desktop.srgb_output again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* The server answers NaN, the infinities and -0 as Playwright's tag, not as a bare number

Found by the e2e run on the strict JSON wire: page.evaluate_handle("() => NaN").json_value()
passed in process and failed with "$.result.value.n: nan is not JSON". The server's serializer
answered {"n": nan}, which Python writes as the bare word NaN and no other JSON reader accepts.
Playwright sends {"v": "NaN"} (and "Infinity", "-Infinity", "-0"); so does the server now. The
unit test fails on the old serializer (9 of 11) and the e2e that found it passes on both wires.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 08:44:54 +01:00
Federico EliaandClaude Sonnet 5.5 0eee28d093 e2e: the refusal of a missing system theme pref is expected on Linux only (#433)
On Windows the engine takes the system fonts and colours from the toolkit as
retail does (StealthVerifySystemTheme returns unless MOZ_WIDGET_GTK), so a
launch without ui.highlight, ui.-moz-field or ui.font.menu does not refuse
there. Candidate 42673795394's Windows gate ran the test and got DID NOT RAISE
three times. The refusal test now skips on win32; the control launch still runs.

tests/unit/test_theme_refusal_drop.py checks the skip mark on the refusal test
and its absence on the control; it fails on the test without the mark.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:13:45 +01:00
Federico EliaandClaude Sonnet 5.5 ccb0ff051f e2e: the refusal test launches the engine with the crash reporter off (#431)
The three missing-pref cases end in a deliberate abort (the engine refuses the launch), and each
opened the crash reporter on the desktop of whoever ran it.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 17:51:34 +01:00
Federico EliaandClaude Sonnet 5 0321737429 e2e: the B-frame order test uses the RDD process, like a real user (#432)
media.rdd-process.enabled=false and media.gpu-process-decoder=false left
the content process with no video decoder at all on Linux: WebCodecs'
configure() rejected with no decoder found for video/avc (MOZ_LOG
WebCodecs:5/MediaDecoder:5 confirms it, not a guess), fast and clean. The
hang the test actually showed was separate: flush() rejects right after
that, and nothing caught it inside the test's own new Promise, so resolve()
never ran and Playwright's own 30s evaluate timeout is what finally fired.
A real user always has the RDD process; dropping those two prefs runs the
default path instead of a configuration retail never has. flush() now
settles the promise on either outcome, so a real decode failure surfaces
immediately instead of hanging for 30s.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-09 17:51:25 +01:00
Federico EliaandClaude Sonnet 5.5 e8b57121e1 e2e: the dot() reads a zero's sign as the GPU does (zeros of both signs in the vectors, the comparison keeps the sign) (#430)
The comparison treated -0 and +0 as equal, which hid a fma whose product and sum are both -0 coming back +0. The model's fma now gives IEEE's sign of a zero result, with a unit test.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 17:42:17 +01:00
Federico EliaandClaude Sonnet 5.5 fa0d19cca3 e2e: the fontconfig test fails on an open of the host's configuration, not on the parent's existence probe (#429)
Candidate 42640321957 failed it on one lstat("~/.fonts.conf") of the parent: the parent builds
the content sandbox's permissions (SandboxBrokerPolicyFactory::InitContentPolicy) and asks
whether each path exists. It opens nothing, no byte of those files enters the process, and a
page cannot see it; the sandbox policy is not touched.

The criterion is now: a process that OPENS a host fontconfig or font path fails (an open
that fails with ENOENT too), and a content process that does anything there fails (stat,
access, readlink). The parent's existence probes are ignored, with the reason in the module.
tests/unit/test_fontconfig_criterion.py runs it on fake strace lines: the lstat passes; a
parent that opens /etc/fonts/fonts.conf or ~/.fonts.conf, and a content process that stats a
host font directory, fail.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 17:36:37 +01:00
Federico EliaandClaude Sonnet 5.5 1e23d20e0c e2e: the missing-system-theme-pref helper's regex compiles, with a unit test that fails on the old one (#427)
The regex that finds a pref's line in user.js had a lone backslash before its closing bracket
(an unterminated character set): every case of the e2e died with re.error before launching
a browser (candidate 42624473465, Windows gate). tests/unit/test_theme_refusal_drop.py runs
the helper on a user.js of its own and fails on the old regex.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 17:09:20 +01:00
Federico EliaandClaude Sonnet 5.5 3481f419c7 e2e: coloured canvas text and ClearType keys are drawn as retail Windows draws them (from firefox-60) (#428)
tests/data/canvas_text_ref only compares black text on white under one ClearType state, which
hides what a text-mask hook changes: 12 of 14 coloured cases differ from retail on an engine
that quantises its A8 masks.

New e2e, with hashes from retail Firefox 159.0 on Windows (headless, same pages, same bundled
fonts):
- the 14 coloured cases (7 colour pairs x Arial 16/33 px) with the seed's configuration;
- 39 cases (25 black of canvas_text_ref + the 14 coloured) under three ClearType keys,
  1800/100, 1400/50 and 2200/0, one launch per key with the font.cleartype_gamma and
  font.cleartype_contrast pins. The failure message lists each differing case.

The pin, the font check and the server of the existing canvas text test move to
tests/_canvas_text.py, which both tests import. The reference holds pages, hashes and
metadata only (scripts/build_canvas_text_colors_refs.py rebuilds it from the saved bytes);
tests/unit/test_canvas_text_colors_refs.py checks its structure and that the keys give
different hashes.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 16:35:47 +01:00
Federico EliaandClaude Sonnet 5.5 5c0de53221 e2e: a WebGL dot() gives the bits of the GPU family the persona declares (from firefox-60) (#426)
tests/test_webgl_dot_has_the_declared_gpu_s_bits_e2e.py reads back dot() of two, three and
four components through a float-bits shader and compares the bytes with the NVIDIA fma
chain computed in exact arithmetic, for alu_class 1 and 2; class 0 is the control. The model
runs as a unit test everywhere; the browser tests are Windows only and guarded by
engine_at_least("firefox-60"). The engine's gate lists it by name.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 14:25:58 +01:00
720 changed files with 48613 additions and 4092 deletions

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Question or general discussion
url: https://github.com/feder-cr/invisible_playwright/discussions
url: https://github.com/oss-invisible/playwright/discussions
about: Usage questions, ideas, chat. Bugs and features still go in issues.
@@ -0,0 +1,206 @@
# ─────────────────────────────────────────────────────────────────────────────
# compositor-visible-hunt.yml - HUNT ONLY, never merged. Nothing of the product is changed. Starts on its own paths only (the hunts running on this branch are
# not restarted by it, and it is not restarted by them).
#
# Can a PAGE tell software compositing ("WebRender (Software)") from our hardware path? Earlier rAF data showed 60 fps in one arm and 50-53 in another: why?
# Four arms, one browser each, ~20 s each, windows-2022, two rounds (alternating, so a drift of the runner is seen): ours, ours_vmretail (the prefs of
# hunt_vmretail.py build: retail's VM decisions), stockheaded, and retail 159.0 launched by hand (Mozilla's installer, checked against SHA256SUMS; the page runs
# the probe and posts its result to the local server). In the page (scripts/hunt_compositor_probe.js): requestAnimationFrame alone (interval p5/p50/p95, fps,
# dropped frames), with a CSS animation, with a WebGL animation; a smooth scrollTo of a long page (scroll events per second, time to finish); canvas 2D getImageData
# on 1024x1024 after drawing and WebGL readPixels timings; matchMedia (update: fast), screen refresh hints, the resolution of performance.now().
# `facts` reads, per arm, what Troubleshoot exposes (graphics.monitors[].refreshRate, the layer manager, layout.frame_rate, gfx.vsync.*) and PowerShell's
# Win32_VideoController.CurrentRefreshRate. The table marks every difference between ours / ours_vmretail and retail as TIMING-ONLY or VALUE.
# The code that decides the rAF rate: gfx/thebes/gfxWindowsPlatform.cpp D3DVsyncSource (rate from DwmGetCompositionTimingInfo, loop on WaitForVBlank, software
# vsync when it returns in under 1 ms or fails) and gfx/thebes/gfxPlatform.cpp:3462-3516 (layout.frame_rate, 60 Hz default): see the docstring of
# scripts/hunt_compositor_visible.py.
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: compositor visible hunt
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_compositor_visible.py
- scripts/hunt_compositor_probe.js
- .github/workflows/compositor-visible-hunt.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: compositor-visible-hunt-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, what a page reads of the compositor: ours, ours_vmretail, stockheaded, retail)"
runs-on: windows-2022
timeout-minutes: 90
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper, psutil, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: Where the prefs of ours_vmretail are written
run: echo "HUNT_VMRETAIL_PREFS=$RUNNER_TEMP/cv/vmretail/prefs.json" >> "$GITHUB_ENV"
- name: "Retail Firefox 159.0 (Mozilla's installer, checked against SHA256SUMS, unpacked with 7-Zip)"
continue-on-error: true
run: python -u scripts/hunt_first_run.py fetch-retail --out "$RUNNER_TEMP/cv/retail"
- name: "Build ours_vmretail (the declared table of ours, the decisions of stock, the prefs)"
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_vmretail.py build --binary "$FF" --out "$RUNNER_TEMP/cv/vmretail" | tee "$RUNNER_TEMP/cv/vmretail-build.txt"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
# ---------------------------------------------------------------------------------------- the facts (once per arm)
- name: "Facts, arm ours (Troubleshoot, effective prefs)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py facts --arm ours --binary "$FF" --out "$RUNNER_TEMP/cv/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm ours_vmretail (Troubleshoot, effective prefs)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py facts --arm ours_vmretail --binary "$FF" --out "$RUNNER_TEMP/cv/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm stockheaded (Troubleshoot, effective prefs)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py facts --arm stockheaded --out "$RUNNER_TEMP/cv/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm retail (Troubleshoot, effective prefs)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py facts --arm retail --retail-from "$RUNNER_TEMP/cv/retail" --out "$RUNNER_TEMP/cv/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
# ---------------------------------------------------------------------------------------- the measurement, two rounds
- name: "Round 1, arm ours (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/cv/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm retail (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm retail --retail-from "$RUNNER_TEMP/cv/retail" --out "$RUNNER_TEMP/cv/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm ours_vmretail (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm ours_vmretail --binary "$FF" --out "$RUNNER_TEMP/cv/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm stockheaded (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm stockheaded --out "$RUNNER_TEMP/cv/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1: table, what differs between ours / ours_vmretail and retail"
if: always()
continue-on-error: true
run: |
cp -r "$RUNNER_TEMP/cv/r0/"*-facts "$RUNNER_TEMP/cv/r1/" 2>/dev/null || true
python -u scripts/hunt_compositor_visible.py table "$RUNNER_TEMP/cv/r1" | tee "$RUNNER_TEMP/cv/r1/table.txt"
- name: "Round 2, arm stockheaded (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm stockheaded --out "$RUNNER_TEMP/cv/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours_vmretail (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm ours_vmretail --binary "$FF" --out "$RUNNER_TEMP/cv/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm retail (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm retail --retail-from "$RUNNER_TEMP/cv/retail" --out "$RUNNER_TEMP/cv/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours (one browser, ~20 s in the page)"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_compositor_visible.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/cv/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2: table, what differs between ours / ours_vmretail and retail"
if: always()
continue-on-error: true
run: |
cp -r "$RUNNER_TEMP/cv/r0/"*-facts "$RUNNER_TEMP/cv/r2/" 2>/dev/null || true
python -u scripts/hunt_compositor_visible.py table "$RUNNER_TEMP/cv/r2" | tee "$RUNNER_TEMP/cv/r2/table.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: compositor-visible-hunt-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/cv/r0
${{ runner.temp }}/cv/r1
${{ runner.temp }}/cv/r2
${{ runner.temp }}/cv/vmretail
${{ runner.temp }}/cv/vmretail-build.txt
if-no-files-found: warn
retention-days: 14
+2
View File
@@ -11,6 +11,8 @@
# counters/history.csv date,key,value - every counter, once a day
# counters/launches_daily.csv day_utc,launches - one row per measured day
# docs/badges/launches.svg, docs/badges/stars.svg
# docs/badges/launches.json, docs/badges/downloads.json - read by shields.io
# for the big row at the top of the README
#
# 00:10 UTC, so the snapshot dated D closes calendar day D-1.
name: counters
@@ -0,0 +1,312 @@
# ─────────────────────────────────────────────────────────────────────────────
# cpu-render-path-hunt-vm.yml - HUNT ONLY, never merged: second round of cpu-render-path-hunt.yml. Nothing of the product is changed: every pref goes
# through the hunt scripts (extra_prefs, the pytest plugin) and this workflow.
#
# What the first round found: on the Windows VM runner (adapter Microsoft Hyper-V Video) stock Firefox's GfxInfo blocks D3D11 compositing and WebRender
# with FEATURE_FAILURE_VM_VENDOR and falls back to WebRender (Software); ours declares OK for those features (the core's declaration, answered by
# the engine before any blocklist) and takes the hardware path: a GPU process, D3D11 compositing, and ~6x the CPU.
#
# This round, one windows-2022 job, in this order:
# 0. scripts/hunt_vmretail.py build: the arm `ours_vmretail` = ours made to take retail's VM decisions. It reads ours's DECLARED table
# (zoom.stealth.gfx.feature_status) and stock's own decision for every feature (nsIGfxInfo.getFeatureStatusStr), prints both side by side for
# every feature, and writes the extra_prefs: the declared table with only the compositing features replaced by stock's decision, plus
# gfx.webrender.software=true, gfx.webrender.software.d3d11=false (WebRender (Software), not Software D3D11) and webgl.angle.force-warp=true (WebGL on
# ANGLE with an explicit WARP device). The WebGL, media and every other feature keep what the persona declares: renderer, vendor and extensions stay
# as declared. The list is printed there, and read back from the effective prefs and Troubleshoot by the next steps.
# 1. `support` for ours, stockheaded and ours_vmretail: effective prefs, feature decisions, Troubleshoot's windowLayerManagerType and
# windowLayerManagerRemote, WebRender/D3D11/WARP lines. Did the prefs take effect?
# 2. scripts/hunt_cpu_baseline.py: one browser, 20 s, arms stockheaded, ours, ours_swwr, ours_vmretail: CPU per process type and per thread name, and
# WHERE COMPOSITING RUNS (the Compositor, Renderer, RenderBackend, WRWorker ... threads: in the parent or in the GPU process).
# 3. scripts/hunt_page_bytes.py: every page-readable value (canvas 2D, WebGL 1/2, text, strings; 2 launches per arm), ours against ours_vmretail.
# 4. The CPU per process type of the 4-browser, 10-scene loop (hunt_cpu_per_browser.py): ours, stockheaded, ours_vmretail, 2 rounds, alternating.
# 5. A profile of OUR GPU process with NO thread filter (MOZ_PROFILER_STARTUP_FILTERS=*), small buffer, 3 rounds: every thread of the GPU process with
# its self weight by module, and the weight of the unnamed threads by module (are they d3d10warp.dll?).
# 6. The wrapper's own byte suites (canvas_*, webgl_*, ...) under ours and under ours_vmretail (scripts/hunt_extra_prefs_plugin.py), outcome per test.
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: cpu render path hunt vm
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_vmretail.py
- scripts/hunt_cpu_render_path.py
- scripts/hunt_cpu_per_browser.py
- scripts/hunt_cpu_baseline.py
- scripts/hunt_page_bytes.py
- scripts/hunt_page_bytes_probe.js
- scripts/hunt_extra_prefs_plugin.py
- scripts/hunt_profile_summary.py
- scripts/hunt_fetch_symbols.py
- .github/workflows/cpu-render-path-hunt-vm.yml
workflow_dispatch:
inputs:
symbols_run:
description: "Run id of the engine's release.yml whose symbols-win-x86_64 artifact matches the binary (empty: look through the recent runs)"
required: false
default: ""
permissions:
contents: read
concurrency:
group: cpu-render-path-hunt-vm-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, ours_vmretail - retail's VM decisions, where compositing runs, page bytes, GPU process profile)"
runs-on: windows-2022
timeout-minutes: 200
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper, psutil, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: Where the prefs of ours_vmretail are written
run: echo "HUNT_VMRETAIL_PREFS=$RUNNER_TEMP/vm/vmretail/prefs.json" >> "$GITHUB_ENV"
# ------------------------------------------------------------------------------------------------ 0. the arm ours_vmretail
- name: "0. Build ours_vmretail (the declared table of ours, the decisions of stock, the prefs)"
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_vmretail.py build --binary "$FF" --out "$RUNNER_TEMP/vm/vmretail" | tee "$RUNNER_TEMP/vm/vmretail-build.txt"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
# ------------------------------------------------------------------------------------------------ 1. did the prefs take effect, where does it composite
- name: "1. Compositing facts, arm ours"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm ours --binary "$FF" --out "$RUNNER_TEMP/vm/support"
- name: "1. Compositing facts, arm stockheaded"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm stockheaded --out "$RUNNER_TEMP/vm/support"
- name: "1. Compositing facts, arm ours_vmretail (the prefs read back)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm ours_vmretail --binary "$FF" --out "$RUNNER_TEMP/vm/support"
- name: "1. Graphics diff, ours_vmretail against stockheaded (is it the same compositing as stock now?)"
if: always()
continue-on-error: true
run: |
mkdir -p "$RUNNER_TEMP/vm/support-vm"
rm -rf "$RUNNER_TEMP/vm/support-vm/ours" "$RUNNER_TEMP/vm/support-vm/stockheaded"
cp -r "$RUNNER_TEMP/vm/support/ours_vmretail" "$RUNNER_TEMP/vm/support-vm/ours"
cp -r "$RUNNER_TEMP/vm/support/stockheaded" "$RUNNER_TEMP/vm/support-vm/stockheaded"
python -u scripts/hunt_cpu_render_path.py diff "$RUNNER_TEMP/vm/support-vm" | tee "$RUNNER_TEMP/vm/support-vm/diff.txt"
# ------------------------------------------------------------------------------------------------ 2. one browser, 20 s: CPU by process and thread
- name: "2. Baseline, arm stockheaded"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm stockheaded --out "$RUNNER_TEMP/vm/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Baseline, arm ours"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm ours --binary "$FF" --out "$RUNNER_TEMP/vm/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Baseline, arm ours_vmretail"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm ours_vmretail --binary "$FF" --out "$RUNNER_TEMP/vm/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Baseline, arm ours_swwr"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm ours_swwr --binary "$FF" --out "$RUNNER_TEMP/vm/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Baseline comparison and where compositing runs"
if: always()
continue-on-error: true
run: python scripts/hunt_cpu_baseline.py --compare "$RUNNER_TEMP/vm/baseline" | tee "$RUNNER_TEMP/vm/baseline/compare.txt"
# ------------------------------------------------------------------------------------------------ 3. page-readable bytes
- name: "3. Page-readable bytes, arm ours (2 launches)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours --binary "$FF" --launches 2 --out "$RUNNER_TEMP/vm/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. Page-readable bytes, arm ours_vmretail (2 launches)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours_vmretail --binary "$FF" --launches 2 --out "$RUNNER_TEMP/vm/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. Page-readable bytes, ours against ours_vmretail"
if: always()
continue-on-error: true
run: python -u scripts/hunt_page_bytes.py diff "$RUNNER_TEMP/vm/pagebytes" --a ours --b ours_vmretail | tee "$RUNNER_TEMP/vm/pagebytes/diff.txt"
# ------------------------------------------------------------------------------------------------ 4. CPU of the 4-browser loop
- name: "4. CPU by process type, ours, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours --binary "$FF" --round 1 --out "$RUNNER_TEMP/vm/cpu/ours-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. CPU by process type, stockheaded, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm stockheaded --round 1 --out "$RUNNER_TEMP/vm/cpu/stockheaded-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. CPU by process type, ours_vmretail, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours_vmretail --binary "$FF" --round 1 --out "$RUNNER_TEMP/vm/cpu/ours_vmretail-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. CPU by process type, ours, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours --binary "$FF" --round 2 --out "$RUNNER_TEMP/vm/cpu/ours-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. CPU by process type, stockheaded, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm stockheaded --round 2 --out "$RUNNER_TEMP/vm/cpu/stockheaded-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. CPU by process type, ours_vmretail, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours_vmretail --binary "$FF" --round 2 --out "$RUNNER_TEMP/vm/cpu/ours_vmretail-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. Comparison table"
if: always()
continue-on-error: true
run: python scripts/hunt_cpu_per_browser.py --compare "$RUNNER_TEMP/vm/cpu" | tee "$RUNNER_TEMP/vm/cpu/compare.txt"
# ------------------------------------------------------------------------------------------------ 5. our GPU process, every thread
- name: "5. Gecko profile of our GPU process, NO thread filter (MOZ_PROFILER_STARTUP_FILTERS=*), small buffer, 3 rounds"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py profile --arm ours --binary "$FF" --gpu --filters '*' --out "$RUNNER_TEMP/vm/profiles-gpu-all"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "5. Symbols of our engine (artifact symbols-win-x86_64 of the engine's release.yml)"
if: always()
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
P="$RUNNER_TEMP/vm/profiles-gpu-all"
ID="$(python scripts/hunt_profile_summary.py "$P/ours" --ids | awk '$3=="xul.dll"{print $2}' | head -1)"
echo "breakpad id of our xul.dll in the profile: '$ID'"
if [ -z "$ID" ]; then echo "SYMBOLS: none (no id: no parent profile of ours)"; exit 0; fi
python scripts/hunt_fetch_symbols.py --id "$ID" --run "${{ inputs.symbols_run }}" --out "$RUNNER_TEMP/vm/symbols" | tee "$RUNNER_TEMP/vm/symbols.log"
- name: "5. Summary of the GPU process: every thread, its self weight by module, the unnamed threads, the top functions"
if: always()
continue-on-error: true
run: |
P="$RUNNER_TEMP/vm/profiles-gpu-all/ours"
SYM=$(ls "$RUNNER_TEMP"/vm/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
python -u scripts/hunt_profile_summary.py "$P" ${SYM:+--symbols "$SYM"} --only gpu --detail 2 --thread-table --threads 8 --top 20 | tee "$P/summary-gpu-all.txt"
# ------------------------------------------------------------------------------------------------ 6. the wrapper's byte suites
- name: "6. The wrapper's byte suites, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 35
env:
PYTHONPATH: ${{ github.workspace }}/scripts
INVPW_BINARY_PATH: ${{ env.FF }}
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog-suites.log
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
D="$RUNNER_TEMP/vm/suites"; mkdir -p "$D"
FILES=$(ls tests/test_canvas_*.py tests/test_webgl_*.py tests/test_a_declared_webgl_extension_survives_its_use_e2e.py \
tests/test_fingerprint_surface.py tests/test_fingerprint_consistency.py tests/test_system_fonts_and_colors_are_windows_e2e.py \
tests/test_css_calc_is_windows_e2e.py tests/test_screenshot_of_text_returns_linux_e2e.py | sort -u)
echo "$FILES" > "$D/files.txt"; echo "$FILES" | wc -l
python -u -m pytest $FILES -o addopts= -p no:cacheprovider -p hunt_extra_prefs_plugin -q -rs --junitxml="$D/ours.xml" 2>&1 | tee "$D/ours.log" | tail -60
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "6. The wrapper's byte suites, arm ours_vmretail (HUNT_EXTRA_PREFS = the prefs of hunt_vmretail.py build)"
if: always()
continue-on-error: true
timeout-minutes: 35
env:
PYTHONPATH: ${{ github.workspace }}/scripts
INVPW_BINARY_PATH: ${{ env.FF }}
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog-suites.log
HUNT_EXTRA_PREFS_LOG: ${{ runner.temp }}/vm/suites/ours_vmretail-prefs.log
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
D="$RUNNER_TEMP/vm/suites"; mkdir -p "$D"
export HUNT_EXTRA_PREFS="$(python scripts/hunt_vmretail.py prefs-json "$HUNT_VMRETAIL_PREFS")"
echo "HUNT_EXTRA_PREFS has $(echo -n "$HUNT_EXTRA_PREFS" | wc -c) characters"
FILES=$(cat "$D/files.txt" 2>/dev/null || true)
[ -n "$FILES" ] || FILES=$(ls tests/test_canvas_*.py tests/test_webgl_*.py)
python -u -m pytest $FILES -o addopts= -p no:cacheprovider -p hunt_extra_prefs_plugin -q -rs --junitxml="$D/ours_vmretail.xml" 2>&1 | tee "$D/ours_vmretail.log" | tail -60
echo "browsers constructed with the prefs: $(wc -l < "$D/ours_vmretail-prefs.log" 2>/dev/null || echo 0)"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "6. The wrapper's byte suites, outcome per test in both arms"
if: always()
continue-on-error: true
run: |
D="$RUNNER_TEMP/vm/suites"
python scripts/hunt_page_bytes.py suites "$D/ours.xml" "$D/ours_vmretail.xml" --b-name ours_vmretail | tee "$D/suites-diff.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: cpu-render-path-hunt-vm-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/vm
if-no-files-found: warn
retention-days: 14
+330
View File
@@ -0,0 +1,330 @@
# ─────────────────────────────────────────────────────────────────────────────
# cpu-render-path-hunt.yml - HUNT ONLY, never merged: why does our Firefox use ~6x the CPU of stock Firefox 159 with a window, on Windows?
# (measured per browser: parent 8.8 s against 1.7, GPU process 4.9 against 0.03, tab 0.84 against 0.58.) Nothing of the product is changed.
#
# Two arms, as in cpu-per-browser-hunt: `ours` = invisible_playwright, headless=True (on Windows: headed Firefox on a hidden desktop) and
# `stockheaded` = stock Playwright, firefox.launch(headless=False). One job, windows-2022, in this order:
# 1. scripts/hunt_cpu_render_path.py support, then diff: the full about:support text of each browser (page.goto("about:support") through
# the wire; if that is refused, Troubleshoot.snapshot() through Marionette in chrome scope, and the job says which route worked), the
# effective prefs, the profile's prefs.js and user.js, the parent's environment, and the diff of the Graphics section (compositing,
# WebRender hardware/software, D3D11/WARP, GPU process, the feature decisions and their reasons, the differing gfx.* / layers.* prefs).
# 3. the CPU by process type of hunt_cpu_per_browser.py, ours and stockheaded, 2 rounds each, alternating (the sanity check).
# 2. scripts/hunt_cpu_render_path.py profile: the same 4-browser, 10-scene loop with the Gecko profiler on from startup in every process
# (MOZ_PROFILER_STARTUP, STARTUP_FEATURES, MOZ_PROFILER_SHUTDOWN=<dir>/profile-%p.json: one file per process). It runs AFTER the CPU
# rounds because the profiler slows the browsers. scripts/hunt_profile_summary.py prints, for the busiest parent and GPU process of each
# arm, the CPU by thread, by module and by function. Symbols: for ours, the Breakpad symbols of the artifact symbols-win-x86_64 of a
# recent release.yml run of the engine's repository, if one still exists and its xul.pdb id matches the binary (scripts/
# hunt_fetch_symbols.py; a candidate's are kept 2 days, a release's 14); for every module the zips do not have, Mozilla's symbol server.
# Where a module cannot be symbolicated the summary says so and prints module+offset; the raw profiles are always in the artifact.
# 4. (second round of the hunt) the baseline of the parent: scripts/hunt_cpu_baseline.py, ONE browser for 20 s, three arms: `retail` (Mozilla's own
# Firefox installer of the stable release, unpacked with 7-Zip and launched by hand with subprocess, -no-remote, a fresh profile, the scene
# URL, no automation, no Playwright; if it cannot be had the step falls back to Playwright's firefox-1572 and says so), `ours`, and
# `ours_reused` (ours twice on the same persistent profile, profile_dir=). CPU per process type (the sampler) and per thread name (psutil
# threads + GetThreadDescription) in the whole window and in its last 10 s; the command line of every short-lived process.
# 5. `ours_swwr` = ours with gfx.webrender.software=true, passed ONLY by the hunt through extra_prefs: its compositing facts (support), its CPU
# per process type next to ours and stockheaded (step 3 gains two rounds of it), and whether ANY byte a page reads differs from ours:
# scripts/hunt_page_bytes.py (canvas 2D, WebGL 1/2, text, strings, in both arms, launched twice each, diffed) and the wrapper's own byte
# suites (canvas_*, webgl_*, canvas text, fingerprint_*, system fonts, css calc) under both arms through scripts/hunt_extra_prefs_plugin.py.
# 6. A readable profile of OUR GPU process only (profile --gpu): the profiler's thread filter limited to the GPU process's threads, a small buffer,
# 3 rounds, and the run waits for every process to exit before reading the files (the first GPU profile came back truncated).
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: cpu render path hunt
# Dispatch only since the second round: its scripts are shared with cpu-render-path-hunt-vm.yml and encoding-stability-hunt.yml, which start on push
# to this branch, and a 2 h Windows run must not start again on every push that touches a shared script.
on:
workflow_dispatch:
inputs:
symbols_run:
description: "Run id of the engine's release.yml whose symbols-win-x86_64 artifact matches the binary (empty: look through the recent runs)"
required: false
default: ""
permissions:
contents: read
concurrency:
group: cpu-render-path-hunt-${{ github.ref }}
cancel-in-progress: true
# Engine and GeoIP downloads go through the release API with this token (as in e2e.yml).
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, ours vs stock headed vs retail - about:support, CPU by process type, baseline, software WebRender, Gecko profiles)"
runs-on: windows-2022
timeout-minutes: 170
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper, psutil, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
# ------------------------------------------------------------------------------------------------- 1. about:support
- name: "1. about:support, prefs and environment, arm ours"
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm ours --binary "$FF" --out "$RUNNER_TEMP/render-hunt/support"
- name: "1. about:support, prefs and environment, arm stockheaded"
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm stockheaded --out "$RUNNER_TEMP/render-hunt/support"
- name: "1. Graphics diff, ours against stockheaded"
if: always()
continue-on-error: true
run: python -u scripts/hunt_cpu_render_path.py diff "$RUNNER_TEMP/render-hunt/support" | tee "$RUNNER_TEMP/render-hunt/support/diff.txt"
- name: "5. Compositing facts of ours_swwr (does gfx.webrender.software=true from the hunt really take effect?)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py support --arm ours_swwr --binary "$FF" --out "$RUNNER_TEMP/render-hunt/support"
# --------------------------------------------------------------------------------- 4. the baseline of the parent (one browser, 20 s)
- name: "4. Baseline, arm retail (Mozilla's Firefox, launched by hand, no automation)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm retail --out "$RUNNER_TEMP/render-hunt/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. Baseline, arm ours (fresh temporary profile)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm ours --binary "$FF" --out "$RUNNER_TEMP/render-hunt/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. Baseline, arm ours_reused (the same persistent profile twice; the second launch is measured)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_baseline.py --arm ours_reused --binary "$FF" --out "$RUNNER_TEMP/render-hunt/baseline"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "4. Baseline comparison table"
if: always()
continue-on-error: true
run: python scripts/hunt_cpu_baseline.py --compare "$RUNNER_TEMP/render-hunt/baseline" | tee "$RUNNER_TEMP/render-hunt/baseline/compare.txt"
# ------------------------------------------------------------------------------------- 3. CPU by process type (sanity)
- name: "3. CPU by process type, ours, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours --binary "$FF" --round 1 --out "$RUNNER_TEMP/render-hunt/cpu/ours-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. CPU by process type, stockheaded, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm stockheaded --round 1 --out "$RUNNER_TEMP/render-hunt/cpu/stockheaded-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. CPU by process type, ours_swwr, round 1"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours_swwr --binary "$FF" --round 1 --out "$RUNNER_TEMP/render-hunt/cpu/ours_swwr-1.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. CPU by process type, ours, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours --binary "$FF" --round 2 --out "$RUNNER_TEMP/render-hunt/cpu/ours-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. CPU by process type, stockheaded, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm stockheaded --round 2 --out "$RUNNER_TEMP/render-hunt/cpu/stockheaded-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. CPU by process type, ours_swwr, round 2"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_per_browser.py --arm ours_swwr --binary "$FF" --round 2 --out "$RUNNER_TEMP/render-hunt/cpu/ours_swwr-2.json"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "3. Comparison table"
if: always()
continue-on-error: true
run: python scripts/hunt_cpu_per_browser.py --compare "$RUNNER_TEMP/render-hunt/cpu" | tee "$RUNNER_TEMP/render-hunt/cpu/compare.txt"
# ------------------------------------------------------------------------- 5. does any byte a page reads change with software WebRender?
- name: "5. Page-readable bytes, arm ours (canvas 2D, WebGL 1/2, text, strings; 2 launches)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours --binary "$FF" --launches 2 --out "$RUNNER_TEMP/render-hunt/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "5. Page-readable bytes, arm ours_swwr (2 launches)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours_swwr --binary "$FF" --launches 2 --out "$RUNNER_TEMP/render-hunt/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "5. Page-readable bytes, ours against ours_swwr"
if: always()
continue-on-error: true
run: python -u scripts/hunt_page_bytes.py diff "$RUNNER_TEMP/render-hunt/pagebytes" | tee "$RUNNER_TEMP/render-hunt/pagebytes/diff.txt"
# -------------------------------------------------------------------------------------------- 2. the Gecko profiles
- name: "2. Gecko profiles of the 10-scene loop, arm ours"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py profile --arm ours --binary "$FF" --out "$RUNNER_TEMP/render-hunt/profiles"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Gecko profiles of the 10-scene loop, arm stockheaded"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py profile --arm stockheaded --out "$RUNNER_TEMP/render-hunt/profiles"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Symbols of our engine (artifact symbols-win-x86_64 of the engine's release.yml)"
if: always()
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
P="$RUNNER_TEMP/render-hunt/profiles"
ID="$(python scripts/hunt_profile_summary.py "$P/ours" --ids | awk '$3=="xul.dll"{print $2}' | head -1)"
echo "breakpad id of our xul.dll in the profile: '$ID'"
if [ -z "$ID" ]; then echo "SYMBOLS: none (no id: no parent profile of ours)"; exit 0; fi
python scripts/hunt_fetch_symbols.py --id "$ID" --run "${{ inputs.symbols_run }}" --out "$RUNNER_TEMP/render-hunt/symbols" | tee "$RUNNER_TEMP/render-hunt/symbols.log"
- name: "2. Profile summary, ours"
if: always()
continue-on-error: true
run: |
P="$RUNNER_TEMP/render-hunt/profiles"
SYM=$(ls "$RUNNER_TEMP"/render-hunt/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
python -u scripts/hunt_profile_summary.py "$P/ours" ${SYM:+--symbols "$SYM"} | tee "$P/summary-ours.txt"
- name: "2. Profile summary, stockheaded"
if: always()
continue-on-error: true
run: |
P="$RUNNER_TEMP/render-hunt/profiles"
python -u scripts/hunt_profile_summary.py "$P/stockheaded" | tee "$P/summary-stockheaded.txt"
# ----------------------------------------------------------------------------------------- 6. a readable profile of OUR GPU process
- name: "6. Gecko profile of our GPU process only (filtered threads, small buffer, 3 rounds)"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_cpu_render_path.py profile --arm ours --binary "$FF" --gpu --out "$RUNNER_TEMP/render-hunt/profiles-gpu"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "6. Summary of the GPU process: self time by module and the top functions"
if: always()
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
P="$RUNNER_TEMP/render-hunt/profiles-gpu/ours"
SYM=$(ls "$RUNNER_TEMP"/render-hunt/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
if [ -z "$SYM" ]; then
ID="$(python scripts/hunt_profile_summary.py "$P" --ids | awk '$3=="xul.dll"{print $2}' | head -1)"
echo "no symbols from step 2; breakpad id of our xul.dll in the GPU run: '$ID'"
if [ -n "$ID" ]; then python scripts/hunt_fetch_symbols.py --id "$ID" --run "${{ inputs.symbols_run }}" --out "$RUNNER_TEMP/render-hunt/symbols" | tee "$RUNNER_TEMP/render-hunt/symbols-gpu.log"; fi
SYM=$(ls "$RUNNER_TEMP"/render-hunt/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
fi
python -u scripts/hunt_profile_summary.py "$P" ${SYM:+--symbols "$SYM"} --only gpu --detail 2 --threads 6 --top 20 | tee "$P/summary-gpu.txt"
# ----------------------------------------------------- 5b. the wrapper's own byte suites under both arms (the pref goes in through a plugin)
- name: "5. The wrapper's byte suites, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 30
env:
PYTHONUNBUFFERED: "1"
PYTHONPATH: ${{ github.workspace }}/scripts
INVPW_BINARY_PATH: ${{ env.FF }}
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog-suites.log
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
D="$RUNNER_TEMP/render-hunt/suites"; mkdir -p "$D"
FILES=$(ls tests/test_canvas_*.py tests/test_webgl_*.py tests/test_a_declared_webgl_extension_survives_its_use_e2e.py \
tests/test_fingerprint_surface.py tests/test_fingerprint_consistency.py tests/test_system_fonts_and_colors_are_windows_e2e.py \
tests/test_css_calc_is_windows_e2e.py tests/test_screenshot_of_text_returns_linux_e2e.py | sort -u)
echo "$FILES" > "$D/files.txt"; echo "$FILES" | wc -l
python -u -m pytest $FILES -o addopts= -p no:cacheprovider -p hunt_extra_prefs_plugin -q -rs --junitxml="$D/ours.xml" 2>&1 | tee "$D/ours.log" | tail -60
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "5. The wrapper's byte suites, arm ours_swwr (HUNT_EXTRA_PREFS gfx.webrender.software=true)"
if: always()
continue-on-error: true
timeout-minutes: 30
env:
PYTHONUNBUFFERED: "1"
PYTHONPATH: ${{ github.workspace }}/scripts
INVPW_BINARY_PATH: ${{ env.FF }}
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog-suites.log
HUNT_EXTRA_PREFS: '{"gfx.webrender.software": true}'
HUNT_EXTRA_PREFS_LOG: ${{ runner.temp }}/render-hunt/suites/ours_swwr-prefs.log
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
D="$RUNNER_TEMP/render-hunt/suites"; mkdir -p "$D"
FILES=$(cat "$D/files.txt" 2>/dev/null || true)
[ -n "$FILES" ] || FILES=$(ls tests/test_canvas_*.py tests/test_webgl_*.py)
python -u -m pytest $FILES -o addopts= -p no:cacheprovider -p hunt_extra_prefs_plugin -q -rs --junitxml="$D/ours_swwr.xml" 2>&1 | tee "$D/ours_swwr.log" | tail -60
echo "browsers constructed with the pref: $(wc -l < "$D/ours_swwr-prefs.log" 2>/dev/null || echo 0)"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "5. The wrapper's byte suites, outcome per test in both arms"
if: always()
continue-on-error: true
run: |
D="$RUNNER_TEMP/render-hunt/suites"
python scripts/hunt_page_bytes.py suites "$D/ours.xml" "$D/ours_swwr.xml" | tee "$D/suites-diff.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results (about:support, prefs, CPU numbers, summaries, raw gzipped profiles)
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: cpu-render-path-hunt-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/render-hunt/support
${{ runner.temp }}/render-hunt/cpu
${{ runner.temp }}/render-hunt/profiles
${{ runner.temp }}/render-hunt/profiles-gpu
${{ runner.temp }}/render-hunt/baseline
${{ runner.temp }}/render-hunt/pagebytes
${{ runner.temp }}/render-hunt/suites
${{ runner.temp }}/render-hunt/symbols.log
if-no-files-found: warn
retention-days: 14
+229 -13
View File
@@ -6,8 +6,7 @@
# launched Firefox in true HEADLESS mode, which is content-process unstable on
# the hosted runners (eval-CSP / context-destroyed). The stealth wrapper instead
# launches Firefox HEADED on a real display; under `xvfb-run` (a virtual X
# server) that's exactly what we get on a headless CI box - stable, and the same
# thing webrtc-e2e.yml already relies on.
# server) that's exactly what we get on a headless CI box - stable.
#
# Secret-free, so it's safe in public CI: the binary is the PUBLIC firefox-9
# release (no token), and the webrtc e2e fake a local TCP-only SOCKS. The proxy
@@ -34,18 +33,35 @@ on:
- 'docs/**'
- 'LICENSE'
workflow_dispatch:
inputs:
only:
description: "Which job. `windows-control-a` runs only the Windows job of the keyboard shortcut (after the core of a release is on the index and its engine is published); `all` runs the whole workflow."
required: false
default: "all"
type: choice
options:
- all
- windows-control-a
permissions:
contents: read
# One run of this workflow per branch at a time. A newer push cancels the older
# in-flight run as a whole, cleanly, instead of leaving its queued jobs to be
# cancelled one by one - which left the run marked failed even though nothing
# had actually failed. Keyed by workflow + ref so tests and e2e never cancel
# each other; only an older run of THIS workflow on the same branch is replaced.
# A newer push to a pull request cancels the older in-flight run of THIS
# workflow on that pull request as a whole, cleanly, instead of leaving its
# queued jobs to be cancelled one by one - which left the run marked failed even
# though nothing had actually failed. Keyed by workflow + pull request number,
# so tests and e2e never cancel each other.
#
# NEVER on main. The release gate (scripts/e2e_is_green.py) asks for the e2e
# check-run of the commit being tagged, and a cancelled one refuses the release:
# with the group keyed by ref, the next push to main cancelled the run of the
# commit before it. Outside a pull request the group is unique to the run
# (`github.run_id`), so every commit of main keeps its own finished run, and a
# pending run is not replaced by a newer one either (a group with a fixed name
# drops the older pending run, cancel or not).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Engine and GeoIP downloads go through the release API with this token.
# Anonymous requests share a 60-an-hour limit per runner address and are the
@@ -67,7 +83,7 @@ jobs:
e2e:
name: e2e (linux, xvfb)
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
if: needs.core-on-index.outputs.available == 'true' && inputs.only != 'windows-control-a'
runs-on: ubuntu-24.04
timeout-minutes: 40
steps:
@@ -108,7 +124,14 @@ jobs:
# The generator moved into the core with the module it writes (0.30.0),
# so the check runs against the core this package installs.
run: python -m invisible_core.juggler._gen_protocol --check --binary "$(dirname "$FF")"
- name: Run the full e2e suite under a virtual display
# The GeoIP database is made by the repository (scripts/ci_lab_geoip.py: the same bytes on every run, the sha256 in ci/geoip.json), never a
# site and never a licensed file: without STEALTHFOX_GEOIP_MMDB the core asks GitHub which database is the latest on every call
# (run 43211837926). The variable reaches every later step of the job.
- name: The GeoIP database (made by the repository, same bytes every run)
shell: bash
run: python scripts/ci_lab_geoip.py build
- name: Run the full e2e suite under a virtual display, without the root ones
# PYTHONUNBUFFERED, and it is not a nicety. Without it Python block-buffers
# stdout when it is a pipe, and this step printed NOTHING for 39 minutes
# before the 40-minute timeout killed it on 2026-08-04: a run with no
@@ -124,9 +147,94 @@ jobs:
# the descriptors at the system level: whatever is captured is lost
# when the process is killed, which is exactly the case it exists for.
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog.log
run: xvfb-run -a python -u scripts/run_e2e.py "$FF"
ROOT_FILES: tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py
ROOT_NODES: tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick
SANDBOX_FILES: tests/test_the_socket_process_is_sandboxed_e2e.py
# The root ones are left out by name and run in the step below, as root: here, as the runner user, they errored. The sandbox one is left out
# by name too and runs in its own step after them: it is red on a runner whose AppArmor refuses user namespaces to a normal user.
run: |
IGNORE=(); for f in $ROOT_FILES $SANDBOX_FILES; do IGNORE+=("--ignore=$f"); done
DESELECT=(); for n in $ROOT_NODES; do DESELECT+=("--deselect=$n"); done
xvfb-run -a python -u scripts/run_e2e.py "$FF" "${IGNORE[@]}" "${DESELECT[@]}"
# Runs ONLY if the step above fails, and before 2026-08-13 it could not
# THE ROOT SUITE, AS THE GATE RUNS IT (wrapper.e2e.udp.exit in ci/required-suites.json). Seven e2e need root: the exit of the lab is a documentation
# address (198.51.100.9) added to `lo` with `ip addr add`. Collected here as the runner user they ERRORED (run 43262636367: "cannot hold 198.51.100.9
# on lo (needs root and iproute2 on Linux)"), so the run above leaves them out by name (ROOT_FILES / ROOT_NODES) and this step runs them, and only
# them, the way the gate does: the engine copied to /opt/ff (the socket process execs inside a new user namespace, where the runner's 750 home is not
# readable), `sudo -H -E env -u XDG_RUNTIME_DIR` (Firefox refuses to run as root in a regular user's session), no rerun plugin. Nothing is skipped
# silently: the step reads its own junit and refuses anything but exactly that many tests, all passed.
# AFTER the run of the runner user, never before it (run 43271443150 of PR 483: with this step first, every launch of the run that followed
# waited for the browser's readiness line until its timeout, and the job was cancelled at 40 minutes; the same head without the step had 748
# green). Whatever root leaves behind (files under the runner's home or /tmp, /etc/resolv.conf, an address on lo) cannot reach a launch of the
# runner user any more; the step after this one prints what it left, and decides nothing.
# tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py holds the two lists, this step and the run above to the suite's list, and the order.
- name: The root e2e (wrapper.e2e.udp.exit), as root, as the gate runs them
if: success() || failure()
env:
PYTHONUNBUFFERED: "1"
ROOT_FILES: tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py
ROOT_NODES: tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick
ROOT_TESTS: "7"
run: |
sudo rm -rf /opt/ff
sudo cp -a "$(dirname "$FF")" /opt/ff
sudo chown -R root:root /opt/ff
sudo chmod -R go+rX /opt/ff
ROOT_FF="/opt/ff/$(basename "$FF")"
JUNIT="${RUNNER_TEMP}/root-e2e.xml"
sudo -H -E env -u PYTEST_ADDOPTS -u XDG_RUNTIME_DIR INVPW_REQUIRE_TRAP=1 "PATH=$PATH" INVPW_BINARY_PATH="$ROOT_FF" STEALTHFOX_E2E_BINARY="$ROOT_FF" python -m pytest $ROOT_FILES $ROOT_NODES -m e2e -o addopts='' -o junit_family=xunit2 -q -p no:cacheprovider -p no:rerunfailures -rs --junitxml="$JUNIT" || true
python - <<'PY'
import os, sys, xml.etree.ElementTree as ET
root = ET.parse(os.path.join(os.environ["RUNNER_TEMP"], "root-e2e.xml")).getroot()
suite = root if root.tag == "testsuite" else root.find("testsuite")
counts = {k: int(suite.get(k, 0)) for k in ("tests", "failures", "errors", "skipped")}
print("root e2e:", counts)
if counts["tests"] != int(os.environ["ROOT_TESTS"]) or counts["failures"] or counts["errors"] or counts["skipped"]:
sys.exit("the root e2e must be exactly %s tests, all passed: %s" % (os.environ["ROOT_TESTS"], counts))
PY
# THE SANDBOX E2E (wrapper.e2e.udp.sandbox), as the gate runs its first file: the browser WITH its sandbox, run by the runner user. On this runner AppArmor
# refuses user namespaces to a normal user (kernel.apparmor_restrict_unprivileged_userns=1), so the browser of every other step starts WITHOUT the sandbox
# of its socket and content processes, and tests/test_the_socket_process_is_sandboxed_e2e.py (which fails unless both have a seccomp filter) can only
# be green after the restriction is turned off. It is left out of the run above by name (SANDBOX_FILES) so that it cannot fail on a runner without the
# sysctl, and it runs here, after the run and the root step (whatever the sysctl changes cannot reach a launch of the run), as the runner user. Nothing
# is skipped silently: the step reads its own junit and refuses anything but exactly that many tests, all passed.
# tests/test_the_sandbox_e2e_runs_where_user_namespaces_are_on.py holds this step, the exclusion above and the order.
- name: The sandbox e2e (wrapper.e2e.udp.sandbox), with unprivileged user namespaces on
if: success() || failure()
env:
PYTHONUNBUFFERED: "1"
SANDBOX_FILES: tests/test_the_socket_process_is_sandboxed_e2e.py
SANDBOX_TESTS: "1"
run: |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
JUNIT="${RUNNER_TEMP}/sandbox-e2e.xml"
xvfb-run -a env -u PYTEST_ADDOPTS INVPW_BINARY_PATH="$FF" STEALTHFOX_E2E_BINARY="$FF" python -m pytest $SANDBOX_FILES -m e2e -o addopts='' -o junit_family=xunit2 -q -p no:cacheprovider -p no:rerunfailures -rs --junitxml="$JUNIT" || true
python - <<'PY'
import os, sys, xml.etree.ElementTree as ET
root = ET.parse(os.path.join(os.environ["RUNNER_TEMP"], "sandbox-e2e.xml")).getroot()
suite = root if root.tag == "testsuite" else root.find("testsuite")
counts = {k: int(suite.get(k, 0)) for k in ("tests", "failures", "errors", "skipped")}
print("sandbox e2e:", counts)
if counts["tests"] != int(os.environ["SANDBOX_TESTS"]) or counts["failures"] or counts["errors"] or counts["skipped"]:
sys.exit("the sandbox e2e must be exactly %s tests, all passed: %s" % (os.environ["SANDBOX_TESTS"], counts))
PY
- name: What the root step left behind (diagnostic, decides nothing)
if: always()
run: |
echo "-- files owned by root under the runner's home and /tmp"; sudo find /home/runner /tmp -maxdepth 3 -user root 2>/dev/null | head -40 || true
echo "-- /etc/resolv.conf"; cat /etc/resolv.conf || true
echo "-- lo"; ip -4 addr show lo || true
# The leg ran with the pinned database, and the core never went past it to GitHub (tests/geoip_used.py wrote what it did).
- name: The leg ran with the pinned GeoIP database
if: always()
shell: bash
run: |
python scripts/ci_lab_geoip.py evidence --out "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" > /dev/null
python scripts/ci_lab_geoip.py verify --evidence "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" --used "$GEOIP_USED_OUT"
# Runs ONLY if the full run above fails, and before 2026-08-13 it could not
# exist: the hang was killed by the 40-minute ceiling, so the job came out
# `cancelled` and the following steps did not start at all. With
# `--timeout 420 --timeout-method thread` the process dies at 7 minutes and the
@@ -163,3 +271,111 @@ jobs:
path: ${{ runner.temp }}/e2e-watchdog.log
if-no-files-found: warn
retention-days: 14
# ``Control+A`` selects all in a field, on the PUBLISHED engine and the core this package pins, on Windows, where the keyboard of a real
# user is: the shortcut letter used to reach the browser as Control+Shift+A (invisible-core 63.66.0 fixes it). The e2e is red on the
# keyboard that held Shift for the capital A (tests/test_control_a_selects_all_in_a_field_e2e.py: 5 ways to press it x an <input> and a
# <textarea>, in-process and served to the stock Playwright client). Same gate as the Linux job: it is SKIPPED, with the reason in the
# summary, until the core is on the index, and it runs unchanged after; `workflow_dispatch` with `only: windows-control-a` runs it alone.
e2e-windows-control-a:
name: e2e (windows, Control+A)
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: windows-latest
timeout-minutes: 20
# `run:` blocks are PowerShell on Windows unless said otherwise (e2e-hunt.yml had a ParserError on its first launch there).
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install wrapper + test deps (the stock client is in the dev extra)
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
- name: Fetch the published firefox binary
run: echo "FF=$(python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The keyboard shortcut selects all (the browser opens on the runner's desktop, as in e2e-hunt.yml)
env:
PYTHONUNBUFFERED: "1"
run: INVPW_BINARY_PATH="$FF" python -u -m pytest -m e2e -p no:cacheprovider -v tests/test_control_a_selects_all_in_a_field_e2e.py
# THE SAME e2e ON WINDOWS (Federico, 12/11: every test of the product runs on Linux AND Windows; where Windows behaves
# differently the test adapts to the system). Before this, 562 of the 808 e2e had never run on Windows in any round. The census
# of 12/11 (run 43307193708) took ~50 minutes in one job, so the files are split in four parts (the sorted list, every fourth
# file: a split that does not move when a file is added elsewhere). Left out, by name, are the suites ci/required-suites.json
# declares `linux_only` (the reason is on the row); tests/test_every_suite_runs_on_linux_and_windows.py holds both together.
e2e-windows:
name: e2e (windows, part ${{ matrix.part }})
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true' && inputs.only != 'windows-control-a'
runs-on: windows-2022
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install wrapper + test deps (+ Playwright ONLY as a system tool)
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]"
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
# The GeoIP database made by the repository, as on the Linux run (no download, the same bytes every run).
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: The files of this part, without the linux_only suites
run: |
set -e
python -m pytest --collect-only -q -m e2e -o addopts= -p no:cacheprovider 2>/dev/null | grep "::" | cut -d: -f1 | sort -u > "$RUNNER_TEMP/e2e_files.txt"
python - "${{ matrix.part }}" "$RUNNER_TEMP" <<'PY'
import json, os, sys
part, tmp = int(sys.argv[1]), sys.argv[2]
rows = json.load(open("ci/required-suites.json", encoding="utf-8"))
left_out = [t for r in rows if r.get("linux_only") for t in r["tests"]]
files = [l.strip() for l in open(os.path.join(tmp, "e2e_files.txt")) if l.strip()]
files = [f for f in files if f not in left_out]
mine = [f for i, f in enumerate(files) if i % 4 == part - 1]
nodes = [t for t in left_out if "::" in t and t.split("::")[0] in mine]
open(os.path.join(tmp, "e2e_args.txt"), "w").write("\n".join(mine + ["--deselect=" + n for n in nodes]) + "\n")
print("%d e2e files, %d left out as linux_only, %d in part %d, %d node(s) deselected"
% (len(files) + len([t for t in left_out if "::" not in t]), len(left_out), len(mine), part, len(nodes)))
PY
- name: Run this part of the e2e
env:
PYTHONUNBUFFERED: "1"
INVPW_TEST_WATCHDOG_FILE: ${{ runner.temp }}/e2e-watchdog.log
run: |
mapfile -t ARGS < <(tr -d '\r' < "$RUNNER_TEMP/e2e_args.txt")
python -u scripts/run_e2e.py "$FF" "${ARGS[@]}"
- name: The leg ran with the pinned GeoIP database
if: always()
run: |
python scripts/ci_lab_geoip.py evidence --out "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" > /dev/null
python scripts/ci_lab_geoip.py verify --evidence "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" --used "$GEOIP_USED_OUT"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the hang evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-watchdog-windows-${{ matrix.part }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/e2e-watchdog.log
if-no-files-found: warn
retention-days: 14
@@ -0,0 +1,177 @@
# ─────────────────────────────────────────────────────────────────────────────
# encoding-stability-hunt.yml - HUNT ONLY, never merged: "same seed, same bytes" for the PNG of the canvas. Nothing of the product is changed.
#
# In scripts/hunt_page_bytes.py (seed 42, two launches of the same arm) 11 keys were not stable: the PNG (toDataURL, toBlob, convertToBlob) of the 2D
# scenes shapes, composite, image and text, of the OffscreenCanvas and of the WebGL 1 and 2 triangle. Their pixels (getImageData, readPixels), JPEG and
# WebP were stable. Questions, per key:
# - do the PIXELS differ, or only the encoding? (the probe's ENCODING MODE puts the pixels of the draw, the raw bytes of three toDataURL and three toBlob
# in one page, and the pixels the browser decodes from the first PNG; scripts/hunt_encoding.py reads the PNG chunks, inflates and unfilters the IDATs)
# - is the difference between two launches on one runner, and also between two runners? (a 2-leg matrix, windows-2022, max-parallel 2; the job
# `compare` reads both legs)
# - does it happen with the published invisible-playwright 0.52.0 (its own venv, its own binary), and with stock Playwright's firefox (headed and
# headless)?
# - is the probe at fault? (anything time-, random- or order-dependent in what it draws: three calls on the same canvas in the same page say so)
# The arms: ours (this checkout's wrapper with the published binary of the job), ours_pypi052, stockheaded, stockheadless and, from the second run,
# `retail` (Mozilla's Firefox 159.0 installer, checked against its SHA256SUMS, launched by hand: subprocess, -no-remote, a fresh profile, no automation);
# two launches each.
#
# FINDING OF THE FIRST RUN (43652292507), read again with a parser that checks the PNG against the specification: the pixels, the filter and the deflate
# stream of every PNG are identical between two launches, between two runners, in every arm. The ONE difference is a 16-byte ancillary chunk `deBG` after the
# IDATs (16 hex characters, plus its CRC): upstream Mozilla's nsPNGEncoder::MaybeAddCustomMetadata (image/encoders/png/nsPNGEncoder.cpp, the four letters
# are set one by one, which is why `git grep deBG` finds nothing), keyed by the session's fingerprinting randomization key. The core turns
# privacy.baselineFingerprintingProtection on to match retail 151 (invisible_core/prefs.py). What this run adds: does retail 159 write it, and with a
# different value in every launch?
# ─────────────────────────────────────────────────────────────────────────────
name: encoding stability hunt
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_encoding.py
- scripts/hunt_page_bytes_probe.js
- .github/workflows/encoding-stability-hunt.yml
workflow_dispatch:
permissions:
contents: read
actions: read
concurrency:
group: encoding-stability-hunt-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, leg ${{ matrix.leg }} - PNG stability: ours, PyPI 0.52.0, stock headed and headless)"
runs-on: windows-2022
timeout-minutes: 40
strategy:
fail-fast: false
max-parallel: 2
matrix:
leg: [A, B]
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper of this checkout, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: The PNG parser against PNGs whose chunks are known
run: python scripts/hunt_encoding.py selftest
- name: "Retail Firefox 159.0 (Mozilla's installer, checked against SHA256SUMS, unpacked with 7-Zip)"
continue-on-error: true
run: python -u scripts/hunt_first_run.py fetch-retail --out "$RUNNER_TEMP/retail"
- name: Install the PUBLISHED invisible-playwright 0.52.0 in its own venv, and fetch its own binary
continue-on-error: true
run: |
python -m venv "$RUNNER_TEMP/pypi052"
"$RUNNER_TEMP/pypi052/Scripts/python" -m pip install --upgrade pip
"$RUNNER_TEMP/pypi052/Scripts/python" -m pip install "invisible-playwright==0.52.0"
"$RUNNER_TEMP/pypi052/Scripts/python" -m pip list 2>/dev/null | grep -i -E "invisible|playwright"
echo "FF052=$(cd "$RUNNER_TEMP" && "$RUNNER_TEMP/pypi052/Scripts/python" -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: "Arm ours (this checkout's wrapper, the job's binary), 2 launches"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_encoding.py collect --client ours --label ours --binary "$FF" --out "$RUNNER_TEMP/enc/${{ matrix.leg }}"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Arm ours_pypi052 (invisible-playwright 0.52.0 from PyPI, its own binary), 2 launches"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
echo "binary of 0.52.0: ${FF052:-<none>}"
"$RUNNER_TEMP/pypi052/Scripts/python" -u scripts/hunt_encoding.py collect --client ours --label ours_pypi052 ${FF052:+--binary "$FF052"} --out "$RUNNER_TEMP/enc/${{ matrix.leg }}"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Arm stockheaded (stock Playwright firefox, headless=False), 2 launches"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_encoding.py collect --client stock --label stockheaded --out "$RUNNER_TEMP/enc/${{ matrix.leg }}"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Arm stockheadless (stock Playwright firefox, headless=True), 2 launches"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_encoding.py collect --client stock --label stockheadless --headless --out "$RUNNER_TEMP/enc/${{ matrix.leg }}"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Arm retail (Mozilla's Firefox 159.0 launched by hand, no automation), 2 launches"
if: always()
continue-on-error: true
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_encoding.py collect --client retail --label retail --retail-from "$RUNNER_TEMP/retail" --out "$RUNNER_TEMP/enc/${{ matrix.leg }}"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Per-key table of this runner (two launches, three calls in one page)"
if: always()
continue-on-error: true
run: python -u scripts/hunt_encoding.py table "$RUNNER_TEMP/enc/${{ matrix.leg }}" | tee "$RUNNER_TEMP/enc/${{ matrix.leg }}/table.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the raw probe results of this runner
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: encoding-stability-${{ matrix.leg }}
path: ${{ runner.temp }}/enc/${{ matrix.leg }}
if-no-files-found: warn
retention-days: 14
compare:
name: "hunt (compare the two runners)"
needs: hunt
if: always()
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: The PNG parser against PNGs whose chunks are known
run: python scripts/hunt_encoding.py selftest
- name: Download both legs
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
for leg in A B; do
gh run download "${{ github.run_id }}" --repo "${{ github.repository }}" -n "encoding-stability-$leg" -D "enc/$leg" || echo "leg $leg: no artifact"
done
ls -R enc | head -40
- name: "Per-key table: same runner and across the two runners"
continue-on-error: true
run: python -u scripts/hunt_encoding.py table enc/A enc/B | tee enc/table-two-runners.txt
- name: Upload the table
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: encoding-stability-table
path: enc/table-two-runners.txt
if-no-files-found: warn
retention-days: 14
+175
View File
@@ -0,0 +1,175 @@
# ─────────────────────────────────────────────────────────────────────────────
# first-run-hunt.yml - HUNT ONLY, never merged. Nothing of the product is changed. Starts on its own paths only: the two other hunts running on this
# branch (cpu-render-path-hunt-vm.yml, encoding-stability-hunt.yml) are not restarted by it, and it is not restarted by them.
#
# In ours with a fresh profile the parent shows a ~15 s CPU burst between +8 and +50 s after the launch, with these downloads: remote settings 18.9 MB,
# CRLite 6 MB, safebrowsing 8.5 MB, Widevine 23 MB, the newtab xpi; after that it drops to zero.
# Part 1 (scripts/hunt_first_run.py census): does retail Firefox 159.0 (Mozilla's installer, verified against its SHA256SUMS, launched by hand with
# subprocess: -no-remote, a fresh profile, an idle local page, no automation, no Playwright) show the same burst, with the same duration and the
# same downloads? 80 s, slices of 10 s: the parent's CPU, the parent's CPU per thread name, the files written in the profile (path and size; the
# directories gmp-*, security_state, safebrowsing, settings, features listed), the bytes the network interfaces received and sent. Ours (fresh
# profile) in the same table.
# Part 2 (scripts/hunt_first_run.py probe): what can a PAGE read of that state? ours with a fresh profile, ours with a used one, retail fresh, retail
# used (launched a second time on the profile of part 1), probed at +5, +20, +40 and +90 s: requestMediaKeySystemAccess for Widevine, ClearKey and
# PlayReady (outcome, time to resolve, the configuration returned), MediaCapabilities for encrypted and WebRTC H.264 configurations, the WebRTC codec
# lists (OpenH264 is a downloaded GMP), canPlayType, mediaDevices, plugins, permissions, storage, and whether three hosts are reachable/blocked.
# Each arm runs twice: `seq` (the four moments in one launch) and `late` (only +90 s: asking early may start a download).
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: first run hunt
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_first_run.py
- scripts/hunt_first_run_probe.js
- .github/workflows/first-run-hunt.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: first-run-hunt-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, first 80 s of a new profile: retail against ours; what a page reads of it)"
runs-on: windows-2022
timeout-minutes: 150
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper and psutil
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: "Retail Firefox 159.0 (Mozilla's installer, checked against SHA256SUMS, unpacked with 7-Zip), once"
continue-on-error: true
run: python -u scripts/hunt_first_run.py fetch-retail --out "$RUNNER_TEMP/fr/retail"
# ----------------------------------------------------------------------------------------------- part 1: the first 80 s of a new profile
- name: "1. Census, retail (fresh profile, 80 s; the profile is kept for part 2)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py census --arm retail --retail-from "$RUNNER_TEMP/fr/retail" --keep-profile "$RUNNER_TEMP/fr/profile-retail" --out "$RUNNER_TEMP/fr/census"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "1. Census, ours (fresh profile, 80 s)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py census --arm ours --binary "$FF" --out "$RUNNER_TEMP/fr/census"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "1. Table: retail and ours, slice by slice"
if: always()
continue-on-error: true
run: python -u scripts/hunt_first_run.py census-table "$RUNNER_TEMP/fr/census" | tee "$RUNNER_TEMP/fr/census/table.txt"
# ----------------------------------------------------------------------------------------------- part 2: what a page reads
- name: "2. Probe, ours_fresh, seq"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm ours_fresh --mode seq --binary "$FF" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, ours_fresh, late"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm ours_fresh --mode late --binary "$FF" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, ours_used, seq"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm ours_used --mode seq --binary "$FF" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, ours_used, late"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm ours_used --mode late --binary "$FF" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, retail_fresh, seq"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm retail_fresh --mode seq --retail-from "$RUNNER_TEMP/fr/retail" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, retail_fresh, late"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm retail_fresh --mode late --retail-from "$RUNNER_TEMP/fr/retail" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, retail_used, seq"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm retail_used --mode seq --retail-from "$RUNNER_TEMP/fr/retail" --profile "$RUNNER_TEMP/fr/profile-retail" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Probe, retail_used, late"
if: always()
continue-on-error: true
timeout-minutes: 12
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_first_run.py probe --arm retail_used --mode late --retail-from "$RUNNER_TEMP/fr/retail" --profile "$RUNNER_TEMP/fr/profile-retail" --out "$RUNNER_TEMP/fr/probe"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "2. Tables: per probe and moment, fresh against used, ours and retail"
if: always()
continue-on-error: true
run: python -u scripts/hunt_first_run.py probe-table "$RUNNER_TEMP/fr/probe" | tee "$RUNNER_TEMP/fr/probe/table.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: first-run-hunt-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/fr/census
${{ runner.temp }}/fr/probe
${{ runner.temp }}/fr/retail/retail.json
if-no-files-found: warn
retention-days: 14
+213
View File
@@ -0,0 +1,213 @@
# ─────────────────────────────────────────────────────────────────────────────
# msaa-hunt.yml - HUNT ONLY, never merged. Nothing of the product is changed: the prefs of the arm ours_nomsaa go through extra_prefs, from the hunt.
# Starts on its own paths only (the hunts running on this branch are not restarted by it, and it is not restarted by them).
#
# Measured: WebGL readPixels of 1024x1024 takes ~400 ms (p50) in ours and in ours_vmretail against ~89 ms in stock and in retail 159.
# Hypothesis: the multisample we force. GLContext.cpp:783-787 marks framebuffer_multisample unsupported on the Microsoft Basic Render Driver; the engine's hook at
# GLContext.cpp:799 (StealthDeclaredMultisample) turns it back on when webgl.msaa-samples > 0; the core sets webgl.msaa-samples=4 and webgl.msaa-force=true on Windows
# (invisible_core/prefs.py:1263-1264); so every readPixels of the default framebuffer resolves MSAA in software.
# Arms: ours, ours_nomsaa (webgl.msaa-samples=0, webgl.msaa-force=false from the hunt), stockheaded, retail 159.0 launched by hand (Mozilla's installer, checked against
# SHA256SUMS). Measured in each browser, in the page (scripts/hunt_msaa_probe.js): readPixels 1024x1024 (first, repeat p50, draw then 1 pixel) and toDataURL with
# antialias:true AND antialias:false in the same browser; a 256x256 scene with diagonal edges read back with readPixels and toDataURL, the edge pixels hashed apart from the
# interior ones, the antialiased pixels counted; getContextAttributes().antialias, SAMPLES, SAMPLE_BUFFERS, MAX_SAMPLES. Two rounds in reversed order. `facts` reads the
# multisample prefs back. Then the page-readable bytes of scripts/hunt_page_bytes.py (the 86-key diff), ours against ours_nomsaa.
# What retail does, from the sources, is in the docstring of scripts/hunt_msaa.py.
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: msaa hunt
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_msaa.py
- scripts/hunt_msaa_probe.js
- .github/workflows/msaa-hunt.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: msaa-hunt-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, MSAA and readPixels: ours, ours_nomsaa, stockheaded, retail)"
runs-on: windows-2022
timeout-minutes: 60
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper, psutil, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: "Retail Firefox 159.0 (Mozilla's installer, checked against SHA256SUMS, unpacked with 7-Zip)"
continue-on-error: true
run: python -u scripts/hunt_first_run.py fetch-retail --out "$RUNNER_TEMP/ms/retail"
# ------------------------------------------------------------------------------------------ the multisample prefs, read back (once per arm)
- name: "Facts, arm ours (effective webgl.msaa-* prefs, Troubleshoot)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py facts --arm ours --binary "$FF" --out "$RUNNER_TEMP/ms/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm ours_nomsaa (effective webgl.msaa-* prefs, Troubleshoot)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py facts --arm ours_nomsaa --binary "$FF" --out "$RUNNER_TEMP/ms/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm stockheaded (effective webgl.msaa-* prefs, Troubleshoot)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py facts --arm stockheaded --out "$RUNNER_TEMP/ms/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm retail (effective webgl.msaa-* prefs, Troubleshoot)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py facts --arm retail --retail-from "$RUNNER_TEMP/ms/retail" --out "$RUNNER_TEMP/ms/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
# ------------------------------------------------------------------------------------------ readPixels timing and the edges, two rounds
- name: "Round 1, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/ms/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm retail"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm retail --retail-from "$RUNNER_TEMP/ms/retail" --out "$RUNNER_TEMP/ms/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm ours_nomsaa"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm ours_nomsaa --binary "$FF" --out "$RUNNER_TEMP/ms/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm stockheaded"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm stockheaded --out "$RUNNER_TEMP/ms/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm stockheaded"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm stockheaded --out "$RUNNER_TEMP/ms/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours_nomsaa"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm ours_nomsaa --binary "$FF" --out "$RUNNER_TEMP/ms/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm retail"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm retail --retail-from "$RUNNER_TEMP/ms/retail" --out "$RUNNER_TEMP/ms/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 6
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_msaa.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/ms/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Table: timing, values, the edges pixel by pixel, what differs"
if: always()
continue-on-error: true
run: |
cp -r "$RUNNER_TEMP/ms/r0/"*-facts "$RUNNER_TEMP/ms/r1/" 2>/dev/null || true
python -u scripts/hunt_msaa.py table "$RUNNER_TEMP/ms/r1" "$RUNNER_TEMP/ms/r2" | tee "$RUNNER_TEMP/ms/table.txt"
# ------------------------------------------------------------------------------------------ the page-readable bytes, ours against ours_nomsaa
- name: "Page-readable bytes, arm ours (2 launches)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours --binary "$FF" --launches 2 --out "$RUNNER_TEMP/ms/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Page-readable bytes, arm ours_nomsaa (2 launches)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_page_bytes.py collect --arm ours_nomsaa --binary "$FF" --launches 2 --out "$RUNNER_TEMP/ms/pagebytes"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Page-readable bytes, ours against ours_nomsaa"
if: always()
continue-on-error: true
run: python -u scripts/hunt_page_bytes.py diff "$RUNNER_TEMP/ms/pagebytes" --a ours --b ours_nomsaa | tee "$RUNNER_TEMP/ms/pagebytes/diff.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: msaa-hunt-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/ms/r0
${{ runner.temp }}/ms/r1
${{ runner.temp }}/ms/r2
${{ runner.temp }}/ms/table.txt
${{ runner.temp }}/ms/pagebytes
if-no-files-found: warn
retention-days: 14
+4 -1
View File
@@ -51,9 +51,12 @@ on:
permissions:
contents: write
# A publishing workflow is never cancelled half-way: the second run waits for
# the first (a newer pending run replaces an older pending one, which is
# harmless: the wiki is rebuilt in full from the repository each time).
concurrency:
group: publish-wiki
cancel-in-progress: true
cancel-in-progress: false
jobs:
publish-wiki:
+21 -2
View File
@@ -15,7 +15,7 @@ name: publish
# convention.
#
# BEFORE THE FIRST RUN, on PyPI: Manage project -> Publishing -> add a GitHub
# publisher with owner `feder-cr`, repository `invisible_playwright`, workflow
# publisher with owner `oss-invisible`, repository `playwright`, workflow
# `publish.yml`, environment `pypi`. Until that exists the upload fails with
# `invalid-publisher`, which is the correct failure: nothing has said this
# workflow may speak for this project. Revoke the long-lived token AFTER the
@@ -196,8 +196,27 @@ jobs:
# code no job has run.
run: python -m pytest -q
# The three checks on the REAL GeoIP database, and only here (the release): the legs of the pull requests and of the gates launch with the database that
# scripts/ci_lab_geoip.py makes (a few networks, the same bytes every run, no download), so what only the real one can show is looked at once per release:
# the product's own road (no variable, cold cache, the latest database downloaded), the lab database against it for the six exits, and every
# time_zone of the database known to the runner's tz database. See the docstring of scripts/ci_real_geoip_check.py.
real-geoip-database:
needs: already-published
if: needs.already-published.outputs.present != 'yes'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install the wrapper (its core comes from the index)
run: python -m pip install -e . maxminddb
- name: The real GeoIP database - the product's road, the lab database against it, every zone known
run: python scripts/ci_real_geoip_check.py
upload:
needs: [already-published, gate]
needs: [already-published, gate, real-geoip-database]
if: needs.already-published.outputs.present != 'yes'
runs-on: ubuntu-latest
environment: pypi # the trust relationship lives HERE, behind the gate
+224
View File
@@ -0,0 +1,224 @@
# ─────────────────────────────────────────────────────────────────────────────
# readback-hunt.yml - HUNT ONLY, never merged. Nothing of the product is changed: the pref of the arm ours_noproj goes through extra_prefs, from the hunt.
# Starts on its own paths only (the hunts running on this branch are not restarted by it, and it is not restarted by them).
#
# Measured (43656857973): WebGL readPixels 1024x1024 repeat p50 is ~250-290 ms in ours, with or without MSAA, against 5-9 ms in stock and retail 159; toDataURL 1024 ~140-170 ms
# against 12-18. MSAA is not the cause. Suspect: the read-time canvas projection of the engine (the engine source tree): gfx/2d/StealthCanvasProjection.cpp StealthProjectPixels, applied to WebGL and
# WebGPU reads only (never to a 2D canvas), on when zoom.stealth.fpp.hw_seed > 0 and zoom.stealth.canvas.substitute_pixels is true (gfx/thebes/StealthDeclarationGate.h:54-62). Its cost is
# data-dependent: a pixel with a differing 4-neighbour builds a 3x3 neighbourhood and runs OnOneSegment (StealthCanvasProjection.cpp:89-129); the probes so far drew a ramp in which EVERY pixel is such an edge.
# Arms: ours, ours_noproj (zoom.stealth.canvas.substitute_pixels=false from the hunt), stockheaded, retail 159.0 launched by hand (Mozilla's installer, checked against SHA256SUMS).
# - timing, per content (flat, halves, triangle, gradient, noise), 1024x1024, antialias:false: WebGL readPixels and toDataURL, canvas 2D getImageData and toDataURL (the 2D canvas is never
# projected: if it is slow too, the cause is elsewhere); ms per MB; a hash of the bytes; two rounds in reversed order;
# - the 256x256 diagonal-edge scene with antialias:false, pixel by pixel: is the 1-level difference of ours against retail the projection (ours_noproj against retail)?
# - a Gecko profile with symbols of EVERY process and thread (MOZ_PROFILER_STARTUP_FILTERS=*) during 20 readPixels and 20 toDataURL of the gradient canvas, for ours and for ours_noproj:
# which process reads (content or GPU) and the top functions by self time (hunt_profile_summary.py, symbols as in hunt_fetch_symbols.py).
# Every step is continue-on-error: a hunt must give whatever it got.
# ─────────────────────────────────────────────────────────────────────────────
name: readback hunt
on:
push:
branches: [hunt/cpu-render-path]
paths:
- scripts/hunt_readback.py
- scripts/hunt_readback_probe.js
- .github/workflows/readback-hunt.yml
workflow_dispatch:
inputs:
symbols_run:
description: "Run id of the engine's release.yml whose symbols-win-x86_64 artifact matches the binary (empty: look through the recent runs)"
required: false
default: ""
permissions:
contents: read
concurrency:
group: readback-hunt-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
hunt:
name: "hunt (windows-2022, readPixels and toDataURL cost: ours, ours_noproj, stockheaded, retail; profile with symbols)"
runs-on: windows-2022
timeout-minutes: 60
defaults:
run:
shell: bash
env:
PYTHONUNBUFFERED: "1"
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with: { fetch-depth: 1 }
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: Install the wrapper, psutil, and stock Playwright with its firefox
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev]" psutil
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
python -m playwright install firefox
- name: Fetch the published firefox binary
run: echo "FF=$(cd "$RUNNER_TEMP" && python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
run: python scripts/ci_lab_geoip.py build
- name: "Retail Firefox 159.0 (Mozilla's installer, checked against SHA256SUMS, unpacked with 7-Zip)"
continue-on-error: true
run: python -u scripts/hunt_first_run.py fetch-retail --out "$RUNNER_TEMP/rb/retail"
# ------------------------------------------------------------------------------------------ the prefs, read back
- name: "Facts, arm ours (effective zoom.stealth.canvas.* and fpp.hw_seed)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py facts --arm ours --binary "$FF" --out "$RUNNER_TEMP/rb/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Facts, arm ours_noproj (effective zoom.stealth.canvas.* and fpp.hw_seed)"
if: always()
continue-on-error: true
timeout-minutes: 5
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py facts --arm ours_noproj --binary "$FF" --out "$RUNNER_TEMP/rb/r0"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
# ------------------------------------------------------------------------------------------ timing per content, two rounds
- name: "Round 1, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/rb/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm retail"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm retail --retail-from "$RUNNER_TEMP/rb/retail" --out "$RUNNER_TEMP/rb/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm ours_noproj"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm ours_noproj --binary "$FF" --out "$RUNNER_TEMP/rb/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 1, arm stockheaded"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm stockheaded --out "$RUNNER_TEMP/rb/r1"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm stockheaded"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm stockheaded --out "$RUNNER_TEMP/rb/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours_noproj"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm ours_noproj --binary "$FF" --out "$RUNNER_TEMP/rb/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm retail"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm retail --retail-from "$RUNNER_TEMP/rb/retail" --out "$RUNNER_TEMP/rb/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Round 2, arm ours"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py run --arm ours --binary "$FF" --out "$RUNNER_TEMP/rb/r2"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Table: cost per content and per MB, the 2D control, the bytes, the edge scene"
if: always()
continue-on-error: true
run: |
cp -r "$RUNNER_TEMP/rb/r0/"*-facts "$RUNNER_TEMP/rb/r1/" 2>/dev/null || true
python -u scripts/hunt_readback.py table "$RUNNER_TEMP/rb/r1" "$RUNNER_TEMP/rb/r2" | tee "$RUNNER_TEMP/rb/table.txt"
# ------------------------------------------------------------------------------------------ the Gecko profile, with symbols
- name: "Profile, arm ours (20 readPixels + 20 toDataURL of the gradient canvas, every process and thread)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py profile --arm ours --binary "$FF" --out "$RUNNER_TEMP/rb/profiles"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Profile, arm ours_noproj (the same, projection off)"
if: always()
continue-on-error: true
timeout-minutes: 8
run: |
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
python -u scripts/hunt_readback.py profile --arm ours_noproj --binary "$FF" --out "$RUNNER_TEMP/rb/profiles"
taskkill //F //IM firefox.exe //T > /dev/null 2>&1 || true
- name: "Symbols of our engine (artifact symbols-win-x86_64 of the engine's release.yml)"
if: always()
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
P="$RUNNER_TEMP/rb/profiles"
ID="$(python scripts/hunt_profile_summary.py "$P/ours" --ids | awk '$3=="xul.dll"{print $2}' | head -1)"
echo "breakpad id of our xul.dll in the profile: '$ID'"
if [ -z "$ID" ]; then echo "SYMBOLS: none (no id: no parent profile of ours)"; exit 0; fi
python scripts/hunt_fetch_symbols.py --id "$ID" --run "${{ inputs.symbols_run }}" --out "$RUNNER_TEMP/rb/symbols" | tee "$RUNNER_TEMP/rb/symbols.log"
- name: "Profile summary, ours: which process reads, top 20 functions by self time (content and GPU processes, every thread)"
if: always()
continue-on-error: true
run: |
P="$RUNNER_TEMP/rb/profiles/ours"
SYM=$(ls "$RUNNER_TEMP"/rb/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
python -u scripts/hunt_profile_summary.py "$P" ${SYM:+--symbols "$SYM"} --only tab,gpu --detail 3 --thread-table --threads 3 --top 20 | tee "$P/summary.txt"
- name: "Profile summary, ours_noproj (what is left when the projection is off)"
if: always()
continue-on-error: true
run: |
P="$RUNNER_TEMP/rb/profiles/ours_noproj"
SYM=$(ls "$RUNNER_TEMP"/rb/symbols/symbols-*.zip 2>/dev/null | head -1 || true)
python -u scripts/hunt_profile_summary.py "$P" ${SYM:+--symbols "$SYM"} --only tab,gpu --detail 3 --threads 3 --top 20 | tee "$P/summary.txt"
- name: Close every Firefox left
if: always()
shell: pwsh
run: |
Get-Process firefox -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
"left: " + @(Get-Process firefox -ErrorAction SilentlyContinue).Count
- name: Upload the results
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: readback-hunt-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/rb/r0
${{ runner.temp }}/rb/r1
${{ runner.temp }}/rb/r2
${{ runner.temp }}/rb/table.txt
${{ runner.temp }}/rb/profiles
${{ runner.temp }}/rb/symbols.log
if-no-files-found: warn
retention-days: 14
+27 -9
View File
@@ -15,9 +15,12 @@ permissions:
# cancelled one by one - which left the run marked failed even though nothing
# had actually failed. Keyed by workflow + ref so tests and e2e never cancel
# each other; only an older run of THIS workflow on the same branch is replaced.
# A newer push to a pull request cancels the run it supersedes. Never on main:
# outside a pull request the group is unique to the run (`github.run_id`), so
# every commit of main keeps its own finished run (see e2e.yml for why).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Engine and GeoIP downloads go through the release API with this token.
# Anonymous requests share a 60-an-hour limit per runner address and are the
@@ -170,15 +173,15 @@ jobs:
# untested until 2026-08-01, and the user who opened issue #51 was on
# 3.14. test_marker_vocabulary.py compares this list to the floor.
python: ["3.11", "3.12", "3.13", "3.14"]
# Windows runners are the scarce, 2x-cost, slow-to-schedule ones, and a
# burst of pushes queues them for a long time. Run the FULL Python range
# on ubuntu (cheap, fast) and cover Windows on 3.12 only - this is a
# pure-Python package, the OS-specific surface is tiny. The python LIST
# above stays complete so test_marker_vocabulary still sees every version.
# The FULL Python range on ubuntu; Windows on the two ends of the range,
# 3.11 and 3.14 (Federico, 12/11: every test on Linux AND Windows; the
# ends are where a version-specific difference shows first). The runners
# are free for this public repository; the account runs 20 jobs at once.
# The python LIST above stays complete so test_marker_vocabulary still
# sees every version.
exclude:
- { os: windows-latest, python: "3.11" }
- { os: windows-latest, python: "3.12" }
- { os: windows-latest, python: "3.13" }
- { os: windows-latest, python: "3.14" }
steps:
- uses: actions/checkout@v4
@@ -219,12 +222,27 @@ jobs:
run: |
python -m ruff check --select F821,F811,F601 --no-cache --output-format concise .
# The GeoIP database is made by the repository (scripts/ci_lab_geoip.py: the same bytes on every run, the sha256 in ci/geoip.json), never a
# site and never a licensed file: without STEALTHFOX_GEOIP_MMDB the core asks GitHub which database is the latest on every call
# (run 43211837926). The variable reaches every later step of the job.
- name: The GeoIP database (made by the repository, same bytes every run)
shell: bash
run: python scripts/ci_lab_geoip.py build
- name: Run pytest
shell: bash
run: |
set -o pipefail # or tee would swallow pytest's exit code
pytest tests/ -v --tb=short -rs | tee tests-report.txt
# The leg ran with the pinned database, and the core never went past it to GitHub (tests/geoip_used.py wrote what it did).
- name: The leg ran with the pinned GeoIP database
if: always()
shell: bash
run: |
python scripts/ci_lab_geoip.py evidence --out "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" > /dev/null
python scripts/ci_lab_geoip.py verify --evidence "$(dirname "$GEOIP_USED_OUT")/geoip-evidence.json" --used "$GEOIP_USED_OUT"
# This repo has the largest suite of the three and was the only one with
# no floor. pytest's exit code cannot distinguish "everything passed"
# from "the marker expression deselected everything", and `addopts`
+55 -27
View File
@@ -72,9 +72,11 @@ on:
permissions:
contents: read
# Only a new push to a ledger pull request cancels the run it supersedes. The
# weekly schedule and a manual run (both on main) never cancel each other.
concurrency:
group: user-install-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
install:
@@ -92,12 +94,12 @@ jobs:
- uses: actions/setup-python@v5
with: { python-version: '3.11' }
# Only what the TEST needs. The package under test is installed by the
# Only what the TEST needs (and `uv`, for the wait below to ask uv, which the release test installs the package with). The package under test is installed by the
# test itself, into a venv it creates, from the index - installing it
# here as well would put a second copy on the path and the assertions
# would be reading the wrong one.
- name: Test harness only
run: python -m pip install --upgrade pip pytest packaging
run: python -m pip install --upgrade pip pytest packaging uv
# PyPI does not serve a new version to pip the instant twine finishes, and
# this workflow runs on the ledger pull request, which the publish run
@@ -107,43 +109,69 @@ jobs:
# 0.2.5. The job reported a forgotten publish that had happened two minutes
# earlier, which is the most expensive kind of red: it looks exactly like the
# real defect this workflow exists to catch.
# MEASURED AGAIN 2026-11-12 (0.50.1, ledger #476): the per-version JSON endpoint
# of PyPI answered at once, `pip index versions` listed 0.50.1, and the
# `pip install --upgrade` of the Linux job still resolved 0.49.1 (the Windows job,
# started later, was green). Those are three different pages of the index, and
# the job only needs the one pip installs from.
#
# Bounded at five minutes, so a genuinely forgotten publish still fails. The
# PER-VERSION endpoint is the authority; the aggregate `info.version` lags it
# by minutes and has its own trap, so this asks for the exact URL.
# So the question asked here is the INSTALLERS' own, both: the upgrade test installs with pip, the release test with uv (the README's
# way in), so each round asks `pip download invisible-playwright==X` AND `uv pip compile` of it (no cache, nothing installed), and the
# job goes on only after three rounds in a row in which both said yes, 15 s apart (one yes proves that one request saw the version, not
# that the next is served by the same node of the index); a no restarts the count and a call that does not answer in two minutes is
# a no. Bounded at ten minutes: a forgotten publish still fails, and it fails HERE, saying that the index does not have the
# version, instead of three steps later as a test that compares two versions.
#
# Only on the ledger pull request. A scheduled or dispatched run is not
# racing anything, and a wait there would hide a real absence behind five
# racing anything, and a wait there would hide a real absence behind ten
# minutes of polling.
- name: wait for the index to serve this version
if: github.event_name == 'pull_request'
shell: bash
run: |
python - <<'PY'
import json, os, sys, time, tomllib, urllib.error, urllib.request
import os, subprocess, sys, tempfile, time, tomllib
dist = tomllib.load(open("pyproject.toml", "rb"))["project"]["name"]
version = tomllib.load(open("pyproject.toml", "rb"))["project"]["version"]
url = f"https://pypi.org/pypi/{dist}/{version}/json"
deadline = time.monotonic() + 300
n = 0
deadline = time.monotonic() + 600
deadline = min(deadline, time.monotonic() + float(os.environ.get("INDEX_WAIT_SECONDS", "600")))
poll = float(os.environ.get("INDEX_WAIT_POLL", "15"))
need = int(os.environ.get("INDEX_WAIT_CONFIRMATIONS", "3"))
call_limit = float(os.environ.get("INDEX_WAIT_CALL_SECONDS", "120"))
asks = [
("pip", [sys.executable, "-m", "pip", "download", "--no-deps", "--no-cache-dir", "--disable-pip-version-check", "--quiet",
"-d", tempfile.mkdtemp(), f"{dist}=={version}"], None),
("uv", [sys.executable, "-m", "uv", "pip", "compile", "-", "--no-deps", "--no-cache", "--quiet"], f"{dist}=={version}\n"),
]
def round_says():
"""An empty string when every installer resolves the version, else what the first that did not said."""
for tool, command, stdin in asks:
try:
r = subprocess.run(command, input=stdin, capture_output=True, text=True, timeout=call_limit)
except subprocess.TimeoutExpired:
return f"{tool} did not answer within {call_limit:.0f} s"
if r.returncode != 0:
return f"{tool} said: " + ((r.stderr.strip().splitlines() or [""])[-1])
return ""
n = streak = 0
said = ""
while True:
n += 1
try:
with urllib.request.urlopen(url, timeout=30) as r:
if json.load(r).get("urls"):
print(f"::notice::{dist} {version} is on the index (attempt {n})")
sys.exit(0)
except urllib.error.HTTPError as e:
if e.code != 404:
print(f"::warning::index returned HTTP {e.code}; not waiting further")
sys.exit(0)
except OSError as e:
print(f"index unreachable ({e}); retrying")
if time.monotonic() >= deadline:
print(f"::warning::{dist} {version} still not on the index after 300s; "
f"running the checks anyway so a real absence is reported")
said = round_says()
streak = 0 if said else streak + 1
if streak >= need:
print(f"::notice::pip and uv resolve {dist} {version} from the index, {need} rounds in a row (attempt {n})")
sys.exit(0)
time.sleep(10)
if time.monotonic() >= deadline:
minutes = int(float(os.environ.get("INDEX_WAIT_SECONDS", "600")) // 60) or 1
print(f"::error::the index does not have {dist} {version} yet, after {minutes} minutes "
f"and {n} attempts, {streak} of {need} rounds in a row ({said})")
sys.exit(1)
time.sleep(poll)
PY
- name: Linux runtime libraries for the browser
-111
View File
@@ -1,111 +0,0 @@
name: webrtc-e2e
# Live WebRTC realness check against the shipped patched binary.
#
# Manual (workflow_dispatch) on purpose: it needs a firefox-N binary that
# carries the WebRTC fixes (synthetic srflx in genuine nICEr form + the
# default-route fallback behind a proxy). Run it after publishing such a
# binary - it is the release gate for "WebRTC looks real behind a proxy".
# On this Linux runner an engine older than firefox-35 never gets the synthetic
# srflx behind a SOCKS proxy (the wildcard default-route probe, fixed in
# firefox-35): test_not_blocked_behind_tcp_only_socks skips on it, naming that
# defect, and the floor below turns the skip red. From firefox-35 on, a
# missing srflx fails the test itself.
#
# No external proxy provider, no credentials: the "behind a proxy" condition is faked by an
# in-process TCP-only SOCKS5 server (refuses UDP ASSOCIATE) and the egress IP
# is injected as an RFC 5737 TEST-NET address. Fully self-contained.
on:
workflow_dispatch:
permissions:
contents: read
# Engine and GeoIP downloads go through the release API with this token.
# Anonymous requests share a 60-an-hour limit per runner address and are the
# ones GitHub drops first when it is degraded (2026-11-08: timeouts for
# unauthenticated users failed the gates three times). user-install.yml stays
# anonymous on purpose: it is the user's path.
env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
# `pip install -e ".[dev]"` below resolves `invisible-core==N.M.0` from the
# package index, and the core is published BEFORE this package. This gate
# answers whether it is there yet; during that window the realness job is
# SKIPPED with the reason in the run summary rather than faked green, and
# once the core is up it runs unchanged. See
# .github/workflows/core-on-index.yml.
core-on-index:
uses: ./.github/workflows/core-on-index.yml
webrtc-e2e:
name: webrtc realness (ubuntu, py3.12)
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install package + dev extras
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Fetch the patched Firefox binary and expose its path
shell: bash
run: |
# NOT `echo "VAR=$(cmd)" >> $GITHUB_ENV`. echo exits 0 whatever the
# substitution did, so `set -e` never sees a failure and an EMPTY
# value lands in the environment. Both tests below then hit
# `pytest.skip("no patched binary")`, pytest exits 0, and the job is
# green having verified nothing - which is exactly what run #1 did.
set -euo pipefail
FETCH_OUTPUT="$(python -m invisible_playwright fetch)"
printf '%s\n' "$FETCH_OUTPUT"
BIN="$(printf '%s\n' "$FETCH_OUTPUT" | tail -n 1)"
if [ -z "$BIN" ] || [ ! -e "$BIN" ]; then
echo "invisible_playwright fetch returned '$BIN', which is not a" >&2
echo "file. Refusing to run a suite that would skip itself green." >&2
exit 1
fi
echo "STEALTHFOX_E2E_BINARY=$BIN" >> "$GITHUB_ENV"
- name: Run WebRTC realness e2e (xvfb for the headless Firefox)
run: |
set -o pipefail
sudo apt-get update && sudo apt-get install -y xvfb
xvfb-run -a pytest tests/test_webrtc_realness.py -m e2e -o addopts="" -v -rs | tee webrtc-report.txt
# Run #1 was GREEN with the headline assertion skipped: "1 passed, 1
# skipped", and the skipped one is the test this workflow's own header
# calls the point of the gate. pytest's exit code cannot tell that from a
# pass, and this file was the only one of four without a floor.
- name: Refuse a run whose main assertion did not execute
shell: bash
run: |
python - <<'PY'
import pathlib, re, sys
text = pathlib.Path("webrtc-report.txt").read_text(encoding="utf-8", errors="ignore")
passed = int((re.search(r"(\d+) passed", text) or [0, 0])[1] or 0)
skipped = int((re.search(r"(\d+) skipped", text) or [0, 0])[1] or 0)
if skipped:
print("these tests SKIPPED, so the gate verified less than it "
"claims:", file=sys.stderr)
for line in text.splitlines():
if line.startswith("SKIPPED"):
print(" " + line, file=sys.stderr)
if passed < 2 or skipped:
print(f"{passed} passed / {skipped} skipped - this gate exists for "
f"the synthetic-srflx assertion; a run that skips it is not "
f"a pass.", file=sys.stderr)
sys.exit(1)
print(f"{passed} tests ran, none skipped")
PY
+283 -17
View File
@@ -6,6 +6,271 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
## [0.52.0] - 2026-11-14
### Changed
- Pins invisible-core 64.71.0 and with it the engine firefox-64. A request a page causes now leaves in the context of that
page, by that context's proxy and resolver: the name of a TURN server over TCP, the OCSP request of a certificate, the TLS
over a tunnel, the Safe Browsing completion of a page load. Nothing of a context with a proxy goes out DIRECT when a proxy
lookup fails or the context has just closed. On Linux the profile lock no longer looks up the machine's host name.
- Typing: each key is sent at its planned time measured from the start of the action, so a late reply no longer shifts the
keys after it, and the engine delivers each key at once with its event born the declared latency in the past. Measured
against stock Playwright Firefox, 20 runs per cell, slip of the last key against the plan (median): Windows 635 ms before,
6 ms now (stock 122); Linux 554 ms before, -5 ms now (stock 91).
### Fixed
- Screencast: a frame that arrives while the start of the screencast is being answered is held and acknowledged,
not dropped, so the stream no longer dies from its first frame (the engine keeps one frame in flight and waits for its
acknowledgement).
- No thread is started on the engine connection's reader any more (the adoption of a new page and the file chooser hand
their work to one long-lived starter). On Windows under load a Thread.start there held every event behind it; without
instrumentation, goto(..., wait_until="networkidle") on pages that replace themselves missed 1 in 1200 instead of 4.
### Tests
- The suites "nothing of a context leaves but through its proxy" (a witness of every direct arrival, the engine's resolver
log as the sink of native lookups), on Linux and Windows, including two contexts with their own proxies at once and a
PeerConnection of a torn-down window.
- Windows: the isolated-page test moves the page when the test says so instead of on a 500 ms timer; the sandbox test
reads again a process that is still starting.
## [0.51.1] - 2026-11-13
### Changed
- Pins invisible-core 63.68.0 (core fixes on the same firefox-63 engine: two sessions starting together on Windows no longer fail on the shared font-manifest cache; no MOZ_*, GL or toolkit variable of the host reaches the engine; GitHub is asked for the latest GeoIP database once a day, not on every launch; mouse moves carry the pressed buttons; a CORS preflight does not count for networkidle).
- The project moved to the oss-invisible GitHub organization: every GitHub link, the issue templates and the package URLs point to github.com/oss-invisible/playwright. The PyPI name and the import name do not change; the old addresses redirect.
### Fixed
- A popup (a `window.open` or a `target=_blank` link) could be handed to the client at `about:blank`, with the blank page's `load`, when it
was opened with no route on the context: the commit of its address, or its `DOMContentLoaded` and `load`, arrived while the page was being
handed from its buffer to its dispatcher and was told to nobody (`page.url` stayed `about:blank`, or `wait_for_load_state("load")` timed
out). Measured on Windows with the library's client in the same process, `test_popups_reach_the_client_e2e.py` x20 on 4 workers: 3 runs
red with the published firefox-62 engine and 11 with firefox-63. The page is now handed over in one step: what the client was not told is
said once, in order, and nothing the engine sent in that period is lost.
- The same hand-over dropped every event that is not a request: a `console` message, a `pageError`, a `dialog` (an `alert()` that opened
while the popup was being built blocked its page for good, because no client had been told of it and none could answer it), a `crash`, a file chooser. All
of them are given back now, in the order they arrived. The only bound left is the memory of the buffer (512 events): an event beyond it is
lost and a `RuntimeWarning` says how many, once per page.
- The hand-over holds when the engine's reader, the adoption and a close run at the same time: a `load` is told to the client once (not twice,
so `page.on("load")` runs once); an event the engine sends while the held ones are being given back waits for them (a response is never handled
before its request); a document committed at the same address as the previous one is told; a page closed while it was being adopted is not given
frames, and is not announced, after its `__dispose__`; one frame never gets two dispatchers.
- A popup could still be handed to the client at `about:blank` (or with its navigation pending again, and "Execution context was destroyed" in its
first evaluate) when the destination committed while the events the page had missed were being replayed to it: the engine's reader went on
delivering the live events to the lifecycle, and the replay then brought older ones after them. The page now subscribes its readers and is
handed the missed events in one step, with the delivery of the sessions' events held, so a live event never overtakes the replay.
With the three corrections together, on Windows with the library's client in the same process, under load: 680/680 and 256/256 popup cases
green (run 43261858525).
- `Control+A` selects all in an `<input>` and a `<textarea>` on Windows, on the published engine and the core this package pins: a new end-to-end
test (five ways to press the shortcut, in-process and served to the stock client), run by `e2e.yml` on Windows, 20/20 green (run 43262320744).
- Tests only: the e2e tests of the test servers take their ports from one sequence (no two servers draw the same one); the two tests that read a
consecutive pair of host ports run alone, after the parallel tests; the sandbox e2e (the browser's seccomp filter) runs in a step of its own that
turns unprivileged user namespaces on, and is left out of the normal run; every leg launches with a GeoIP database the repository builds (same
bytes every run, no download); the CodeQL alerts of the test code are fixed; the install job waits for the package index through both installers;
the raw Juggler tests wait for `Page.ready` and the main frame instead of a fixed time.
## [0.51.0] - 2026-11-12
### Changed
- Engine firefox-63 through invisible-core 63.67.0, which this version pins (63.67.0 is 63.66.0 with the protocol mirror regenerated from the published engine; the mirror of 63.66.0 differed from it). Behind a proxy: names are resolved by the browser's own
DNS-over-HTTPS through the proxy (not by the machine's resolver; checked with a resolver trap on Linux), WebRTC and HTTP/3 send
their UDP through the proxy's relay when its UDP was measured to leave from the same address as its TCP, and a proxy whose UDP
does not hold (including one whose UDP leaves from another address) is treated as a router that drops it (HTTP/3 falls back to
HTTP/2, ICE gathers no server-reflexive candidate). A proxy given to a context declares its own measured UDP exit. The interface
list WebRTC gathers is the network the session declares.
- Behind a SOCKS5 proxy the proxy now receives addresses, not names (the names are resolved by the DNS-over-HTTPS through it); a proxy
that cannot carry HTTPS to mozilla.cloudflare-dns.com resolves no name.
- A STUN server list can be given at launch (`udp_stun_servers`) for the measurement of the proxy's UDP.
- Every context carries the position the core declares for the session (the geolocation override of the context).
- The package's launcher and server refuse the two prefs that govern the launch counter, `invisible_firefox.usage_ping.enabled` and
`invisible_firefox.usage_ping.url`, in `extra_prefs` (and in the `firefoxUserPrefs` of a served launch). The engine counts launches with
an anonymous GET to the `usage-counter` release of the engine's repository (`oss-invisible/firefox_antidetect_patch`).
### Added
- `preload_newtab=False` turns off the preloaded New Tab page, on request only (`InvisiblePlaywright`,
`invisible_playwright.async_api.InvisiblePlaywright` and `launch_server`): by default the browser keeps it, as a retail Firefox does.
A retail Firefox keeps the New Tab page ready in a content process of its own; with the option it is not started. `None` writes
nothing, `True` says the retail value aloud, and a `browser.newtab.preload` in `extra_prefs` wins over it. Needs invisible-core
63.66.0 or later. Measured on Windows (run 43211271731), on an engine build of the firefox-63 candidate line (not the published engine), one
page of a site, five alternating runs: the browser's processes together take 448-454 MB as shipped and 231-239 MB with the option
(private memory 301-307 against 158-171 MB).
### Fixed
- A request the browser resumed and whose channel is replaced and cancelled before the replacement starts (a `fetch` with
`keepalive`, a beacon) is reported as failed, so it no longer keeps `networkidle` from arriving (engine firefox-63).
- A navigation the page overtakes (`location.replace`) ends, and the document that overtook it is told (engine firefox-63).
- A click in a frame under a CSS transform is mapped back to the point the frame shows, and a click in a frame scrolls the
element in even when its point is inside the main viewport (invisible-core 63.66.0).
- `request.resource_type` agrees with the pinned driver: a beacon is `beacon` and a CSP report is `cspreport` (it said `other`).
- A download whose finish is seen before its announcement is marked finished: `save_as`, `path` and `failure` used to wait for ever on it.
The early finishes the browser keeps are bounded (64) and forgotten with their context. (That the engine sends a finish before the
announcement is not proven; the path is defensive.)
- The opener kept for the downloads of a target whose adoption failed lives until the engine detaches the target, and none is
made for a target already detached.
- Tests only: the end-to-end tests that look at content processes ask for the processes of a site by its name and no longer compare two counts.
### Known differences from stock Playwright
What a script that drives the browser can observe, from the configuration of Playwright's own Firefox and of a retail Firefox (no
comparison run is saved). The result of a `window.open` (`null` or a window) is read by the page; the others are what the script sees.
- **A `window.open` from a script with no user gesture is blocked, as in a retail Firefox.** Playwright's own Firefox turns the popup
blocker off (`dom.disable_open_during_load` false in its `playwright.cfg`); a retail Firefox keeps it on, and so does this browser. So
`page.evaluate("window.open(url)")` returns `null` to the page and no `page` event comes; the same `window.open` from a click opens
the popup on both. To get stock's behaviour: open the popup from a click; or pass
`extra_prefs={"dom.disable_open_during_load": False}` for the session, knowing that a page then sees a browser that differs from a
retail Firefox.
## [0.50.1] - 2026-11-12
0.50.0 was tagged and never published: its end-to-end gate was red on two tests that counted processes.
0.50.1 is 0.50.0 with those tests corrected.
### Changed
- Engine firefox-62 through invisible-core 62.63.0, which this version pins: firefox-61 plus Fission
and the Juggler for frames in another process. When `goto` returns, the frames below have the
address of their first document (an iframe of another site used to be listed with an empty url
for a moment); a `goto` to the address the page is already at ends; a late event of a frame that
left the page no longer brings it back into `page.frames`.
- Fission: iframes of another site run in a content process of their own (isolation strategy 1,
`fission.autostart` on, four isolated content processes), as in retail Firefox on desktop. The
strategy comes from the invisible-core baseline of the firefox-62 engine, whose Juggler reaches a
frame in another process like any other. The tests that held strategy 0
(`tests/test_cross_origin_iframe.py`) now hold strategy 1, and the Fission end-to-end tests
(frame tree, element to frame, geometry, input, crash of an iframe process, identity of the
iframe and of its page) run on that engine.
### Fixed
- `goto(wait_until="networkidle")` arrives on a page that is reused for many addresses, and on a served browser whose
context routes every request, as with a stock Firefox. Two causes, both ours. A route answered after the browser had
already closed its request (a fetch the page aborted, an image it replaced, an iframe it removed, a beacon cancelled
with its document) came back to the client as an error, which the client kept for the whole connection and raised on the
next route command; that command was never sent, its request stayed held in the engine, and so on down the page. The
server now takes such an answer as done, whatever wording the engine gives it ("Cannot find request", or "NS_BINDING_ABORTED"
when the channel was cancelled while the answer was on its way), as Playwright's own server does. The same defect was found a month earlier by richardpowellus
(#351), on the favicon of the page a `goto` had just left; his test is part of this release. And the core counted the requests in flight
with one integer per page, never reset by a navigation, so one request whose end never arrived kept every later address
from going idle (invisible-core 62.64.0 keeps them by request id, per document, and does not keep the requests of a
frame that already left: a beacon sent at `pagehide` is announced after its frame is gone).
- A `goto` sent right after `new_page` is no longer "interrupted by another navigation to about:blank" on a loaded machine. The page was
handed to the caller as soon as its main frame was announced, while the engine had not yet committed the page's own initial
`about:blank`; a navigation answered before that commit lost to it. The page is now handed over when the engine says it is
ready (`Page.ready`), as Playwright's own page is (invisible-core 62.65.0, `Lifecycle.wait_for_page_ready`; a page closed before
it was ready ends the wait with an error at once).
- A launch that names no session (Playwright's own `BrowserType.launch` against the server) gets a
session composed the way `InvisiblePlaywright()` composes one: prefs, environment and, behind a
proxy, the egress the page reads as its WebRTC address. It used to come up with Mozilla's
defaults, and on Linux its first `new_page` failed with "Unexpected number of tabs in the new
window: 2".
- A frame that left the page (an iframe a script removed) answers a call with "Frame was
detached", as Playwright does, not "Target page, context or browser has been closed".
- `grant_permissions` uses the permission names of the engine. `geolocation` and `notifications` used
to reach the engine under the web names while it keeps a grant under `geo` and
`desktop-notification`, so a page of a context that had been granted geolocation and given a
position was still denied. The names are those of the Playwright client for this browser
(`geolocation`, `persistent-storage`, `push`, `notifications`, `screen-wake-lock`); any other name
raises `Unknown permission`, as it does there, and a grant with no origin is a grant for every
origin.
- The end-to-end tests that count content processes count the ones that host a site, not every content
process that is new. The engine keeps a pool of preallocated processes and refills it whenever it gets
to it, so a refill landing between two reads looked like a process the test had caused (a same-site
frame, a closed context with a service worker that never stops). Measured on firefox-62: a closed context
leaves no process of its site. On Linux the process is named by the site it hosts; elsewhere these
tests skip.
- A popup (a `target=_blank` link, `window.open`) reaches the client as it does with Playwright's own Firefox: when its
destination answers, with no limit of time, with the destination's address as its url, and with `load` reachable on
it. It used to be given up on after 20 s, could be announced with `about:blank` as its url, and about one in a
hundred was never announced. A destination that never becomes a page (a 204, a server that never answers) is not
announced, as on stock. Measured against stock destination by destination, with answers after 4 s and after 25 s: 18
cases of 18; and 128 popups announced of 128 across the two transports (the library client, a stock client over
`launch_server`).
- For a popup whose answer is a download, the opener's `download` event comes after the popup's `page` event, as on
stock. With little CPU the download could arrive and the page never be announced. Measured on a runner limited to
one CPU: 8 runs red of 10 before, 0 of 10 after.
### Known differences from stock Playwright
Measured against Playwright's own Firefox with the same script, on this version. None of them is a value a page
reads; they are what a script that drives the browser can observe.
- **The url of a popup that turns into a download.** A link or a `window.open` whose answer is an attachment gives, as on
stock, a `page` event, a `download` event on the opener, and a popup that closes at once. The popup's `url` at the `page`
event is `about:blank` here and the empty string on stock. Measured: 8 cases of 8 (link and `window.open`, the library
client and a stock client over `launch_server`), against 4 of 4 on stock.
- **The url of a frame of another site at the page's `DOMContentLoaded`.** A frame of another site runs in another process,
as in a retail Firefox, and commits its navigation after the page's `DOMContentLoaded`; stock Playwright keeps frames in
the page's process. So `frame.url` read right after `goto(..., wait_until="domcontentloaded")` can be the empty string.
After `load` it is always set. Measured, 30 runs each: after `load` the url was there 30 times here and 30 on stock; at
`DOMContentLoaded` once here and 30 times on stock. Wait for `load`, or for the frame's own navigation, before reading it.
- **A click takes longer with the library client.** From `click()` on a link to the `page` event of the popup it opens:
0.8 to 1.7 s more than stock with the library client, and the same as stock (within 0.1 s) with a stock client over
`launch_server`. Measured on 64 popups per transport and on destinations that answer after 4 s and after 25 s. The
same run with `humanize=False` was not measured.
- **Back and forward restore the page from the back-forward cache.** As in a retail Firefox, `go_back` and `go_forward`
bring the page back as it was; Playwright's own Firefox loads it again. So a script that runs when the page loads does
not run again here. Measured on a 17-step journey with the same script on both: on its three back and forward steps
the page's load-time requests were sent again on stock (6 beacons each) and not here (0, 2 and 0, the two being the
ones a page sends when it is left); every step ended on the same page, and the other 14 steps sent the same requests.
## [0.49.1] - 2026-11-10
### Changed
- Engine firefox-61 through invisible-core 61.62.0, which this version pins: firefox-60 plus four
fixes. A context that ends no longer leaves a content process behind when a service worker
that never stops keeps it alive (the engine kills the processes of the container that stay);
the shared font resources of a closed window leave WebRender's pool with it; `Page.screenshot`
empties its canvas on every way out; `Page.setEmulatedMedia` names the media features it
refuses, in English.
- A context route turns the context's cache off while it is active, as Playwright does.
### Fixed
- `page.request_gc()` works on a served browser. It sent the engine's `Heap.collectGarbage` on the
browser-level connection, whose handler does not have it, so every call failed with
`Handler for does not implement method "Heap.collectGarbage"`; it is now sent with the session
of the page, as the engine answers it.
## [0.49.0] - 2026-11-10
### Changed
- Engine firefox-60 through invisible-core 60.61.0, which this version pins: firefox-59 plus
the Juggler's memory fixes. A tab no longer keeps the documents it left alive (they used to
stay as detached windows after leaving the back/forward cache), and a main-frame navigation
drops the response bodies of the documents it left, as Chromium does: `response.body()` of
such a response raises the evicted error Playwright already returns for Firefox.
## [0.48.1] - 2026-11-10
### Added
- `launch_server`, `launch_server_async` and `RemoteServer` are importable from
`invisible_playwright`, and the README's "Serving one browser to many clients" has a
complete example: a server, and a Playwright for Python client that connects to its
`ws_endpoint`.
### Changed
- invisible-core 59.60.0, which this version pins. The browser never opens its crash
reporter: the launch environment carries `MOZ_CRASHREPORTER_DISABLE=1`, so an engine that
refuses a launch no longer leaves a "Crash Reporter" window on a Windows desktop.
- The e2e run stops at the first refusal of the engine instead of launching the browser for
every test (a change to the test suite, not to the package).
## [0.48.0] - 2026-11-10
### Added
- `launch_server()` serves one browser on a WebSocket to any Playwright client: the
Playwright initializer is the one of protocol 1.62, a call's timeout is read from its
metadata or its parameters, a Dialog is a protocol object, and the pointer's path is
drawn by the server, once, for every client.
### Changed
- Engine firefox-59 (Firefox 159.0), through invisible-core 59.59.0, which this version
pins. On Linux WebGL draws on the engine's own GL, never the host's, under X11 too, and
every extension the persona declares answers as on Windows. The same seed gives the same
pointer path, typing and persona on Python 3.11 to 3.14 (59.59.0 replaces the two builtins
that differ between versions).
- The server collects its oldest protocol objects as Playwright's does, with a lower limit
for `Request`, `Response` and `Route` (2000, not 10000; nothing younger than 10 seconds).
A program that holds more than 2000 requests or responses in hand for longer than 10
seconds gets "Target closed" on the oldest ones. `INVPW_GC_LIMITS` changes the limits.
- A closed context leaves nothing in the server's registry.
## [0.47.1] - 2026-11-08
### Changed
@@ -1023,7 +1288,7 @@ browser reads that decision.
`new_context` failed with `NS_ERROR_NOT_AVAILABLE`.
- **A routed request carries its body.** `request.post_data`,
`post_data_json` and `post_data_buffer` were None for every POST, in a route
handler and on the `request` event alike (feder-cr/invisible_core#90). The
handler and on the `request` event alike (oss-invisible/core#90). The
body is there whenever a route is set on the page or its context; without a
route it stays None, which keeps the engine from copying every POST body.
- **`go_back()` goes back over a page the script left without a gesture**,
@@ -2020,7 +2285,8 @@ browser reads that decision.
repository that builds and ships the engine. The engine's compiled default
says the same from the next build. Engines older than firefox-21 do not read
the pref and are not counted. To opt out of the ping, set
`invisible_firefox.usage_ping.enabled` to `False` in `extra_prefs`.
`invisible_firefox.usage_ping.enabled` to `False` in `extra_prefs`. (Since 0.51.0 this is no longer possible: the
counter cannot be turned off or redirected.)
- **The `browser launches` badge is back.** It was removed in 0.7.2 because the
counter behind it lived on a repository that had been deleted, so the badge
would have redrawn a frozen number every morning. The counter has lived on
@@ -2632,10 +2898,10 @@ browser reads that decision.
## [0.3.1] - 2026-07-13
### Fixed
- [#48](https://github.com/feder-cr/invisible_playwright/issues/48): Playwright 1.61 adds an `isMobile` field to the `Browser.setDefaultViewport` Juggler command that the FF150 binary does not accept, which kills the session. The range narrows from `>=1.40,<1.61` to the CI-tested 1.55.x (`>=1.55,<1.56`, single-sourced from `scripts/playwright_pin.txt`) so a fresh install always gets a compatible client. Widened again in 0.3.2, once `firefox-18` rebased onto Firefox 151.
- [#48](https://github.com/oss-invisible/playwright/issues/48): Playwright 1.61 adds an `isMobile` field to the `Browser.setDefaultViewport` Juggler command that the FF150 binary does not accept, which kills the session. The range narrows from `>=1.40,<1.61` to the CI-tested 1.55.x (`>=1.55,<1.56`, single-sourced from `scripts/playwright_pin.txt`) so a fresh install always gets a compatible client. Widened again in 0.3.2, once `firefox-18` rebased onto Firefox 151.
### Changed
- The patched-Firefox source repo is now `feder-cr/firefox_antidetect_patch` (it was `feder-cr/invisible_firefox`, a name the profile manager took over). Release notes, CI references and the release URLs the download tests mock all point at the new name; the binaries themselves are unchanged.
- The patched-Firefox source repo is now `oss-invisible/firefox_antidetect_patch` (it was `feder-cr/invisible_firefox`, a name the profile manager took over). Release notes, CI references and the release URLs the download tests mock all point at the new name; the binaries themselves are unchanged.
- The wrapper no longer injects the font-list / system-UI environment variables at launch: the binary ships its own font bundle and is self-contained on that front. The integration tests were adapted and the font-sampling tests dropped.
### Added
@@ -2685,7 +2951,7 @@ browser reads that decision.
## [0.1.8] - 2026-05-23
### Fixed
- [#20](https://github.com/feder-cr/invisible_playwright/issues/20): cross-origin iframes were unreachable from Playwright. `element_handle.content_frame()` returned `None`, `frame.evaluate()` threw cross-origin SOP errors, and `frame_locator(...).click()` timed out even with `force=True`. Root cause: FF150 defaults `fission.webContentIsolationStrategy=1` (`IsolateEverything`), which site-isolates every cross-origin iframe into a separate `webIsolated` content process even when `fission.autostart=False`. The parent's Juggler FrameTree then has a Frame placeholder with no docShell and no URL - every protocol op that needs to enter the iframe fails. Fix: pin `fission.webContentIsolationStrategy=0` (`IsolateNothing`) in the baseline prefs. The setting can be flipped back per session via `extra_prefs={"fission.webContentIsolationStrategy": 1}`.
- [#20](https://github.com/oss-invisible/playwright/issues/20): cross-origin iframes were unreachable from Playwright. `element_handle.content_frame()` returned `None`, `frame.evaluate()` threw cross-origin SOP errors, and `frame_locator(...).click()` timed out even with `force=True`. Root cause: FF150 defaults `fission.webContentIsolationStrategy=1` (`IsolateEverything`), which site-isolates every cross-origin iframe into a separate `webIsolated` content process even when `fission.autostart=False`. The parent's Juggler FrameTree then has a Frame placeholder with no docShell and no URL - every protocol op that needs to enter the iframe fails. Fix: pin `fission.webContentIsolationStrategy=0` (`IsolateNothing`) in the baseline prefs. The setting can be flipped back per session via `extra_prefs={"fission.webContentIsolationStrategy": 1}`.
### Added
- `tests/test_cross_origin_iframe.py`: 4 unit + 5 e2e regression sentinels for cross-origin iframe interaction. The e2e layer runs entirely offline against two local HTTP servers on `127.0.0.1` (two ports = two SOP origins) and covers `page.frames` URL tracking, `content_frame()`, `frame.evaluate()`, `frame_locator(...).locator(...)`, and end-to-end `dispatch_event("click")` for plain, sandboxed and titled iframes. A future FF upgrade or fingerprint A/B that flips the pref back to `1` will fail the suite before shipping.
@@ -2696,7 +2962,7 @@ browser reads that decision.
## [0.1.7] - 2026-05-21
### Fixed
- [#18](https://github.com/feder-cr/invisible_playwright/issues/18): Tab crash when running with `headless=True` on Windows on pages that trigger cross-process navigation. Two separate bugs that only manifested together: (1) the Chromium content sandbox at default level 6 puts content processes on `kAlternateWinstation`, but the wrapper hides the browser window on its own alt-desktop (`CreateDesktop` for headless on Windows). Mismatched desktops → cross-process navigations couldn't reparent windows → content process exits cleanly and Playwright fires `page.on('crash')`. (2) The canvas2d `getImageData` stealth spoof wrote to a read-only mapped `DataSourceSurface`. On GPU-backed canvases that memory is write-protected → segfault during the final `getImageData` at page unload. Wrapper now sets `security.sandbox.content.level=4` in the alt-desktop workaround set, and `firefox-7` ships the source fix that moves the noise to the JS array's writable backing buffer.
- [#18](https://github.com/oss-invisible/playwright/issues/18): Tab crash when running with `headless=True` on Windows on pages that trigger cross-process navigation. Two separate bugs that only manifested together: (1) the Chromium content sandbox at default level 6 puts content processes on `kAlternateWinstation`, but the wrapper hides the browser window on its own alt-desktop (`CreateDesktop` for headless on Windows). Mismatched desktops → cross-process navigations couldn't reparent windows → content process exits cleanly and Playwright fires `page.on('crash')`. (2) The canvas2d `getImageData` stealth spoof wrote to a read-only mapped `DataSourceSurface`. On GPU-backed canvases that memory is write-protected → segfault during the final `getImageData` at page unload. Wrapper now sets `security.sandbox.content.level=4` in the alt-desktop workaround set, and `firefox-7` ships the source fix that moves the noise to the JS array's writable backing buffer.
### Changed
- `BINARY_VERSION` bumped from `firefox-5` to `firefox-7`. `firefox-6` was rolled back when its partial fix turned out to be wrong (the iframe-burst hypothesis was a dead end; bisection in the evening found the real two-bug cause documented above).
@@ -2715,12 +2981,12 @@ browser reads that decision.
## [0.1.5] - 2026-05-20
### Fixed
- [#15](https://github.com/feder-cr/invisible_playwright/pull/15): `python -m invisible_playwright fetch` raised `RuntimeError: no SHA256 for firefox-150.0.1-stealth-linux-x86_64.tar.gz in checksums.txt` for every user because the parser kept the `*` binary-mode prefix that `sha256sum` writes in front of filenames. Now `.lstrip("*")` is applied to the key. Reporter + patch: [@LostBoxArt](https://github.com/LostBoxArt). Unrelated to the `firefox-N` binary; existing caches still work, only first-time fetches were broken.
- [#15](https://github.com/oss-invisible/playwright/pull/15): `python -m invisible_playwright fetch` raised `RuntimeError: no SHA256 for firefox-150.0.1-stealth-linux-x86_64.tar.gz in checksums.txt` for every user because the parser kept the `*` binary-mode prefix that `sha256sum` writes in front of filenames. Now `.lstrip("*")` is applied to the key. Reporter + patch: [@LostBoxArt](https://github.com/LostBoxArt). Unrelated to the `firefox-N` binary; existing caches still work, only first-time fetches were broken.
## [0.1.4] - 2026-05-20
### Fixed
- [#13](https://github.com/feder-cr/invisible_playwright/issues/13): every page that threw an uncaught JS error (e.g. bunny.net) crashed the Playwright client with `TypeError: Cannot read properties of undefined (reading 'url')`. Root cause: upstream Playwright Juggler added a required `location` field to the `Page.uncaughtError` event in the 2026-05-07 roll ([microsoft/playwright@c8604ec](https://github.com/microsoft/playwright/commit/c8604ecd97)); our fork was carrying the pre-roll schema in every `firefox-N` build. Fix matches upstream - Runtime.js builds the `errorLocation`, PageAgent.js forwards it on both worker and runtime error paths, Protocol.js declares the schema field. Reporter: [@dionorgua](https://github.com/dionorgua).
- [#13](https://github.com/oss-invisible/playwright/issues/13): every page that threw an uncaught JS error (e.g. bunny.net) crashed the Playwright client with `TypeError: Cannot read properties of undefined (reading 'url')`. Root cause: upstream Playwright Juggler added a required `location` field to the `Page.uncaughtError` event in the 2026-05-07 roll ([microsoft/playwright@c8604ec](https://github.com/microsoft/playwright/commit/c8604ecd97)); our fork was carrying the pre-roll schema in every `firefox-N` build. Fix matches upstream - Runtime.js builds the `errorLocation`, PageAgent.js forwards it on both worker and runtime error paths, Protocol.js declares the schema field. Reporter: [@dionorgua](https://github.com/dionorgua).
### Changed
- `BINARY_VERSION` bumped from `firefox-3` to `firefox-4`. JS-only change inside `chrome/juggler/`; `xul.dll` and `firefox.exe` are byte-identical to `firefox-3`.
@@ -2728,7 +2994,7 @@ browser reads that decision.
## [0.1.3] - 2026-05-19
### Changed
- `BINARY_VERSION` bumped from `firefox-2` to `firefox-3`. The new archives on both Windows and Linux are built from a clean clone of [feder-cr/firefox_antidetect_patch#stealth/150](https://github.com/feder-cr/firefox_antidetect_patch/tree/stealth/150) - the consolidated source-of-truth fork (renamed from `feder-cr/firefox`; the companion `feder-cr/firefox-stealth` patches repo was deleted, all patches now live as commits on top of `mozilla-firefox/firefox`).
- `BINARY_VERSION` bumped from `firefox-2` to `firefox-3`. The new archives on both Windows and Linux are built from a clean clone of [oss-invisible/firefox_antidetect_patch#stealth/150](https://github.com/oss-invisible/firefox_antidetect_patch/tree/stealth/150) - the consolidated source-of-truth fork (renamed from `feder-cr/firefox`; the companion `feder-cr/firefox-stealth` patches repo was deleted, all patches now live as commits on top of `mozilla-firefox/firefox`).
- The patched Firefox archive now ships the **proper C++ implementation** of `windowUtils.jugglerSendMouseEvent`, replacing the JS shim from 0.1.2.
### C++ fixes landed in this release
@@ -2739,7 +3005,7 @@ browser reads that decision.
- **C7 (partial)**: storage stub for `nsIDocShell.languageOverride`. Workaround `InvisiblePlaywright(locale="")` recommended until full BC FIELD port lands.
### Verified
- Both archives built from same source: feder-cr/firefox_antidetect_patch commit `68906f1f9c55`.
- Both archives built from same source: oss-invisible/firefox_antidetect_patch commit `68906f1f9c55`.
- Windows + Linux smoke suite green: launch, `ctx.new_page()`, `page.mouse.{move,down,up,click,wheel}`, `navigator.webdriver=false`, sannysoft 32/33 PASS.
- SHA256 published in `checksums.txt` on the `firefox-3` release.
@@ -2758,7 +3024,7 @@ browser reads that decision.
## [0.1.1] - 2026-05-18
### Fixed
- **Critical**: every `page.mouse.*`, `page.click(selector)`, `locator.click()`, `page.hover()`, `mouse.wheel()` failed on the patched Firefox 150 binary with `win.windowUtils.jugglerSendMouseEvent is not a function`. The Juggler JS was porting calls to a Playwright-specific C++ method that was never landed in the FF146→FF150 port; replaced with the Mozilla chrome-scope `win.synthesizeMouseEvent` helper which is present in FF150. Six call sites patched across `juggler/protocol/PageHandler.js` and `juggler/content/PageAgent.js`. Reporter: [@trob9](https://github.com/trob9) - [#9](https://github.com/feder-cr/invisible_playwright/issues/9).
- **Critical**: every `page.mouse.*`, `page.click(selector)`, `locator.click()`, `page.hover()`, `mouse.wheel()` failed on the patched Firefox 150 binary with `win.windowUtils.jugglerSendMouseEvent is not a function`. The Juggler JS was porting calls to a Playwright-specific C++ method that was never landed in the FF146→FF150 port; replaced with the Mozilla chrome-scope `win.synthesizeMouseEvent` helper which is present in FF150. Six call sites patched across `juggler/protocol/PageHandler.js` and `juggler/content/PageAgent.js`. Reporter: [@trob9](https://github.com/trob9) - [#9](https://github.com/oss-invisible/playwright/issues/9).
- `_linkedBrowser.scrollRectIntoViewIfNeeded()` is now guarded at both call sites in `PageHandler.js` (`dispatchMouseEvent` and `dispatchWheelEvent`) - the method is not present on the shipped FF150 `<browser>` element, so the unguarded call threw before the mouse event was dispatched.
### Added
@@ -2782,7 +3048,7 @@ browser reads that decision.
- SOCKS5 / SOCKS4 / HTTP / HTTPS proxy support with auth.
- Linux x86_64 and Windows x86_64 binary support.
[0.4.3]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.3
[0.4.3]: https://github.com/oss-invisible/playwright/releases/tag/v0.4.3
> The two oldest entries point at a COMMIT, not a tag: 0.1.0 and 0.1.1
> predate arriving on PyPI (the index starts at 0.3.5) and never had
> a tag. Creating one today is not harmless: `publish.yml` triggers
@@ -2790,8 +3056,8 @@ browser reads that decision.
> does not short-circuit, so a new tag could kick off a publish
> attempt. The commit is the same information without that risk.
[0.1.1]: https://github.com/feder-cr/invisible_playwright/compare/7a983e99c53fa1ec1a443651a4dd9de42258dc61...589c848e07a67c459969a2ddfb79851f48b10eff
[0.1.0]: https://github.com/feder-cr/invisible_playwright/commit/7a983e99c53fa1ec1a443651a4dd9de42258dc61
[0.4.4]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.4
[0.4.5]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.5
[0.4.6]: https://github.com/feder-cr/invisible_playwright/releases/tag/v0.4.6
[0.1.1]: https://github.com/oss-invisible/playwright/compare/7a983e99c53fa1ec1a443651a4dd9de42258dc61...589c848e07a67c459969a2ddfb79851f48b10eff
[0.1.0]: https://github.com/oss-invisible/playwright/commit/7a983e99c53fa1ec1a443651a4dd9de42258dc61
[0.4.4]: https://github.com/oss-invisible/playwright/releases/tag/v0.4.4
[0.4.5]: https://github.com/oss-invisible/playwright/releases/tag/v0.4.5
[0.4.6]: https://github.com/oss-invisible/playwright/releases/tag/v0.4.6
+7 -7
View File
@@ -4,9 +4,9 @@ Thanks for your interest in improving this project. Contributions are welcome vi
## Quick links
- **Bug or idea?** Open an [issue](https://github.com/feder-cr/invisible_playwright/issues/new/choose).
- **Bug or idea?** Open an [issue](https://github.com/oss-invisible/playwright/issues/new/choose).
- **Security issue?** Do **not** open a public issue - see [SECURITY.md](SECURITY.md).
- **The C++ patches** live in the companion repo [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch) (branch `stealth/151`). Bugs in fingerprint spoofing usually belong there.
- **The C++ patches** live in the companion repo [oss-invisible/firefox_antidetect_patch](https://github.com/oss-invisible/firefox_antidetect_patch) (branch `stealth/151`). Bugs in fingerprint spoofing usually belong there.
## Scope
@@ -16,7 +16,7 @@ This repository ships the **Python wrapper** (`invisible_playwright`) around a p
- The CLI (`invisible-playwright fetch`, `invisible-playwright version`)
- Tests, docs, examples, packaging
The fingerprint, the engine download and the browser protocol client are shared by every wrapper and live in [invisible_core](https://github.com/feder-cr/invisible_core).
The fingerprint, the engine download and the browser protocol client are shared by every wrapper and live in [invisible_core](https://github.com/oss-invisible/core).
Out of scope (belongs in `firefox_antidetect_patch`):
@@ -30,8 +30,8 @@ To *use* the package you do not need any of this: see [Install](README.md#instal
The steps below are for working on the code, with [uv](https://docs.astral.sh/uv/).
```bash
git clone https://github.com/feder-cr/invisible_playwright.git
cd invisible_playwright
git clone https://github.com/oss-invisible/playwright.git
cd playwright
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
@@ -66,9 +66,9 @@ CI must be green before merge.
Before opening, please:
- Search [existing issues](https://github.com/feder-cr/invisible_playwright/issues) - the bug may already be tracked.
- Search [existing issues](https://github.com/oss-invisible/playwright/issues) - the bug may already be tracked.
- Reproduce on the **latest release** if possible.
- Confirm the issue is in the Python wrapper, not the patched Firefox itself. If a fingerprint is leaking or a detector flags the browser, open the issue at `feder-cr/firefox_antidetect_patch` instead.
- Confirm the issue is in the Python wrapper, not the patched Firefox itself. If a fingerprint is leaking or a detector flags the browser, open the issue at `oss-invisible/firefox_antidetect_patch` instead.
Include:
+4198
View File
File diff suppressed because it is too large. Load diff
+76 -24
View File
@@ -1,17 +1,22 @@
<div align="center">
<picture>
<source media="(max-width: 374px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-small-dark.gif">
<source media="(max-width: 374px)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-small-light.gif">
<source media="(max-width: 1239px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-phone-dark.gif">
<source media="(max-width: 1239px)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-phone-light.gif">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-dark.gif">
<img alt="invisible_playwright, Playwright on an anti-detect Firefox. An animation: the two-line switch from Playwright, the fingerprint set inside the engine, a mouse that moves like a hand, and the bot tests it passes." src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/banner-light.gif" width="100%">
<source media="(max-width: 374px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-small-dark.gif">
<source media="(max-width: 374px)" srcset="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-small-light.gif">
<source media="(max-width: 1239px) and (prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-phone-dark.gif">
<source media="(max-width: 1239px)" srcset="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-phone-light.gif">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-dark.gif">
<img alt="invisible_playwright, Playwright on an anti-detect Firefox. An animation: the two-line switch from Playwright, the fingerprint set inside the engine, a mouse that moves like a hand, and the bot tests it passes." src="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/banner-light.gif" width="100%">
</picture>
<p align="center">
<a href="https://github.com/oss-invisible/playwright/blob/badges/counters/launches_daily.csv"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Foss-invisible%2Fplaywright%2Fbadges%2Fdocs%2Fbadges%2Flaunches.json&style=for-the-badge" alt="browser launches"></a>
<a href="https://github.com/oss-invisible/firefox_antidetect_patch/releases"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Foss-invisible%2Fplaywright%2Fbadges%2Fdocs%2Fbadges%2Fdownloads.json&style=for-the-badge" alt="engine downloads"></a>
<a href="https://github.com/oss-invisible/playwright/stargazers"><img src="https://img.shields.io/github/stars/oss-invisible/playwright?style=for-the-badge&logo=github&color=e8a317" alt="GitHub stars"></a>
</p>
<h3 align="center">Playwright gets caught by anti-bots and captchas.<br>
This one runs on an anti-detect Firefox with an undetected fingerprint, compatible with your existing Playwright code.</h3>
</div>
![invisible_playwright - 5/5 detection suites passed](https://raw.githubusercontent.com/feder-cr/invisible_playwright/7a8693c6b4386e9a84dd93bedc479ca8654482e1/docs/screenshots/hero.gif)
![invisible_playwright - 5/5 detection suites passed](https://raw.githubusercontent.com/oss-invisible/playwright/7a8693c6b4386e9a84dd93bedc479ca8654482e1/docs/screenshots/hero.gif)
## How it works
@@ -125,6 +130,50 @@ with InvisiblePlaywright(proxy=proxy) as browser:
Schemes supported: `socks5`, `socks4`, `http`, `https`. DNS is routed through the proxy by default, no local leak.
### Serving one browser to many clients
`launch_server()` serves one browser on a WebSocket to any Playwright client. Install the
extra that carries the WebSocket library with `uv add "invisible-playwright[remote]"`.
```python
# server.py
from invisible_playwright import launch_server
with launch_server(seed=42, headless=True) as server:
print(server.ws_endpoint) # ws://127.0.0.1:<port>/<secret>
input("serving, press Enter to stop")
```
```python
# client.py: any Playwright client; this one is Playwright for Python (uv add playwright)
import sys
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.firefox.connect(sys.argv[1]) # the address the server printed
page = browser.new_page()
page.goto("https://example.com")
print(page.title())
browser.close() # ends this client; the server's browser keeps running
```
The server listens on `127.0.0.1` with a random secret path; `host=`, `port=` and `path=` choose
another address. A client in another language (Node, Java, .NET, Go) connects to the same
address with the `connect` call of its own Playwright. The browser belongs to the server and
ends with `server.close()` (or with the `with` block).
On Linux, set `MALLOC_ARENA_MAX=2` in the environment of the process that runs it (glibc keeps a memory
arena per thread otherwise); the server already hands freed memory back with `malloc_trim`
(`INVPW_MALLOC_TRIM=0` turns that off).
The server keeps its protocol objects in a registry and, like Playwright's own server,
collects the oldest ones when a type grows past a limit (`__dispose__` with reason `gc`).
Its limits are Playwright's, except `Request`, `Response` and `Route`, which are 2000
instead of 10000, and nothing younger than 10 seconds is ever collected. A client that
keeps more than 2000 requests or responses in hand for longer than that gets "Target
closed" on the oldest ones; one that uses them inside its callback is not affected. Set
`INVPW_GC_LIMITS="Request=10000,Response=10000,Route=10000"` to get Playwright's numbers.
### Timezone
The browser timezone follows `timezone=`:
@@ -165,6 +214,11 @@ not carry raises, and the error lists the ones it does.
Full list of pinnable keys, how pinning interacts with the Bayesian sampler, and common patterns are in **[docs/pinning.md](docs/pinning.md)**.
### Launch counter
The engine counts launches with an anonymous GET to the `usage-counter` release of the engine's repository (`oss-invisible/firefox_antidetect_patch`) on GitHub. This package's launcher and server refuse the two prefs that govern it, `invisible_firefox.usage_ping.enabled` and `invisible_firefox.usage_ping.url`, in `extra_prefs`.
---
## CLI
@@ -184,15 +238,15 @@ invisible-playwright version # wrapper, core and engine versions, and where the
**If you would rather prompt than script.** This page is the engine, as a Python
library. Two ways to use it without writing code, both one line: from an MCP client
you already have (Claude Code, Claude Desktop, Cursor),
`claude mcp add stealth -- uvx aihawk`, see
[the MCP server page](https://github.com/feder-cr/AIHawk/wiki/mcp-server); or with an
`claude mcp add stealth -- uvx invisible-playwright-mcp`, see
[the MCP server page](https://github.com/oss-invisible/playwright_mcp/wiki/mcp-server); or with an
interface and a model included, needing only an OpenRouter key,
`uvx aihawk ui --openrouter-key sk-or-...`, see
[AIHawk](https://github.com/feder-cr/AIHawk). Same engine underneath, and the second
`uvx invisible-playwright-mcp ui --openrouter-key sk-or-...`, see
[invisible_playwright_mcp](https://github.com/oss-invisible/playwright_mcp). Same engine underneath, and the second
is a client of the first.
All of it reads better, and is searchable, in
**[the wiki](https://github.com/feder-cr/invisible_playwright/wiki)**,
**[the wiki](https://github.com/oss-invisible/playwright/wiki)**,
organised into four sections instead of one flat list:
- **[Documentation](docs/documentation.md)** -
@@ -230,10 +284,10 @@ read from its own documentation or from confirmed reverse engineering:
**The other pieces of this one.** The engine is the middle of three, and the
two around it are how most people reach it:
- **[invisible_core](https://github.com/feder-cr/invisible_core)** - seed to
- **[invisible_core](https://github.com/oss-invisible/core)** - seed to
fingerprint to preferences, plus proxy and geolocation. This package pins it.
- **[AIHawk](https://github.com/feder-cr/AIHawk)** - this engine as an MCP
server (`uvx aihawk`, for any client that brings its own
- **[invisible_playwright_mcp](https://github.com/oss-invisible/playwright_mcp)** - this engine as an MCP
server (`uvx invisible-playwright-mcp`, for any client that brings its own
model) and, in the same package, an interface with a model included, from
one command. The interface is a client of the server, with no private path
to the browser.
@@ -270,7 +324,7 @@ Two rules hold across everything below. Every value is decided **before a page c
ask**, inside the browser, so there is no JavaScript shim to find. And every value
comes from **one profile**, so no two surfaces contradict each other, which is how a
spoofed browser is usually caught. Source:
[feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch).
[oss-invisible/firefox_antidetect_patch](https://github.com/oss-invisible/firefox_antidetect_patch).
**Identity**
- `navigator`, the user agent and the client hints are derived together, so they cannot disagree: [does Playwright set navigator.webdriver](docs/does-playwright-set-navigator-webdriver.md), [client hints and Sec-Fetch](docs/client-hints-sec-fetch.md).
@@ -303,7 +357,7 @@ spoofed browser is usually caught. Source:
## License
MIT - see [LICENSE](https://github.com/feder-cr/invisible_playwright/blob/main/LICENSE). The patched Firefox binary is distributed under the MPL-2.0 (Firefox upstream license). The C++ patches against mozilla-central that produce that binary are at [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch).
MIT - see [LICENSE](https://github.com/oss-invisible/playwright/blob/main/LICENSE). The patched Firefox binary is distributed under the MPL-2.0 (Firefox upstream license). The C++ patches against mozilla-central that produce that binary are at [oss-invisible/firefox_antidetect_patch](https://github.com/oss-invisible/firefox_antidetect_patch).
---
@@ -315,14 +369,12 @@ This project is for educational purposes only. It is provided as-is, with no war
<p align="center">
Built by <a href="https://it.linkedin.com/in/federico-elia-5199951b6">Federico Elia</a>
&nbsp;<a href="https://it.linkedin.com/in/federico-elia-5199951b6"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/linkedin.svg" alt="LinkedIn"></a>
&nbsp;<a href="https://it.linkedin.com/in/federico-elia-5199951b6"><img src="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/badges/linkedin.svg" alt="LinkedIn"></a>
</p>
<p align="center">
<a href="https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml"><img src="https://github.com/feder-cr/invisible_playwright/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
<a href="https://github.com/feder-cr/invisible_playwright/blob/main/LICENSE"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/license.svg" alt="License: MIT"></a>
<a href="https://www.python.org/downloads/"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/python.svg" alt="Python 3.11+"></a>
<a href="https://github.com/feder-cr/firefox_antidetect_patch/releases"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/badges/firefox.svg" alt="Firefox 159.0"></a>
<img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/badges/docs/badges/launches.svg" alt="browser launches">
<a href="https://github.com/feder-cr/invisible_playwright/stargazers"><img src="https://raw.githubusercontent.com/feder-cr/invisible_playwright/badges/docs/badges/stars.svg" alt="GitHub stars"></a>
<a href="https://github.com/oss-invisible/playwright/actions/workflows/tests.yml"><img src="https://github.com/oss-invisible/playwright/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
<a href="https://github.com/oss-invisible/playwright/blob/main/LICENSE"><img src="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/badges/license.svg" alt="License: MIT"></a>
<a href="https://www.python.org/downloads/"><img src="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/badges/python.svg" alt="Python 3.11+"></a>
<a href="https://github.com/oss-invisible/firefox_antidetect_patch/releases"><img src="https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/badges/firefox.svg" alt="Firefox 159.0"></a>
</p>
+1 -1
View File
@@ -36,7 +36,7 @@ In scope:
Out of scope:
- Vulnerabilities in the patched Firefox source - report to [feder-cr/firefox_antidetect_patch](https://github.com/feder-cr/firefox_antidetect_patch/security/advisories/new)
- Vulnerabilities in the patched Firefox source - report to [oss-invisible/firefox_antidetect_patch](https://github.com/oss-invisible/firefox_antidetect_patch/security/advisories/new)
- Upstream Firefox / mozilla-central - report to Mozilla directly
- Third-party dependencies - report to those projects
+7
View File
@@ -0,0 +1,7 @@
{
"comment": "The GeoIP database every CI leg launches with (STEALTHFOX_GEOIP_MMDB): made by scripts/ci_lab_geoip.py, the same bytes on every run, no download and no licensed data. One record answers every public address that is not one of the lab's networks and not reserved (the runner's own egress address is not known in advance). To change it (a network, a field): change the table of the script and mmdb_sha256 here in one commit; `build` refuses to go on when they differ.",
"generator": "scripts/ci_lab_geoip.py",
"mmdb": "geoip-aio-all.mmdb",
"mmdb_sha256": "d02825fd0336afa72ad7b7573769f1d9efddea447133f99ae3008c56d5308929",
"mmdb_bytes": 2706
}
+13
View File
@@ -0,0 +1,13 @@
[
{"id": "wrapper.e2e.udp", "giro": "G2", "os": ["linux", "windows"], "min_tests": 43, "exact": true, "tests": ["tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_declared_host_network_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all"], "marker": "e2e", "needs_root": false, "note": "Needs the candidate binary (STEALTHFOX_E2E_BINARY) and the engine that carries the UDP line. 57 = 1+7+6+1+21 from the five files + 21 from the 10 UDP-line tests of test_webrtc_realness.py (parametrized). The chain by name is here in its variant with the lab's exit on loopback (127.0.0.2) and the pref `media.peerconnection.ice.loopback`, on Linux and Windows: the exit of the lab is loopback, and a loopback mapped address is thrown away by nICEr unless the ICE context allows it. The variant without the pref (an exit that is not loopback) is the suite wrapper.e2e.udp.exit, Linux only; the address added to the interface of the Windows runner is work of the release after firefox-63. The preload_newtab test (2) is here: seen green on Linux as root (Docker) and on Windows 10 runs of 10 (windows-2022, round 5 engine); it reads the engine's own process log."},
{"id": "wrapper.e2e.udp.exit", "giro": "G2", "os": ["linux"], "min_tests": 7, "exact": true, "tests": ["tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick", "tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Linux only, and not collected on Windows: the exit of the lab is a documentation address (198.51.100.9) added to lo with `ip addr add`, which needs root and iproute2; a mapped address in 127/8 would be thrown away by nICEr as bogus (stun_client_ctx.cpp nr_stun_transport_addr_check) and the pref that allows it is off in a product. The page reads a srflx equal to the gateway exit and the relay of the TURN server, the TURN name resolved by the DoH through the proxy, in the tick of 2 s. On the Windows runner of GitHub (administrator, the network of the runner) it could run too: not yet. A skipped test would turn the verdict red, hence a suite of its own. Its twin with the lab's exit on loopback and the pref stays in wrapper.e2e.udp on both systems, so that Windows keeps the walk of the chain by name.", "linux_only": "The lab's exit is a documentation address the host must hold besides its loopback (nICEr throws away a mapped address in 127/8). Linux holds it on lo as root; Windows takes no extra address on its loopback pseudo-interface, and adding it to the runner's adapter took the runner off the network (runs 43314251547 and 43334169682 died in the test step). A Windows twin waits for a way that leaves the runner's network alone."},
{"id": "wrapper.e2e.udp.sandbox", "giro": "G2", "os": ["linux"], "min_tests": 13, "exact": true, "tests": ["tests/test_the_socket_process_is_sandboxed_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_a_gateway_without_udp_resolves_the_ice_name_then_ends_in_701"], "marker": "e2e", "needs_root": false, "note": "The browser WITH its sandbox, run by a normal user, as on any Linux that allows user namespaces. On the Ubuntu 24.04 runner AppArmor refuses them to a user, so every other non-root suite runs a browser WITHOUT the sandbox of its socket and content processes; the gate turns the restriction off for this leg (sysctl kernel.apparmor_restrict_unprivileged_userns=0) and the first test fails unless the socket and a tab process have a seccomp filter (Seccomp: 2). The three situations of the UDP line: A (a proxy that carries UDP: the srflx born through the relay), B (no proxy: the gather is real), C (a proxy with no UDP: the ICE server name goes by DoH through the proxy and the gather ends in 701). No root and no resolver trap needed.", "linux_only": "It reads the seccomp filter of the socket and tab processes in /proc. The Windows twin reads the sandbox token of the same processes (integrity level, restrictions) and needs a measurement of the retail Firefox's tokens first; until then Linux only."},
{"id": "wrapper.e2e.web", "giro": "G2", "os": ["linux", "windows"], "min_tests": 27, "exact": true, "tests": ["tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_http3_through_the_proxy_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The networkidle e2e with routes and the HTTP/3 e2e, split from wrapper.e2e.udp (about 260 s of 500 on Linux; the whole suite did not fit the 15 minutes of Windows)."},
{"id": "wrapper.e2e.doh", "giro": "G2", "os": ["linux", "windows"], "min_tests": 19, "exact": true, "tests": ["tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_ice_names_by_the_context_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Linux needs root: the resolver trap of the file (ResolverTrap) points /etc/resolv.conf at a counting resolver on port 53. Su Windows il resolver trap non gira: l'asserzione sul resolver di sistema è l'unica omessa. Run it without xdist (port 53 is one per host). On the Linux leg the gate exports INVPW_REQUIRE_TRAP=1: a trap that cannot run or bind port 53 is a failure, not a skipped assertion."},
{"id": "wrapper.e2e.context.egress", "giro": "G2", "os": ["linux", "windows"], "min_tests": 14, "exact": true, "tests": ["tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Taken from the minimal-engine port (branch tests/minimal-port) unchanged but for the removed engine gate: 12 = 6 kinds of page work (hints, image/fetch/WebSocket/EventSource, WebRTC STUN and TURN-udp by name, geolocation, a service worker with push, a page still loading when its context closes) x 2 schemes (no proxy at launch and a gateway on the context; a launch gateway and a different one on the context), and 2 = the TURN server named over TCP in those two schemes. EXPECTED RED on the published firefox-63: the 2 TURN-by-name cases (the lookup of the TCP socket takes user context 0; fixed by commits ac0214bff4 and 058edd6cc6 of firefox-64). The 12 have not run on any engine yet. Like wrapper.e2e.doh: the Linux leg runs as root for the resolver trap (INVPW_REQUIRE_TRAP=1); on Windows the DoH log and the gateway's CONNECTs are the sink."},
{"id": "wrapper.e2e.context.sink", "giro": "G2", "os": ["linux", "windows"], "min_tests": 35, "exact": true, "tests": ["tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The behavioural half of the class gate 'nothing of a context leaves but through its proxy', with a witness at an address of this host (no root, no address on lo) and the engine's own resolver log as the native-lookup sink. 35 = 31 + the 4 OCSP cases; the 31 are 19 probes (fetch, WebSocket, stun, turn over UDP, turn and turns over TCP, each by name, by IP and by a .local name, behind SOCKS5 and behind an HTTP proxy where the road differs) + 3 controls (the same probe by IP with no proxy IS heard by the witness) + 1 control of the native sink. + 4 PeerConnections built from a torn-down window (a detached iframe, a closed popup; behind SOCKS5 and behind HTTP; defect B3: EXPECTED RED on firefox-63, green on firefox-64) + 2 controls of them (the same PeerConnection from an attached iframe, green on both). + 2 cases of two contexts alive at once (each with its own proxy and DoH, a TURN server over TCP by a different name in each; behind SOCKS5 EXPECTED RED on firefox-63 like turn_tcp-name-socks5, behind HTTP green on both). EXPECTED RED on firefox-63: turn_tcp-name-socks5, turns_tcp-name-socks5 (user context 0, fixed in firefox-64) and the three .local cases fetch-local-socks5, stun-local-socks5, stun-local-http (audit B4, also red on firefox-64 until decided). The Linux leg runs as root so the resolver trap is a second sink. Windows reads the same engine log (its getaddrinfo lines are in the parent process file under the sandbox: run 43574494194), with the no-proxy native control as its positive control. THE OCSP CASES (4): a TLS page whose leaf, signed by a lab CA the engine trusts (put in the profile by the engine's xpcshell, no ignore_https_errors), names its OCSP responder by a NAME (ocsp-<nonce>.lab.test) and by an IP; a context behind the gateway loads it and the request must go through the gateway, never be looked up natively, in user context 0, or reach the responder (2 cases, EXPECTED RED on firefox-63, green on firefox-64); the same page in a context with no proxy IS asked of the responder (control); a page of an issuer the engine does not trust makes no OCSP request (negative control)."},
{"id": "wrapper.e2e.realness", "giro": "G2", "os": ["linux", "windows"], "min_tests": 32, "exact": true, "tests": ["tests/test_realness_behind_a_declared_exit_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The realness check without a real proxy: six declared exits, the values a page reads, and the roads. Linux runs as root without xdist like the DoH suite (the resolver trap); on Windows the trap does not exist and the assertion on the system resolver is the only one omitted."},
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 249, "exact": true, "tests": ["tests/test_the_server_says_nothing_about_the_launch_counter.py", "tests/test_the_witness_picks_a_port_both_sockets_bind.py", "tests/test_preload_newtab_reaches_the_core_only_when_asked.py", "tests/test_the_resolver_trap_counts_its_own_users.py", "tests/test_the_doh_e2e_launch_on_a_virtual_display.py", "tests/test_the_realness_helpers.py", "tests/test_the_h3_line_helpers.py", "tests/test_the_fake_doh_delays_and_refuses.py", "tests/test_the_host_address_helper.py", "tests/test_the_udp_chain_helper.py", "tests/test_the_fake_doh_answers.py", "tests/test_doh_session_prefs_unit.py", "tests/test_the_leak_watcher_sees_a_direct_connection.py", "tests/test_the_http_proxy_helper_asks_for_credentials.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_the_network_declaration_reaches_the_engine.py", "tests/test_the_resolver_trap_is_required_by_the_gate.py", "tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py", "tests/test_the_witness_hears_a_direct_send.py", "tests/test_the_egress_sink_helpers.py", "tests/test_the_lab_ca_and_its_ocsp_leaf.py"], "marker": "unit", "needs_root": false, "note": "92 = 6+32+21+7+8+3+9+6. The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
{"id": "wrapper.e2e.page", "giro": "G2", "os": ["linux", "windows"], "min_tests": 115, "exact": true, "tests": ["tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_route_superseded_e2e.py"], "marker": "e2e", "needs_root": false, "note": "114 = 100 + the 14 of test_a_page_that_moves_on_e2e.py (a navigation the page overtook with location.replace ends; the engine fix 860ef8a6d9 is proved by it). 100 counted at the collection; was 96 = 10+32+16+34+4 before the popup tests of 6200bc2). A page is handed over when the engine says Page.ready; a popup reaches the client (link, noopener, window.open; own site and another; with and without a route; in-process and over launch_server) as Playwright's does; a superseded route. Needs the candidate binary, and the stock Playwright client of the dev extra."},
{"id": "wrapper.unit.page", "giro": "G1", "os": ["linux", "windows"], "min_tests": 72, "exact": true, "tests": ["tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_page_number_follows_the_call.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py"], "marker": "unit", "needs_root": false, "note": "72 = 44 + 3+9+5+1+10 of the popup hand-over (24 counted at the collection before; was 20 = 3+8+1+8 before 6200bc2). The page dispatcher's wait for Page.ready and what it hands over; the drive gate goes through the core (the engine waits for the session's road)."}
]
+1 -1
View File
@@ -9,7 +9,7 @@ sitemap: false
# docs/ source folder
This folder is the source the wiki is rendered from. Read it with search and
navigation in **[the wiki](https://github.com/feder-cr/invisible_playwright/wiki)**.
navigation in **[the wiki](https://github.com/oss-invisible/playwright/wiki)**.
`index.md` is what the site root actually serves. This file exists so the folder
still shows something sensible when browsed directly on github.com.
+1 -1
View File
@@ -276,6 +276,6 @@ not neutral; it is a shape no ordinary browser has, so assert presence, not abse
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. Every candidate line in
this page is one I have read off about:webrtc while chasing a leak that a badge missed.*
+1 -1
View File
@@ -244,7 +244,7 @@ limits, or behaviour and timing, which you still have to supply.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The sensor surface
is the easy kind of honest: the correct answer is to report nothing, and the only
way to fail is to invent data a real desktop would never send.*
+1 -1
View File
@@ -218,6 +218,6 @@ slightly unusual.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The header and the array
come from one preference, which is exactly what an injection-only spoof gets wrong.*
+3 -3
View File
@@ -1,6 +1,6 @@
---
title: "AI agent retry loops trip rate limits, not fingerprints"
description: "Retry and re-plan loops multiply requests into a volume signal; throttling belongs in the agent loop. This page moved to the AIHawk wiki."
description: "Retry and re-plan loops multiply requests into a volume signal; throttling belongs in the agent loop. This page moved to the invisible_playwright_mcp wiki."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 17
@@ -9,10 +9,10 @@ nav_order: 17
# AI agent retry loops trip rate limits, not fingerprints
This page moved to the AIHawk wiki, where the agent-experience content now
This page moved to the invisible_playwright_mcp wiki, where the agent-experience content now
lives:
**[Agent retry loops trip rate limits, not fingerprints](https://github.com/feder-cr/AIHawk/wiki/agent-retry-loops-rate-limits)**
**[Agent retry loops trip rate limits, not fingerprints](https://github.com/oss-invisible/playwright_mcp/wiki/agent-retry-loops-rate-limits)**
The one-paragraph version: an agent that retries and re-plans multiplies its
requests, and volume is scored server-side against your address and account.
+3 -3
View File
@@ -1,6 +1,6 @@
---
title: "Why AI browser agents have their own timing signal"
description: "An LLM loop emits machine-regular action gaps and instant pointer jumps - a behavioral signal no fingerprint fixes. This page moved to the AIHawk wiki."
description: "An LLM loop emits machine-regular action gaps and instant pointer jumps - a behavioral signal no fingerprint fixes. This page moved to the invisible_playwright_mcp wiki."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 10
@@ -9,10 +9,10 @@ nav_order: 10
# Why AI browser agents have their own timing signal
This page moved to the AIHawk wiki, where the agent-experience content now
This page moved to the invisible_playwright_mcp wiki, where the agent-experience content now
lives:
**[The timing signal AI agents give off](https://github.com/feder-cr/AIHawk/wiki/ai-agent-timing-signal)**
**[The timing signal AI agents give off](https://github.com/oss-invisible/playwright_mcp/wiki/ai-agent-timing-signal)**
The short version it still owes you here: a think-act loop pauses for model
latency, and that pause repeats with a regularity no human produces. The
+2 -2
View File
@@ -224,7 +224,7 @@ this whole page is about.
one. Pick on the agent loop, then fix the machine, then consider the engine.
**Is there any agent route to an engine-level fingerprint?** Two, and they are not
equivalent. `uvx aihawk` launches through the engine, so the
equivalent. `uvx invisible-playwright-mcp` launches through the engine, so the
seeded profile and the humanised pointer come with it. Microsoft's own Playwright
MCP server takes a browser and an executable path, which runs the engine but
carries no `firefox_user_prefs`, so every session on a given build shares one
@@ -274,6 +274,6 @@ identity.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. This page exists because eight separate articles all
concluding "does not fit" would have been worse for you than one that says why.*
+1 -1
View File
@@ -246,7 +246,7 @@ for where a JavaScript-collected fingerprint sits among the other layers.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The Camoufox issue above is someone else's bug
tracker and someone else's engine build; it is quoted here because it is the clearest
public evidence that this whole approach narrows a gap rather than closing one, and that
@@ -124,7 +124,7 @@ for the flag every CDP-driven fork inherits alike.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level, precisely because a Chromium fork does not
change the automation protocol underneath it. The page recommends switching
engines rather than skins for that reason, and says so plainly rather than
+1 -1
View File
@@ -77,7 +77,7 @@ This is the one detector in this whole corpus where the honest answer is: engine
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright), a Firefox
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright), a Firefox
patched at the C++ level. Anubis is the one detector here this project can actually read the source of, and
the honest conclusion is that engine-level realness has almost nothing to do with passing it: the puzzle
tests JavaScript execution speed, not fingerprint fidelity, and any real browser clears it the same way.*
+1 -1
View File
@@ -77,7 +77,7 @@ The **puzzle itself is a different kind of gate entirely**, the same structural
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright), a Firefox
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright), a Firefox
patched at the C++ level. Arkose's own materials stop at category-level claims about its risk engine,
and this page stops there too for anything not independently corroborated. It does not describe, and
this project does not build, a way to solve FunCaptcha's puzzles for you.*
@@ -206,6 +206,6 @@ when every browser check comes back green.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser layer is the
part we can make perfect; the IP is the part only you can keep clean.*
+1 -1
View File
@@ -222,7 +222,7 @@ surfaces, and [how CreepJS decides you are lying](creepjs-explained.md).
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The two scores above are our own A/B, on one
machine and one identity, with the audio noise as the only variable. The feature they
killed was one we wrote.*
@@ -221,6 +221,6 @@ the audio device sits in the order you should debug.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The audio device is one of
the machine tells no page-level plugin can reach, which is why it is solved in the engine.*
@@ -281,7 +281,7 @@ for the same total-budget thinking applied to a poll loop instead of a request r
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The code arriving is the easy part; keeping the
browser that asked for it and the one that spends it as the same machine is the part
worth writing down.*
+1 -1
View File
@@ -143,6 +143,6 @@ checks when there is no way to avoid running it.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level, on why the safest login is usually the one that
never runs as automation at all.*
+1 -1
View File
@@ -266,7 +266,7 @@ session-reuse pattern this flow feeds into once the 2FA step is past.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. Generating a code from a secret you already
hold is arithmetic, not automation trickery; the browser's realness has nothing to
do with whether the math is correct, and the whole flow is worthless without a
+1 -1
View File
@@ -89,7 +89,7 @@ Several rule families sit entirely outside what any browser engine can affect. `
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright), a Firefox
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright), a Firefox
patched at the C++ level. AWS documents its Bot Control rules more specifically, by name and by
default action, than almost any other vendor in this corpus, which is why this page quotes rule
names directly rather than reconstructing them from outside reverse engineering.*
+1 -1
View File
@@ -222,6 +222,6 @@ for the order to debug in once something flags you.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine swap is the easy
half; the pacing and the exit are the half that decides the session.*
+2 -2
View File
@@ -94,7 +94,7 @@ Firefox build.
![One panel listing three values read from the patched engine, headless:
navigator.getBattery is undefined, navigator.vendor is an empty string, and
navigator.productSub is 20100101. A note says the bundled Firefox returned the same
values.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/battery-api-fingerprint-firefox-values.png)
values.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/battery-api-fingerprint-firefox-values.png)
`navigator.getBattery` is `undefined`, which is the answer to the title, and the bundled
Firefox returns the same thing.
@@ -211,7 +211,7 @@ and [how navigator.webdriver actually reads](navigator-webdriver-explained.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The most robust fingerprint
field is the one a real browser genuinely produces, and sometimes the one it genuinely does
not.*
@@ -204,7 +204,7 @@ challenge layer that sits beside, not instead of, everything on this page.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. It answers the
browser-identity layer honestly; it does not touch a rate limit, an IP block, a
honeypot your own code walks into, or a site's decision to block a traffic category
+1 -1
View File
@@ -184,6 +184,6 @@ for where behavioural signals sit in the wider picture.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The preference exists because the timeout described
above is real, and a test suite that hits it deserves a way back to the old behaviour.*
+1 -1
View File
@@ -256,6 +256,6 @@ for the compare-against-stock method this page leans on.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The protocol under
the driver is an implementation detail; the leaks were never on the wire.*
@@ -218,6 +218,6 @@ human is worth more than the seconds you save.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The speed is stock
Playwright; the tell is the part the speed guides leave out.*
+1 -1
View File
@@ -170,6 +170,6 @@ which takes the consistency idea considerably further.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright).
We gate every release on BotD, so the detector names and the compared values above
come out of its source and not out of memory.*
+2 -2
View File
@@ -67,7 +67,7 @@ tool you picked.
## Where this project sits
[invisible_playwright](https://github.com/feder-cr/invisible_playwright) is
[invisible_playwright](https://github.com/oss-invisible/playwright) is
not a fifth entry on the list above competing for the same job. It answers a
different question: given that you have already picked Playwright's API
(unchanged, same code you would write against any Playwright browser), what
@@ -117,7 +117,7 @@ and [Firefox or Chromium for anti-detect automation](firefox-vs-chromium-antidet
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
which is not a competitor to any of the four tools above - it sits underneath
one of them. The page is organized around picking the right testing tool
first, because that decision is independent of the engine question it exists
+1 -1
View File
@@ -179,6 +179,6 @@ layer an extension lives at has a ceiling.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. This page exists because someone asked in our
discussions and got an answer about a different kind of extension entirely.*
+1 -1
View File
@@ -259,7 +259,7 @@ for the compare-against-a-stock-browser method that keeps these numbers honest.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The three numbers on this
page get conflated because they all look like a percentage; none of them are the same
percentage.*
+3 -3
View File
@@ -1,6 +1,6 @@
---
title: "browser-use gets detected: what you can and cannot change"
description: "browser-use drives Chrome over CDP. What BrowserProfile lets you change and what stays out of reach. This page moved to the AIHawk wiki."
description: "browser-use drives Chrome over CDP. What BrowserProfile lets you change and what stays out of reach. This page moved to the invisible_playwright_mcp wiki."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 2
@@ -9,10 +9,10 @@ nav_order: 2
# browser-use gets detected: what you can and cannot change
This page moved to the AIHawk wiki, where the agent-experience content now
This page moved to the invisible_playwright_mcp wiki, where the agent-experience content now
lives:
**[browser-use getting blocked: what you can and cannot change](https://github.com/feder-cr/AIHawk/wiki/browser-use-getting-blocked)**
**[browser-use getting blocked: what you can and cannot change](https://github.com/oss-invisible/playwright_mcp/wiki/browser-use-getting-blocked)**
The unchanged short answer: browser-use exposes a real set of levers
(`executable_path`, `user_data_dir`, `proxy`, `headless`, `args`), all of
+1 -1
View File
@@ -239,6 +239,6 @@ signature is the pixels, the renderer string is a reported value, and both have
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The two hashes above are
real measurements, reproduced to the byte on two operating systems from one seed.*
+1 -1
View File
@@ -245,6 +245,6 @@ datacenter. You want a stable, hardware-shaped, unique value, not a popular one.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed makes every surface
reproducible, so the two-read stability check above is a test rather than a guess.*
+1 -1
View File
@@ -239,6 +239,6 @@ different hardware.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level, including three separate font backends convinced not
to ask their host anything.*
@@ -232,7 +232,7 @@ for the compare-against-stock method that catches a VM tell a verdict hides.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. It presents one coherent
real-hardware persona to the browser-visible layer; the IP, the timing floor and the
pacing are still yours to supply.*
@@ -251,6 +251,6 @@ handle.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The clipboard opens for it
because the gesture is genuinely trusted, not because a value was faked.*
@@ -85,7 +85,7 @@ Linux container, because they are presented by the browser rather than read from
![Two panels listing three values. navigator.webdriver differs, true against false. The
AudioContext sample rate is 48000 Hz in both. navigator.platform is Win32 in
both.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/can-a-website-tell-you-are-on-a-server-values.png)
both.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/can-a-website-tell-you-are-on-a-server-values.png)
Three values from one page served from `127.0.0.1`. The audio sample rate is `48000 Hz`
in both browsers and the platform string is `Win32` in both, so neither of those two is
@@ -230,6 +230,6 @@ and the pacing still depend on where and how you run it.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. It fixes the machine tells a
server leaks in JavaScript; the datacenter IP and the pacing are still yours to supply.*
@@ -196,7 +196,7 @@ for the end-to-end version of this.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed-and-directory
pairing rule is one I wrote down after debugging a profile whose machine changed
overnight.*
@@ -196,6 +196,6 @@ and [when the timezone does not match the proxy](timezone-proxy-mismatch.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The anonymity-set framing
is the one that keeps me from "fixing" a shared fingerprint that was doing its job.*
@@ -187,6 +187,6 @@ still on a distrusted IP.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser half is
what the patch does; the IP half is the one honest thing it cannot do for you.*
+1 -1
View File
@@ -201,6 +201,6 @@ rather than reading the score.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The honest boundary in the
last section is the one I most wish more of these pages drew.*
@@ -85,7 +85,7 @@ promised no leftover state, and it delivers that.
![Two panels listing three values. localStorage is available in both browsers, and both
report that the screen and the viewport differ, so neither looks like
resistFingerprinting is on. The canvas pixel hash differs between the two
panels.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/can-you-be-fingerprinted-in-incognito-mode-values.png)
panels.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/can-you-be-fingerprinted-in-incognito-mode-values.png)
Three values, read from one page served from `127.0.0.1`. `localStorage` is available in
both, which is the point of the section above: private mode is about state, and this
@@ -218,7 +218,7 @@ and [the TLS handshake no browsing mode can hide](ja3-ja4-tls-fingerprint.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. Private mode clears what a
site stored on you; this project changes what the browser is, which is the axis private
mode leaves alone.*
@@ -208,6 +208,6 @@ signals no stealth layer touches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The weight that keeps it out
of a small function is the same weight that makes it look real.*
@@ -208,7 +208,7 @@ and behaviour layers are not in those tests at all.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. It is built to look like
a real browser, which is why it passes most checks and why it will never claim to make
you invisible.*
@@ -141,6 +141,6 @@ fingerprinting surface](measuretext-textmetrics-fingerprinting.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. A canvas hash was never
really about the canvas; it was always about everything underneath it.*
+2 -2
View File
@@ -130,7 +130,7 @@ right value directly.
a seed report different canvas and WebGL readback hashes and even a different device
pixel ratio, while two sessions launched with the same seed report identical hashes and
identical
pixels.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/canvas-seed-vs-no-seed.png)
pixels.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/canvas-seed-vs-no-seed.png)
Four sessions above, one page served from `127.0.0.1`, hashes computed inside the page
so the numbers and the picture come from the same run. The two unseeded sessions
@@ -289,7 +289,7 @@ last step is to pin the identity so a failure is reproducible.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The seed is the same
lever whether you are hiding rotation or reproducing a bug: pin it and the machine
stops moving.*
+2 -2
View File
@@ -137,7 +137,7 @@ instead of staying bounded.
![Two panels listing three values. The canvas pixel hash differs between the bundled
Firefox and the patched engine. The measureText width is 115.65 px in both, and both
report that the screen and the viewport differ.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/canvas-fingerprint-noise-values.png)
report that the screen and the viewport differ.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/canvas-fingerprint-noise-values.png)
One page served from `127.0.0.1`, three values, two browsers. The canvas pixel hash
moves and the text width does not: `measureText` returns `115.65 px` in both.
@@ -224,6 +224,6 @@ canvas-in-iframe rows are a consistency test rather than a fingerprint test, and
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The solid-fill guard exists because we shipped
without it.*
+24 -20
View File
@@ -1,17 +1,20 @@
---
title: "Canvas and WebGL fingerprints, identical across OSes"
description: "Canvas and WebGL fingerprints identical across Windows and Linux: intercept readback, not the render, so one seed produces a byte-identical hash on every OS."
title: "Canvas and WebGL fingerprints across OSes"
description: "Canvas and WebGL fingerprints across Windows and Linux: 2D canvas is drawn on the CPU, noise is projected only when WebGL and WebGPU pixels are read back, and it depends only on the seed."
parent: "Canvas, WebGL, Fonts and Audio"
grand_parent: "Guides"
nav_order: 9
---
# Canvas and WebGL fingerprints, identical across OSes
# Canvas and WebGL fingerprints across OSes
A GPU-backed render surface can't be read from or written to directly and safely, so
the fix intercepts the one place JavaScript can actually see the result instead - the
same seed then produces a byte-identical canvas and WebGL hash on Windows and Linux.
same seed then gives the same noise on Windows and Linux. 2D canvas is drawn on the CPU, so it
does not depend on the GPU; the noise is projected only when WebGL and WebGPU pixels are read back.
Text and GPU raster can still differ slightly between the two OSes, and the PNG container is left
as a stock Firefox writes it.
[Why headless browsers render different fonts](headless-fonts-differ.md) and
[how to make Linux and macOS report real Windows fonts](bundled-fonts-cross-platform.md)
@@ -92,17 +95,18 @@ for the same reason: nothing about it resembles noise added on top of a real sig
| Additive per-call noise | Perturbs a fraction of pixels on top of the real render | Two reads in one page differ; the real render's font/GPU signature still shows through; the noise has a high-frequency shape a single read can flag |
| Full substitution | Replaces pixels with a pure function of the seed and the pixel position, with zero input from the render underneath | Must leave low-entropy buffers untouched so it does not break legitimate canvas reads |
## The proof: byte-identical hashes, not just "looks similar"
## What was checked, and what was not
Rendered the same seed's canvas (text plus a gradient) and WebGL scene (a
high-entropy draw) on Windows and on Linux, hashed both in-page. The hashes matched
byte for byte on both platforms. Run against a commercial fingerprint scanner across
multiple seeds, zero failures on either OS.
high-entropy draw) on Windows and on Linux, hashed both in-page, and ran a commercial
fingerprint scanner across multiple seeds. What holds: the noise is a pure function of
the seed and of the pixels it is applied to, so two reads of the same bytes give the same
result, and the 2D path does not depend on the GPU.
That is a stronger claim than "produces a plausible fingerprint." It's the same
identity, provably, regardless of which OS is actually running underneath - which is
what makes a seed a real, portable identity instead of a value that happens to look
right on the machine it was tested on.
What is not claimed: that every byte matches between a Windows and a Linux host. Text
pixels follow the host's rasteriser on Linux, and GPU raster can differ by one level
between drivers. Whether two profiles with the same font can be linked by the way they
rasterise has not been measured.
## What this generalises to, and where the edges still are
@@ -121,8 +125,8 @@ a fact that becomes true once and stays true.
The render was never the reachable surface. Content only ever sees a canvas or a
WebGL scene through a handful of readback calls, and putting the substitution there
instead of in the renderer is what makes a seed portable: the same identity produces
the same bytes on Windows and on Linux, because nothing about either host's actual
rendering pipeline reaches the output.
the same noise on Windows and on Linux, because the noise comes from the seed and not from
the host's rendering pipeline.
The tradeoff is honest rather than free - the fix covers only the readback paths it
enumerates, and a masking-safe design still has to leave genuinely low-entropy canvas
@@ -131,10 +135,10 @@ fingerprinting.
## Short answers to the questions that lead here
**Can canvas and WebGL fingerprints be made identical across operating systems?** Yes,
if the interception happens at every point content can read the result rather
than at the render itself, which is the part that can't be touched directly on a
GPU-backed surface.
**Can canvas and WebGL fingerprints be made the same across operating systems?** The
noise can: it is applied where content can read the result, from the seed, rather than at
the render itself, which can't be touched directly on a GPU-backed surface. The pixels
underneath still differ slightly between hosts for text and GPU raster.
**Why substitution instead of adding noise to the real render?** Noise on top of a
real image still carries the host's own rendering signature underneath it.
@@ -162,7 +166,7 @@ content can observe, not at the source - applied to a different surface.
retrieved 2026-08-28, the enumerable set of readback calls this page's interception
point covers.
- This project's own render-readback interception work and its cross-platform
validation (same-seed byte-identical hashes on Windows and Linux, multi-seed
validation (same-seed hashes on Windows and Linux, multi-seed
results against a commercial fingerprint scanner).
**See also:** [canvas fingerprint noise](canvas-fingerprint-noise.md), for why
@@ -175,7 +179,7 @@ for what that hash actually measures.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The same-seed check here once passed while the
render was actually broken: a Linux canvas with text came back holding 11994 distinct
colours where Windows gave 16, and identical bytes for two different strings.*
+1 -1
View File
@@ -200,6 +200,6 @@ layer has to be built differently rather than patched afterwards.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. Firefox-based, so `cdc_` was never our problem,
but the general shape of it is everybody's.*
+1 -1
View File
@@ -110,7 +110,7 @@ and [WebRTC leak with a proxy](webrtc-leak-proxy.md).
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The table above
exists because "the proxy isn't working" and "the site is blocking me" get
treated as the same sentence far more often than they are the same problem.*
+1 -1
View File
@@ -254,6 +254,6 @@ in both directions.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. This is the argument for the engine choice that we
find most convincing, and it is the one most comparisons leave out.*
+1 -1
View File
@@ -209,7 +209,7 @@ the same argument from the other end,
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. Running a real Firefox means the Client Hints
question answers itself, which is the kind of advantage you only get by not lying in the
first place.*
+1 -1
View File
@@ -183,6 +183,6 @@ and [waiting for a specific API response](wait-for-specific-api-response-playwri
---
*From [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
*From [invisible_playwright](https://github.com/oss-invisible/playwright).
The three-arm table is our own run and the test page is printed above so you
can reproduce it rather than take our word for it.*
+1 -1
View File
@@ -80,7 +80,7 @@ This is worth being direct about, because it is a genuinely different kind of me
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright), a Firefox
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright), a Firefox
patched at the C++ level. This mechanism has nothing to do with browser fingerprinting, so this page has
nothing to claim about engine realness one way or the other, honestly: a scraper that respects a site's
crawl preferences and does not chase invisible links never triggers it in the first place.*
+1 -1
View File
@@ -233,7 +233,7 @@ each other.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level and driven by stock Playwright. Bot Management's actual
score never reaches the client that earned it; what this page can speak to is the half of
the pipeline a real browser engine touches, and it stops exactly where that half stops.*
+1 -1
View File
@@ -248,7 +248,7 @@ detail.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level and driven by stock Playwright. This page describes
a mechanism, not a workaround: the product does not solve captchas or click Turnstile's
interactive tier for you, and any tool that claims to defeat Cloudflare wholesale is
+1 -1
View File
@@ -193,7 +193,7 @@ and [Playwright in Docker](playwright-docker-detection.md), which are the rest o
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The joint sampling is the same decision made for
audio, storage quota and antialiasing, and for the same reason: independently sampled
dimensions contradict each other.*
@@ -209,7 +209,7 @@ and [screen sizes that give a headless machine away](screen-size-headless-tells.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The color-gamut and
colorDepth disagreement is one I would rather find in my own diff than have a page find
for me.*
@@ -205,7 +205,7 @@ for reading the JSON the page already fetches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser is for the
fingerprint-gated fetches, httpx is for the unguarded bulk, and telling them apart is the
whole job.*
@@ -1,6 +1,6 @@
---
title: "Computer-use agents and browser fingerprint detection"
description: "Clicking by pixel makes driver flags moot; the engine fingerprint and action rhythm stay checkable. This page moved to the AIHawk wiki."
description: "Clicking by pixel makes driver flags moot; the engine fingerprint and action rhythm stay checkable. This page moved to the invisible_playwright_mcp wiki."
parent: "AI Agents and Frameworks"
grand_parent: "Guides"
nav_order: 6
@@ -9,10 +9,10 @@ nav_order: 6
# Computer-use agents and browser fingerprint detection
This page moved to the AIHawk wiki, retargeted at the question people
This page moved to the invisible_playwright_mcp wiki, retargeted at the question people
actually search:
**[Claude computer use detected as a bot](https://github.com/feder-cr/AIHawk/wiki/claude-computer-use-detected-as-bot)**
**[Claude computer use detected as a bot](https://github.com/oss-invisible/playwright_mcp/wiki/claude-computer-use-detected-as-bot)**
The core of it, kept here in brief: a coordinate-clicking agent never
generates the DOM-automation tells, so `navigator.webdriver` advice mostly
@@ -200,6 +200,6 @@ rather than a free pass.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. CSP enforcement is the
browser's own security layer, unaffected by fingerprint patching in either direction.*
+1 -1
View File
@@ -188,6 +188,6 @@ seam looks like, and
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. We would rather document the missing field than
publish an integration guide for a seam that is not there.*
+1 -1
View File
@@ -168,6 +168,6 @@ JavaScript layer there is no override to find and no seam to detect.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright).
CreepJS is a release gate here. The lie names above are quoted from its source and
not paraphrased, because the exact strings are what you will see in a report.*
+1 -1
View File
@@ -139,6 +139,6 @@ for the reproduction discipline that caught the two wrong fixes here.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level, on a bug that took two wrong committed fixes before
the actual cause was reproduced.*
+1 -1
View File
@@ -223,6 +223,6 @@ platform tell that no script controls, and
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. The system-colour palette is pinned here because a
commercial detector was hashing it and catching the host operating system through it.*
+1 -1
View File
@@ -298,7 +298,7 @@ and [the checklist for when one site detects you](playwright-detected-as-bot.md)
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright).
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright).
DataDome does not publish its scoring model or the full list of what its
collector checks, so this page draws a line between DataDome's own
documentation and outside reverse engineering everywhere that line exists,
+1 -1
View File
@@ -225,7 +225,7 @@ driver layer is the one this page is about.
---
*From the notes of [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*From the notes of [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level. All four fixes are in this project's engine and
driver, and the fourth one was found by controlled experiment after the first three did
not fully close it.*
+2 -2
View File
@@ -66,7 +66,7 @@ families against two different fallbacks. Segoe UI, Calibri, Cambria and Tahoma
present against both fallbacks. Consolas reads absent against the monospace fallback
and present against the serif one. An invented control family reads absent
everywhere. All three browsers return the same
answer.](https://raw.githubusercontent.com/feder-cr/invisible_playwright/main/docs/img/font-presence-probe-three-arms.png)
answer.](https://raw.githubusercontent.com/oss-invisible/playwright/main/docs/img/font-presence-probe-three-arms.png)
Run that exact function over ten families with `monospace` as the fallback, on Windows,
and Consolas comes back **absent**. Consolas is installed. It is also what `monospace`
@@ -293,7 +293,7 @@ and [why headless browsers render a different font set](headless-fonts-differ.md
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The font set is the
same on every host by construction, which is the only reason this probe answers
the same way whether the process runs on a laptop or a container.*
+1 -1
View File
@@ -194,6 +194,6 @@ pass the number as text, `"1.25"`, not as a bare float.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The dead dpr write in this
page is one we shipped ourselves, and only caught by reading the value back.*
@@ -95,7 +95,7 @@ because shaping is the same in-tree library on both. None of that is Selenium
or Playwright; it is what the engine and the machine underneath either of them
report. Choosing between the two frameworks does not move any of those 58
families. This project exists because of that gap:
[invisible_playwright](https://github.com/feder-cr/invisible_playwright) is
[invisible_playwright](https://github.com/oss-invisible/playwright) is
Playwright's own API, unchanged, driving a Firefox patched at the C++ source
rather than the stock build - same protocol and auto-waiting Playwright always
had, different browser underneath. It does not touch Selenium's side of this
@@ -151,7 +151,7 @@ for the engine question once you have picked a framework.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. This page compares
frameworks, not engines - the engine question is a separate page, linked above,
because conflating them is the most common mistake in this comparison.*
+1 -1
View File
@@ -227,6 +227,6 @@ cannot substitute for them.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The engine layer
is the part I can hand you; the clean IP is the part you still have to bring.*
@@ -208,6 +208,6 @@ and [testing detection without fooling yourself with a verdict](how-to-test-bot-
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. It hides that a script is
present; the pacing is still yours to get right.*
+1 -1
View File
@@ -249,7 +249,7 @@ closed.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The default that keeps DNS and
the connection exiting together is the whole point of this page; the reputation of the exit is
still yours to bring.*
@@ -248,6 +248,6 @@ the network layer neither a VPN nor a fingerprint fix reaches from JavaScript.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The fingerprint half is
what it controls; the clean IP and the human pacing are still yours to supply.*
@@ -203,7 +203,7 @@ pacing and quotas you respect.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The browser is built to
look real; the exit IP is still yours to choose, and a chain changes who can trace it,
not what the site scores.*
@@ -205,7 +205,7 @@ the layer that no amount of cookie clearing or JavaScript ever reaches.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. Every session gets a
distinct, self-consistent fingerprint from its seed, which is the thing a cookie clear
was always trying and failing to be.*
@@ -190,6 +190,6 @@ and [keeping canvas and WebGL consistent across platforms](canvas-webgl-cross-pl
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The server-OS mismatch in
this page is a mistake I shipped before I built the thing that fixes it.*
@@ -200,7 +200,7 @@ for the layer just above it.
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The handshake is
real because the browser is real; the exit and the pacing are still yours to get
right.*
+1 -1
View File
@@ -240,6 +240,6 @@ and [how to test whether your browser is detected](how-to-test-bot-detection.md)
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The DOM check above is one
I run against a real session before repeating any claim about what a page can see.*
@@ -212,6 +212,6 @@ and [the checklist for being detected on one site](playwright-detected-as-bot.md
---
*Written while maintaining [invisible_playwright](https://github.com/feder-cr/invisible_playwright),
*Written while maintaining [invisible_playwright](https://github.com/oss-invisible/playwright),
a Firefox patched at the C++ level driven by stock Playwright. The flag reads false
because the browser's own code returns false, not because a script overwrote it.*
Loaded 100 of 720 files, more files were not shown because too many files have changed in this diff. Show more