18 Commits
Author SHA1 Message Date
shinyobjectz ee42e31469 NB2a: stat channels and pass timings chosen and read from TypeScript
io/trace's stats.rs: a stat channel is a RAEA_ variable's name without RAEA_ (bake_trace, trace, bevy_passes), on
when the composition chose it (native("stats.on", { channels }) at its top level), when RAEA_STATS lists it, or when
its variable is set, the override. The 51 reads of 24 trace and stat variables go through raea_io_trace::stat. Each
of Bevy's render passes (RenderDiagnosticsPlugin, on by bevy_passes) and PassTimer's go into the run's totals, with
the counters engine/draws and engine/updates; native("stats.read", {}) returns them, and a run that chose a channel
prints the table and keeps stats.json in its trace folder (docs/manual/reference/cli/traces.md).

tools/nobuild.sh stats checks it: every channel decided done reads through stat(); the scene choosing bevy_passes and
trace traces, reads 9 passes and 11 draws back on its last frame, prints the table and keeps stats.json; with nothing
chosen nothing prints; RAEA_TRACE=1 and RAEA_STATS give the same trace lines. 12 frames take 12 updates.

raea-render's lines stay as they were (NB4a's plugin choice folded to one line). native-calls.ts gains the two calls,
and bevy.app.*, which raea registers now that the macOS build links the plugin catalog.
2026-11-22 09:15:58 -08:00
shinyobjectz 57f3ef8db3 Windows: canonicalize goes through dunce and the home folder through user_home (all but five crates)
canonicalize() through std gives \\?\C:\... on Windows: a path Git for Windows can neither read nor lock, Rolldown can't resolve, and which shares no root with the C:\... git and everything else print. It broke a new workspace's git config (fixed in apps/workspace earlier today). Here the calls in the apps (CapCut, check, direction, engines, fingerprint, game, interchange, judge, solid, sound, targets, tools), the bundler, the CLI, the modules loader, the native shim's realpath, the page's motion, io (assets, gen, home, shell), runtime/bundle/lib, js, track and world, the systems (fingerprint-use, footage, index, ml, page-net), the bridge bench's examples and the sdk/ui test tools use dunce::canonicalize, which gives C:\... wherever a path can be said so and is std's own call on the Mac and Linux.

Reads of the home folder took HOME alone, which Windows doesn't set for an app opened from the Start menu or Explorer, so the taste file, the settings file, the inbox, the npm store, the caches (sounds, splats, goo, ingest, speech, Core ML, the portable perceive models), the node shim's os.homedir() and CapCut's drafts were looked for under whatever folder raea ran in. raea_io_home::user_home() reads HOME, then USERPROFILE (Git for Windows' order; an empty one counts as unset), and models(), caches(), logs(), env_path() and offline() use it, as do the places that had their own fallback.

The caches that had their own copy of "this variable, else this folder under home" (splats, goo, ingest, the npm store, Core ML's models) now call raea_io_home::env_path and models(), and raea_io_home::real canonicalizes a path or keeps it as given, so tools/dupes.max comes down to 289 exact and 58 near. tools/skills.sh reads a variable from env_path("RAEA_...", ".raea/...") as it did from env::var, so files.md keeps RAEA_NPM_HOME on ~/.raea/npm (every generated reference is unchanged).

Five crates hold other sessions' uncommitted edits (engine/page/stage, engine/render, runtime/bundle, runtime/export, runtime/live): their few calls, and tools/windows-paths.sh, the check that keeps both at zero, land once those are committed.

Checked: cargo check --all-targets of every crate changed, and of sdk/ui/conformance and sdk/ui/parity. On a Windows 11 PC and on macOS the unit tests of raea-io-home (user_home's order and an empty HOME, now in caches_logs_and_the_home_folder_follow_the_platform), raea-app-check, raea-app-workspace, raea-app-registry and raea-core-facts pass (5, 27, 10, 7, 17).
2026-11-17 10:38:33 -08:00
shinyobjectz ab2a085a05 RT3: the decoder's tests in a file of their own
media_play.rs went over the 500-line limit with the seek-while-playing test (tools/size.sh); its tests module moves, unchanged, to media_play/tests.rs.
2026-11-16 17:29:57 -08:00
shinyobjectz b7f796aa5e RT3: a seek while a film plays shows nothing from where it was, and the sound clock moves on between its callbacks and never goes back
The founder, 11-16: timeline playback of plain pre-rendered films is choppy and repeats itself. Three causes were in the window's media path.

A seek made while a film played (the timeline's ruler, its Home key, the next clip of an edited film) left the frames the decoder had already sent for the old place in the page's queue, due by the wall clock, so they could show after the seek's own frame: a stretch shown again, or a step back. The page now drops them when it seeks and keeps none that come while the seek is on its way (keep_due in runtime/dom/media), and a seek that fails no longer holds frames back.

The decoder restarted its clock at the seek's time before it had decoded the frame there (from the keyframe before it: 30 to 300 ms at 4K), so the frames after a slow seek were due at once and skipped to catch up. It now sends the seek's frame first, then starts the clock and plays on from the frame after it (media_play.rs, index_at).

The sound clock was the device's position read at each callback: it stood still between callbacks and jumped a buffer at each (about 11 ms at 48 kHz with 512-frame buffers, a staircase under a 120 Hz page), the output delay subtracted from a fresh reading could put it behind one already read, and a start made during a callback was overwritten by that callback's write. It now runs on from the last callback's position by the time since it, held to what that callback wrote, never earlier than a time already read, and a start made during a callback stands (Shared::time_at in media_sound.rs).

Tests: media_play's a_seek_while_playing_answers_first_and_plays_on_from_there (a 3 s clip played past 1.2 s, seeked to 0.5: the seek's frame answers, then ten frames in order from 16/30 with none skipped, the first due a frame after the answer); media_sound's the_clock_moves_between_callbacks, a_late_callback_holds_the_clock, a_start_during_a_callback_stands and the_delay_never_takes_it_back; runtime/dom/media's frames_decoded_before_a_seek_are_not_kept. With RAEA_AUDIO_MUTE=1 the clock is the wall clock, so the sound clock's change is held by its unit tests, not by the headless play bench (the app's e2e/playback.spec.ts, docs/realtime.feature RT3).
2026-11-16 17:29:57 -08:00
shinyobjectz 4b1cb9ec9a A page's JS engine gives its free pages back every 5 s, and with RAEA_INSPECT its heap is logged and JavaScriptCore's context inspectable
The page loop (raea-runtime-dom's host step) never asked JavaScriptCore to release what it had freed, so the app
window's JS memory (WebKit Malloc) grew 272 to 448 MB over an hour of use while the live heap stayed ~60 MB. Upkeep
(raea-runtime-jsengine) releases it every RAEA_JSC_RELEASE_S (5; 0 never), as raea-runtime-react's thread already did:
the same window then held 166 MB flat.

RAEA_INSPECT=1: every RAEA_JS_HEAP_S (30) a full collection, then one JSON line of the heap's numbers in
~/.raea/logs/js-heap-<pid>-<n>.jsonl (JavaScriptCore's JSGetMemoryUsageStatistics, QuickJS's memory usage), so what a
page keeps can be read over a session on any engine; and on JavaScriptCore the context is inspectable from Safari's
Develop menu. Off by default (the collection stops the page's thread for 6-13 ms).
2026-11-16 16:29:45 -08:00
shinyobjectz f9b6f22ecf media: a quarter second of frames waits ahead; a video drawn small sends only the halving it is drawn from 2026-11-13 11:43:31 -08:00
shinyobjectz fcd6e12c03 media: the halvings' loop reads its last level without a closure (dupes) 2026-11-13 11:43:31 -08:00
shinyobjectz d7a755c08b Video plays smoothly at 4K and at 60 fps: frames decoded ahead and shown when due, a faster BGRA conversion, halvings from the decoder's thread, no relayout for a same-size frame 2026-11-13 11:43:31 -08:00
shinyobjectz df9d1d11d5 media: a playing video's frames leave its decoder when they fall due; RAEA_MEDIA_STATS says how play goes (measured: raea-feed d55df57) 2026-11-13 09:03:44 -08:00
shinyobjectz 75b1c69e71 A page's <video> and <audio> play at their element's volume in raea's window (Shane 11-10: 'a loudness lever not just on and off'). sdk/ui's element takes volume as a browser's does (0..1, RangeError outside it, volumechange) and tells the host __volume, again with each play; runtime/dom/media asks the decoder Cmd::Volume when it changes; raea-runtime-js keeps it per player and plays the sound at that gain while it isn't muted (an AtomicU32 beside muted, read in the audio callback), set again when a sound opens. Before this the window had only muted, so the app's volume slider changed nothing. sdk/ui test: the element's volume reaches the host as __volume, fires volumechange once and is told again with a play. The live composition stage has no volume call yet 2026-11-10 16:16:08 -08:00
shinyobjectz ebd147a076 The desktop app keeps its localStorage across launches, and a page reads it before its code runs (Shane, 11-09: the open workspace and Getting started's Hide were lost on every quit).
raea.app never set BEVY_TSX_STORAGE, so raea-io-net-calls refused net.storage.* and storage stayed in the window's memory (the launcher half is in raea-platform). With it set, a page still read its settings before the kept values came back, as net.storage.get was only asynchronous, and an app saving its settings on load (apps/app settings/store.tsx) would write its defaults over them. net.storage.get is now a synchronous host call too (raea_io_net_calls::storage_get, registered by raea-runtime-js net.rs install), and sdk/ui's storage.ts fills localStorage from it at load, falling back to the asynchronous answer on a host without it. Test: raea-runtime-js net::tests::kept_storage_answers_synchronously.
2026-11-09 12:42:59 -08:00
shinyobjectz d3e2922058 Page media in its own crate, raea-runtime-dom-media (runtime/dom/media), so raea-runtime-dom stays under the crate limit (L1 size: 2049 lines); its copies folded
The video and audio elements' sync moves out of raea-runtime-dom as it was, and raea-runtime-dom re-exports it as media. raea-sys-image and vello were only media's and go with it. Stream's four one-line senders are now one ask(Cmd), with Cmd public (L1 dupes: seek and muted were one shape). A seek that has landed is Media::landed, which is checked from two places. Tests: raea-runtime-js, raea-runtime-dom and the new crate pass; raea-cli checks.
2026-11-09 12:39:13 -08:00
shinyobjectz f8844bb385 Page media plays: video and audio elements' play(), pause() and load() drive the host's player, on the sound's clock
The desktop app's watch player threw on play() (the page runtime's <video> had none: the host played nothing), and
going back from an item crashed the app (its preload cleanup called load()). Now raea-runtime-js media_play.rs plays a
source on its decoder's thread: frames asked for at the clock's time (a slow decode skips frames, never lags), the
clock the sound's, out of the default device through cpal (media_sound.rs; muted plays silence on it), so picture and
sound can't drift; the wall's with no device or RAEA_AUDIO_MUTE=1. runtime/dom media.rs passes __play, __muted and
__load and tells playing, time (each frame), timeupdate (4 a second) and ended. sdk/ui dom/media.ts: play() (a
Promise), pause(), load(), paused, ended, loop, autoplay, canPlayType, preload, readyState per source, a new src
pausing as a browser's does; dom/host.ts gives React's onPlay, onPause, onPlaying, onTimeUpdate, onEnded, onCanPlay,
onVolumeChange and onEmptied their events. Tests: media_play::tests (wall clock: order, end on time, exact seek,
loop, pause), sdk/ui dom.test.tsx's media case (51 pass).
2026-11-09 12:31:56 -08:00
shinyobjectz d45b38ef60 An HTML page's files load on Windows (fixes #40, fixes #41, fixes #42). The HTML runtime was handed the page's folder as Windows wrote it: canonicalized to a verbatim \\?\D:\ path (#40), or as D:/..., which a URL reads as scheme d (#41). The cached Google Fonts face came back from html.read as C:\... (#42). Its backslashes became CSS escapes in url(), and the drive a URL scheme in src. Now the folder is canonicalized without the verbatim prefix (raea_io_home::plain), and the runtime gets every path in URL form: raea_io_home::url_path, /D:/work/page on Windows, which the page's file:/// base joins into file:///D:/work/page. That covers the page folder, the font folder and html.read's answers. What the runtime names back (html.read's urls, a video's file, a sound's src) is read through from_url_path. Nothing changes on Unix, where both are the path itself. io/home's test checks the forms on any system, and joins them to file:/// as Blitz does: the result is a file URL, not scheme d 2026-11-08 01:40:12 -08:00
shane 3381690416 raea is developed here now (public-first)
This repository was an export of a private one; from this commit on it is where raea is developed. Contributions:
CONTRIBUTING.md.
2026-11-07 13:36:50 -08:00
shinyobjectz 5e1c192d29 raea 9565b5f97 2026-11-06 16:27:57 -08:00
shinyobjectz 1dff4f0aa8 raea e699cf684509a8bbada118cc302c56e99065a680 2026-11-05 17:19:37 -08:00
shinyobjectz f675b0ad2b raea dc579e418 2026-10-31 13:15:29 -07:00