Repository navigation
Conversation
…dget The budget is wall-clock time, so it counts time an entry spends waiting for the CPU or a lock, not just the script. A test binary running ~1,000 tests in one process is where that breaks down. On a two-socket 72-vCPU Linux host, OctoSense's shell suite at 18-72 test threads turns a 6 ms Photos entry into 65-1,100 ms. Two causes were measured: - The process-wide LiveId interner mutex, which the tokenizer takes ~12,700 times per entry: 90-230 ms of lock waits under load, mostly futex time in the kernel. - Page faults stalled behind other threads' memory-map changes. Tests then fail with "script time budget exceeded" while asserting behaviour that has nothing to do with time. The variable is read once. An unset, empty, zero or unparsable value keeps 64 ms, so nothing changes unless a process opts in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Check results (Linux x86_64, EC2 c5d.18xlarge):
OctoSense carries this change as |
|
OctoSense-org/OctoSense#376 merged (31a34f7b): OctoSense now carries this change as stacked runtime patch |
|
A data point from a real application rather than the test suite — in case it helps with the default, A mini-app's Splash body here is 59,625 bytes — one entry, evaluated once when the page opens.
On the slower machine the whole canvas stays blank, and the log carries: With the budget raised to 3000 ms, the same binary and the same package on the same slow machine give Two things that stood out there, in case they bear on the choice of default:
The override covers it either way. We are carrying the raised value in a local build until then. |
Why
Every entry into a Splash isolate gets a 64 ms wall-clock budget (
with_splash_budget). Wall-clock time counts every millisecond the entry spends waiting for the CPU or a lock, as well as script work. A test binary running ~1,000 tests in one process is where that breaks down.OctoSense's shell suite was measured on a two-socket 72-vCPU Linux host (EC2 c5d.18xlarge), with each entry's wall time, on-CPU time and LiveId-interner lock waits instrumented:
Two causes:
LiveIdInternermutex. The tokenizer takes it ~12,700 times per Photos entry. Under load, slow entries wait 90–230 ms on it, mostly as futex time in the kernel (sys150–350 ms per entry).lock_mm_and_find_vma. They wait while other threads in the same process map, unmap or fork.The tests then fail with
script time budget exceeded, although they assert behaviour that has nothing to do with time. OctoSense#357 already hit this and trimmed a test "under concurrent CI load". The Mac passes only because it has one socket and fewer threads.A read-mostly interner (an
RwLockwith a read fast path) was also tried. It cut the suite from 15 s to 9 s and context switches from thousands to tens, but it did not stop the failures, so it is not part of this PR.What
MAKEPAD_SPLASH_BUDGET_MSsets the per-entry budget, like the crate's otherMAKEPAD_*switches. It is read once. An unset, empty, zero or unparsable value keeps 64 ms, so nothing changes unless a process opts in. The per-app instruction budget (splash_policy) is separate and unchanged.OctoSense sets it only for its test step, and carries this change as a stacked runtime patch until the next makepad sweep, so
maindoes not move for it.Checks
cargo check -p makepad-widgets: no warnings in makepad-widgets (Linux x86_64, on this branch).cargo test -p makepad-widgets --lib(the existing tests): running on the Linux host. Results will be posted here.🤖 Generated with Claude Code