Compare commits

...
258 Commits
Author SHA1 Message Date
shinyobjectz b54136c4af Windows: a workspace raea 0.1.5 or 0.1.6 broke is repaired. Its include.path named a \\?\ path Git for Windows can't open, so every git command in it failed, rev-parse too, and raea workspace init inside it, adopt and doctor --fix all stopped there (#169). include() now drops such a line from the repo's config file itself before asking git (apps/workspace/src/repair.rs), and raea doctor says so. Tested on Windows 11, Git for Windows 2.49: git fails in the broken repo, then works after the repair. 2026-11-17 13:06:13 -08:00
shinyobjectz 450d873984 Windows: engine/render's canonicalize goes through dunce, the sweep's last
The last of the sweep (57f3ef8db3, e388258bff): engine/render's texture folder uses dunce::canonicalize, which gives C:\... on Windows and is std's own call on the Mac and Linux. It takes engine/render/src/lib.rs off tools/windows-paths.sh's WAITING list, so the check holds at zero with no exception.
2026-11-17 11:19:38 -08:00
shinyobjectz c188cf8bd7 Windows: tools/windows-paths.sh keeps every canonicalize through dunce and every home folder through user_home
The check for the sweep (a927fbb027, 57f3ef8db3, e388258bff): it fails on a std or tokio canonicalize(), which gives \\?\C:\... on Windows, and on a HOME read that doesn't name USERPROFILE, which Windows leaves unset for an app opened from the Start menu. Comment lines, vendor/, and the HOME of sdk/ui's conformance and parity tools (Mac and Unix only) aside. tools/agents/check runs it once this is on main.

One file waits: engine/render/src/lib.rs, whose fix is on windows-paths-render while that crate holds other unlanded work. A waiting file with nothing left to fix fails the check, so the list only shrinks; windows-paths-render takes it off.

Checked in an export of main with this added: ok, engine/render/src/lib.rs waiting. With engine/render's fix as well: fails, saying to take it off WAITING. Without the list on the fixed tree: ok, and a planted p.canonicalize() fails with its file and line.
2026-11-17 11:19:21 -08:00
shinyobjectz e388258bff Windows: canonicalize goes through dunce and the home folder through user_home in the stage, the bundler, export and live play
Four of the five crates 57f3ef8db3 ("all but five crates") left out while they held other uncommitted work: engine/page/stage's ~/ path for a shown file reads raea_io_home::user_home() (HOME, then USERPROFILE), and runtime/bundle's cache and freshness checks, runtime/export's render, review and scene, and runtime/live's open use dunce::canonicalize, which gives C:\... on Windows and is std's own call on the Mac and Linux. engine/render, the fifth, comes with tools/windows-paths.sh on windows-paths-render.

That other work is parked as found on realtime-wip (stacked above this, never landed) and render-3d-first-wip.
2026-11-17 11:07:55 -08:00
shinyobjectz 5cf62e80ee raea's window says which system it runs on, so the feed page says this PC and Ctrl on Windows
The page reads globalThis.__raea_window before its bundle runs (chrome.rs's preamble: chrome, lights, bar). It now also carries os, std's name for the system ("macos", "windows", "linux"), which raea-feed's src/lib/machine.ts reads (raea-feed PR #88): the navigator in raea's window always claims a Mac, so this is how the page knows to say "this PC" and Ctrl+Z where a Mac's says "this Mac" and ⌘Z. A window without it keeps the Mac's words.

Test: the_preamble_names_the_system (both chromes carry os).
2026-11-17 10:49:51 -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 a927fbb027 Windows: a workspace and its projects are made and read through plain paths. canonicalize() gives \\?\C:\... on Windows, which Git for Windows can neither read nor lock, and which shares no root with the C:/... git prints. So raea workspace init (the app's Make workspace) wrote an include of ../../../../\\?\C:/... into .git/config and every git command in the workspace failed ("Invalid argument"); workspace.id and project.id were never written; and raea workspace --json read id null even from a mended file, which the app's set-up took as a workspace with no id (a black window, then set-up again on every launch). up(), the record's paths, include(), adopt(), the doctor and the registry now canonicalize through dunce (C:\... wherever a path can be said so); include() takes both ends that way, and names a file on another drive whole instead of climbing to it. Also on Windows: the workspace root is found from USERPROFILE when there is no HOME (an app opened from the Start menu has none), the record names paths with / (it said out\edit.mp4), and the registry's @shared/ suggestion is an import (it said components\desk). Checked on a Windows 11 PC: the new a_workspace_reads_back_through_git failed there as reported (could not lock config file \\?\C:\...; the include climbed to the drive) and passes now; raea-app-workspace 10, raea-app-registry 7 and raea-core-facts 17 pass there and on macOS.
Skills: sections 0, 2 and 3 of the raea skill (sources apps/workspace/src) checked, still true: nothing a Mac sees changed.
2026-11-17 09:44:42 -08:00
shinyobjectz f4139a5a7a tools/taxonomy.sh links the checkout's SDK node_modules into an export (RAEA_MODULES), as manual-ref.sh does, so tools/agents/check can run the export's own copy: the shared tree's copy read the shared tree, and another lane's uncommitted SDK prop (gpu, in sdk/cloud) failed every lane's L0 and L1. Checked: an export of origin/main passes with RAEA_MODULES=~/raea. 2026-11-17 09:43:14 -08:00
shinyobjectz b4f6b6ab7a README: the tutorial is a plain pointer, Watch the tutorial, with nothing about how it was made 2026-11-17 06:47:18 -08:00
shinyobjectz 451afc7bbf README for 0.1.6: the banner names the latest release; the app's section says what it does now (the chat first, the hand-edited timeline, scenes, Index, Review, a lighter window) and opens on the tutorial, Goose Learns raea (docs/readme/goose-learns-raea.jpg, linked to its player on media.raea.io); Made in raea points at the films' source (raea-films); 3D names three.js and React Three Fiber; agents' tools add raea bug 2026-11-17 00:52:33 -08:00
shinyobjectz 61f6113845 skills pin: raea-skills #98 (fbebab5): files.md lists the page host among the files that read ~/.raea/env 2026-11-16 18:39:50 -08:00
shinyobjectz 1ff507df80 The window's draw count is raea-sys-page's DRAWS, read directly: a draws() reading it was a copy of the page host's picking() (the dupes ratchet) 2026-11-16 18:36:26 -08:00
shinyobjectz 5cc53609a8 Single-threading and the idle gate on by default for 0.1.6 (the developer, 11-16): RAEA_ST=0 or RAEA_IDLE_GATE=0, in the environment or ~/.raea/env, for the old way. Known: a seek while a film plays shows one more frame from before it 2026-11-16 18:36:26 -08:00
shinyobjectz b4aede8ae6 The window's two CPU switches, off by default and set in the environment or raea's settings file (~/.raea/env), where the app's window has no shell: RAEA_ST=1 runs every schedule on Bevy's single-threaded executor (34% less CPU at rest, 8% in a drag, 4% playing, frames as long; open: a seek while playing shows one more frame from before it), and RAEA_IDLE_GATE=1 lets a window with nothing drawn for 30 frames wait for input, 50 ms focused and 250 ms behind other windows, until the next draw (raea-sys-page counts its draws). The rest/wake rule is unit-tested; its on-screen check is still to do 2026-11-16 18:36:26 -08:00
shinyobjectz 3df38e170a skills pin: raea-skills #97 (14ac66c), with #94 and #95: 0.1.6's references and guide copies (the music and sound guides, craft's rubric and verbs; cli.md's raea motion, raea bug and clothes flags; feed.md's bug_report and final tag; files.md's rules and render progress), and the bug and rules tools taught 2026-11-16 17:41:16 -08:00
shinyobjectz b593ebb070 A render's progress folder: the home found with a match, not a closure shaped like io/home's LOCALAPPDATA one (the dupes ratchet's 60th near group); same paths, RAEA_RENDERS=off still writes none 2026-11-16 17:41:16 -08:00
shinyobjectz 9a6cd12d5f A render says how far it has got while it runs: ~/.raea/renders/<pid>-<n>.json, for the app's meter
The developer, 11-16: "in the chat ui having something that if its rendering we can see a progress meter".
Every direct render (fed, CPU, and to a folder or a still) writes a small file when it starts, as frames finish (at
most four a second, and at the last), and takes it away when it ends however it ends:
{pid, out, cwd, frames, done, started, updated}. RAEA_RENDERS moves it, RAEA_RENDERS=off writes none.
The raea app reads it for the chat's render meter (raea-feed render-meter). Not built yet: written while the
developer's renders hold the machine; L1 builds it.
2026-11-16 17:41:16 -08:00
shinyobjectz 0b8171cdae docs/character.feature: the character SDK ships as raea 0.1.7; 0.1.6 is a patch for the app (the user, 11-16). What of it is on main before then ships in 0.1.6's binary unannounced, as 0.1.5's did. 2026-11-16 17:41:16 -08:00
shinyobjectz 2c54a94c00 skills.sh's feed-app reading moves to tools/skills-app.sh, which it sources: skills.sh was 513 lines, over the 500 limit. release.sh counts the new file among the skills gate's inputs 2026-11-16 17:41:16 -08:00
shinyobjectz 6ee015071d skills.sh reads the feed app in the tree it checks when the tree has one, as its files are; l2.sh takes the app from the commit
The feed app (apps/app) is moving into raea's own tree. skills.sh read it as a checkout of its own at a commit (git show REV:path, git grep REV), and both quietly come back empty when apps/app is a folder of the tree: REV is then a subtree, read from inside it. Now the app this tree tracks wins, read through app_show and app_grep from its files; a tree without it reads RAEA_APP at RAEA_APP_REV as before, so today's checks, L1 and release.sh change nothing until the move. l2.sh takes an app in the commit's tree as it is, removing the old clone from its checkout first, and clones the app only for a commit from before. release.sh and the Linux build say so.
2026-11-16 17:29:59 -08:00
shinyobjectz 8d44a1e865 music.md: VCSL's marimba is sampled four to seven semitones apart, not a fourth or a fifth. 2026-11-16 17:29:58 -08:00
shinyobjectz c93042ff7f sources.md: the MIDI recipe is its own section, unindented, so the converter's heredoc pastes as raea guide prints it (its Python and the closing PY start their lines; run as printed, it gives the output tested on a file with a tempo change, a note crossing it and two notes never released). The tools folder for ensure.sh is found as raea's own native.ts finds it, beside an installed raea or in a checkout, here and on the setup-audio page. 2026-11-16 17:29:58 -08:00
shinyobjectz 3db55f345d References follow the review: tonejs-instruments is CC-BY 3.0 in catalog.py and catalog.json (the README's licence; sample-source-info.txt's sources credited), so LICENCE.txt and the credit line raea sounds get prints say so, and the sounds manual page credits all three CC-BY libraries. The setup-audio page states SAO's licence as it reads, gets uv and git from ensure.sh, and says what status 1 and RAEA_AUDIO_AUTOSETUP=0 mean. The tone game bench's music was a fatsine pad holding two-bar chords, the default the guides now forbid, and games.md pointed agents at it: it is now a chiptune loop, synths on purpose so the bench needs no sample files, with a square lead that asks and answers, a bass walking C Am F G and a plucked arpeggio, ducked under the voice as before (check.sh's tempo line and amount: -12 are unchanged). 2026-11-16 17:29:58 -08:00
shinyobjectz 43e35b2302 docs/sound.feature: SN2 lists what Stability's Community License asks of raea, which hands SAO on (the agreement and a NOTICE with its exact attribution beside the model, "Powered by Stability AI" where raea documents it, raea's own registration and revenue test) and leaves what applies to the person to be decided, including the integrated-product clause. SN7 counts a chord's notes as one onset, makes the guides' own example cues its first fixtures that must pass and a held pad its fixture that must fail, and marks its thresholds as a first guess. SN4 adds Mixkit to the packs never mirrored and GPL to what the catalogue never holds; SN6 names Roland's drum map and keeps a note with no note-off. 2026-11-16 17:29:58 -08:00
shinyobjectz 9c5ab64141 Sound guides: the review's fixes. tonejs-instruments is CC-BY 3.0 (its README), so every example that plays it credits it, and MusyngKite and FatBoy are left out as share-alike, not unlicensed. The SAO licence text says what Stability's Community License says: the person owns what it makes as far as the law allows, its sounds train no other generative model, its duties to ship the agreement, a notice and "Powered by Stability AI" fall on raea, and until raea settles them (SN2) the agent names the licence and links it instead of telling the person what it requires. Setup takes uv and git from raea's pinned tools/ensure.sh instead of an unpinned installer, names the Command Line Tools stub's status 1, and says RAEA_AUDIO_AUTOSETUP=0 stops setup-audio too. sources.md gives a one-line fetch for VSCO 2 CE and VCSL (their SFZ branches), Salamander V3, Groove MIDI (checked against its published SHA-256) and MuseScore General, each with its licence beside it; takes Mixkit's sound effects on the same terms as Pixabay's and FreePats' CC0 and CC-BY banks only. The MIDI converter pairs note-ons with note-offs, keeps a track per channel and writes raea/music's MidiFile shape, and the drum map is Roland's, which Groove MIDI was recorded on (hi-hat edges at 22 and 26, an open hi-hat take in the kit). Samplers get a root every 3 to 4 semitones: the examples fetch roots with no --notes and write the urls the command prints. The game example plays VCSL's recorded marimba instead of a TokenSynth one, raea/music's named instruments are marked as synth sketches, raea gen makes music only when the person asks for a track, the reel's bed is the person's own track or nothing, and raea sao and raea tokensynth take --dir so a take lands in the edit's asset store. 2026-11-16 17:29:58 -08:00
shinyobjectz 620cfe0744 References and the agent's prompt teach sound the way the guides now do.
The agent's sound line in engine/cli puts a sample library first, names raea guide sources, says music is composed for the cut and never a pad or drone by default, and keeps TokenSynth for a timbre no library has. Audio's src doc no longer offers lyria(), which is retired (and audio-stack.md says so), and the manual's example drops the media/ prefix staticFile doesn't take. The CLI pages say what is true: raea sounds' ids are exact (vcsl/upright-piano-knight, vcsl/bass-drum-1) and --all gives a pitched instrument one take a note; an SAO take is at most 11.9 s, a seed's take is played from its file, and SAO suits effects better than music; TokenSynth is for a missing timbre, curated; setup-audio says what each model fetches, its size and licence (SAO's is Stability AI's Community License, not an open one), what it needs and what its failures mean.
2026-11-16 17:29:58 -08:00
shinyobjectz de4d619270 docs/sound.feature: what the sound guides had to write down as gaps, filed as SN1 to SN7.
The local models install on any Mac (setup through tools/ensure.sh, TokenSynth pinned and checked, proven on a fresh account; each model's licence shown and kept, SAO's commercial use decided once; the app offering the models before a render blocks on gigabytes), the vetted packs reached through raea sounds (pinned, licences and credits copied, Ogg converted, Sonniss and Pixabay never mirrored, nothing non-commercial; dynamics, round robins and humanize in one Sampler; a MIDI file and a SoundFont played in raea), and a drone caught by raea check, its thresholds set from approved scores before it ranks above P3.
2026-11-16 17:29:58 -08:00
shinyobjectz e946a5a0d7 Sound guides: music is composed for the cut, never a default bed, and every vetted source is one page away.
The music and sound guides taught a drone score (a pad and a sine sub through a low-pass into a 6 to 7 s reverb, a chord every four bars), and agents' pieces came out as drones and pads instead of scores. motion/music now starts by deciding what each scene is heard as (silence, its own sound, source music, score, effects), spotting the cut (cues, hit points, a button) and taking the tempo from it, then writes for it: a motif, harmony that moves, rhythm and groove, orchestration by register on sampled instruments, an arrangement that follows the edit, a reverb per instrument rather than a wash over the bus. A held texture goes in only when a scene names one. Its two examples are a typechecked eight-bar cue (piano comping, a pizzicato ostinato, a flute motif, bass and a sampled kit, ending on a button) and a game's question-and-answer loop with one-shots on events. motion/sound adds layered effect design (transient, body, weight, tail; repeats varied), room tone, ambience and foley passes, placement, and a cue that lands on the end card in its example. The rubric's sound questions ask whether the music is written for the cut, and a new section lists how generated music gives itself away; the floor refuses music by default; remix, quieter, story, games and motion.md's rule 8 and example follow.

motion/sources is new: which source fits which job, the licence rule (CC0, public domain, CC-BY credited, MIT and Apache, free commercial licences; never NC, ND, Sampling+, personal-use or share-alike), how SAO and TokenSynth get onto a Mac as setup-audio really behaves (what each fetches, its size and licence, that uv and git must be on the PATH, what exit 127 and 75 mean), the four raea sounds packs with their exact ids, the packs fetched by hand with licence and source, the excluded ones, and how to load one-shots, SFZ instruments by dynamic and a MIDI groove converted to JSON.
2026-11-16 17:29:58 -08:00
shinyobjectz 6c390a4a17 RT3: a film played again from its end is at its start from the call on
A page's media element played again after its end told the window to start from 0 but kept currentTime at the end until the window's first frame came; a pause in between (two presses of play on a loaded machine) paused it back at the end, and the play event read the end's time. play() now puts currentTime at 0 first, as a browser's does (the seek to the earliest position comes before the play event). The feed's timeline now stops a film at its end instead of going round, so this is how its play starts again.

Test: sdk/ui/test/dom.test.tsx, the element played to its end and played again: currentTime 0 at once, and the play event at 0.0.
2026-11-16 17:29:57 -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 e8ce27fd62 #165: the three direction's table says Environment's room is drawn through PMREMGenerator.fromScene
sdk/r3f/src/three/kinds.ts lists how each raea kind is drawn when an R3F scene goes back to three. Environment now has a room form (three's RoomEnvironment, built in raea's engine), which room.ts draws through PMREMGenerator.fromScene; the table said panoramas only.
2026-11-16 17:29:56 -08:00
shinyobjectz 9202d88e69 #165: an <R3F> scene lit by PMREMGenerator.fromScene(new RoomEnvironment(), sigma) is lit by that room, as three lights it. Since #131, fromScene handed back a stand-in that raea left out with a warning, because raea's <Environment> and its engine took panorama files only: the scene was drawn with no environment, so a box three draws 255,195,160 on its front face came out 136,76,58, and anything the room alone lights was near black. <Environment> now takes room (three.js's RoomEnvironment, made with no file) and blur (fromScene's sigma) in place of src. The engine makes the room itself (raea-sys-environment room.rs): RoomEnvironment's room, boxes, light boxes and point light at three r185's sizes and strengths, each direction from fromScene's cube camera traced to what it hits and shaded with three's Lambert, GGX and light falloff, blurred by sigma as fromScene's two half blurs do, then filtered like any panorama; runtime/look names it in env_srcs as room:SIGMA. On the R3F side, fromScene of a RoomEnvironment returns a texture marked with its sigma, which lights.ts turns into <Environment room blur> with the scene's environmentIntensity and rotation, and as the background when the room is that too; fromScene of any other scene, and fromCubemap, are still left out with a warning. The other way round, src/three (room.ts) draws <Environment room> as RoomEnvironment through the renderer's PMREMGenerator, and the source export writes it so. Tests: room.rs checks the room's light at 14 directions against three's own RoomEnvironment object (within 1e-3), the blur and the source name; runtime/look's camera test reads room sources into env_srcs; the envmap conformance test and test/errors.test.tsx hold the props and the conversion, and export.test.tsx the export. test/room/check.sh renders test/room/room.tsx and holds three pixels within 8 levels of three's, which test/room/three.ts works out on the CPU with three 0.185's PMREM and MeshStandardMaterial shading: #131's box face is 255,189,155 (three 255,195,160; 136,76,58 before), and two grey boxes lit by the room alone are 137 and 125 (three 140 and 127; 23 and 19 before). Left open: fromScene's options.position is drawn from the origin, with a warning, and the light meter does not count a room. Filed as R3F15b in docs/r3f.feature. 2026-11-16 17:29:56 -08:00
shinyobjectz 2a5bb19904 #164: an <R3F> object scaled to 0 draws nothing, as three draws it.
three's Matrix4.decompose (0.185) gives a matrix whose determinant is 0 the scale 1 and no rotation, and sdk/r3f read every object's transform through it (scene.ts place, and the InstancedMesh, BatchedMesh and sprite paths). So scale={0}, scale={[0, 0, 0]}, scale.set(0, 0, 0) and a pop-in's frames before it starts were sent at scale 1, and raea drew the object at full size: a character popping in from scale 0 showed at full size for its first frames, then snapped small and grew. three draws an object by its matrix: at scale 0 as nothing, with one axis at 0 flattened.

src/input/decompose.ts is three's decompose where the determinant isn't 0 (the same numbers) and, where it is, each axis's length as its scale (0 for an axis scaled away) and the rotation of the axes it keeps. place, an InstancedMesh's copies (one scaled to 0 is shrunk to nothing, as a copy past count is), copies drawn as meshes, a BatchedMesh's instances and a sprite's world scale read through it. raea's engine already takes a scale of 0.

Tests: test/scale.test.tsx (a group's scale={0}, a mesh's [0, 0, 0], scale.set, a pop-in, useFrame, a flattened turned mesh, an instance and a sprite scaled to 0; its three scene tests fail on the code before, all five pass). test/scale/check.sh renders an unlit and a lit still of three boxes scaled to 0 beside a control box: 10,652 and 10,646 green pixels before, 0 and 0 after.
2026-11-16 17:29:55 -08:00
shinyobjectz 09c2df6e8c #163: a Mac app made by raea app bundle runs its page host as the launcher's child instead of exec'ing it. The launcher (Contents/MacOS/NAME, a sh script) ended with exec raea-page-host, and when the process LaunchServices launched execs another program, AppKit keeps the app's bundle id but loses its pid: NSRunningApplication's processIdentifier is -1, so window managers that find an app's windows by its pid (AeroSpace) never see the window. Measured on macOS 27.0.1 with a windowless AppKit program opened through LaunchServices: exec from sh or bash gives -1; the program as the bundle's executable, or as the child of a sh or bash launcher that waits, gives its own pid. The launcher now starts the host in the background, passes TERM, INT and HUP on to it and waits for it, ending with its status; the host still checks in as the app, since it lives inside it. Its test (macapp.rs) runs the launcher on a stand-in host that writes down its pid and its parent's: on the old launcher it fails (the host's pid was the launcher's), on the new one the host is the launcher's child, on the app's files, and the launcher ends with the host's status. engine/page/window native.rs said the exec is what gives raea.app's window its identity; it is the program's place in Contents/MacOS, and raea.app's launcher now starts its window as a child too. 2026-11-16 17:29:53 -08:00
shinyobjectz 2a98bbcb03 #162: bench/at-time checks that every still of a batch shows its own frame's time, as it does alone and as a scene stepped through every frame before it does. The fix (cdebceb9d9, a frame-pure load's plugin clock is pure: Time and the keyed rows are the frame drawn's) was held only by runtime/plugins' unit tests, and nothing drew the issue's case. Since #77 a still of a scene no plugin carries state for isn't stepped to, and the plugins' clock then never moved: every still sampled globals.time 0, and a batch's later frames drew its first frame's <Material> uniforms, which land as keyed rows. time.tsx is one 64 x 64 face with globals.time on its left half and a <Material> uniform the frame gives its time on its right, so the halves match only when Time is the frame's; its stepped twin carries an empty animation player, which Bevy carries from frame to frame, so its stills are stepped to as every still was in 0.1.0. The check draws both at 90, 30, 60 in one run and the pure one at 90 alone: each frame's halves must match, each pure frame must match the stepped one, 90 alone must match the batch's 90, the frames must move on, and the pure stills must step no frame. On the build from before the fix: globals.time 0 on every frame and the uniform frozen at the batch's first (0 and 135 levels on all three), up to 225 levels off the stepped scene. On main: 137, 188 and 225 on both halves of 30, 60 and 90, the same as the stepped scene, with no frame stepped. 2026-11-16 17:29:52 -08:00
shinyobjectz 8443ecf2e7 #159: PrepassRead lives in raea-sys-compose's passes.rs, beside RAEA_PASS's own reading of the prepasses, not in raea-sys-frame, which it took over the 2,000-line crate limit (2,008). raea-sys-post and raea-render already depend on raea-sys-compose; nothing else changes. 2026-11-16 16:32:45 -08:00
shinyobjectz 4a8c5c04ad #159: bench/aov-msaa/check.sh reads the depth's bytes in the C locale. tr in a UTF-8 locale stops on a float file's bytes ("Illegal byte sequence"), so the all-zero test failed every frame. On the fixed raea all three cases pass: the bloom ramp and the game with --aov write frames 0 to 5 with their depth and motion, and the ramp with RAEA_PASS=depth writes all six frames. 2026-11-16 16:32:45 -08:00
shinyobjectz 57e0737edd #159: --aov and RAEA_PASS keep the camera single-sampled on every frame. Both read the camera's prepasses (depth and motion vectors, depth and normals) through single-sampled bindings, so they put Msaa::Off on the camera once, with the prepasses. The camera row's post-processing then put multisampling back: raea-sys-post's sync, on the first frame whose post columns changed (a bloom ramp), restored the Msaa the camera was made with, and msaa_for_3d did it on every frame a live scene (a game) set rows. The prepasses became multisampled and the frame's bind group was refused ("Texture binding 0 expects multisampled = false, but given a view with samples = 4"), at frame 2 of a render with frames 0 and 1 written. A camera whose prepasses a pass reads now carries raea_sys_frame::camera::PrepassRead, put on with the prepasses by --aov (aov_prepasses) and RAEA_PASS (compose's mark). sync and msaa_for_3d leave such a camera's MSAA off, and sync no longer takes off a depth or normal prepass that AO brought when the AO goes. aov_prepasses finds its cameras by PrepassRead, not by the motion-vector prepass, which a motion-blurred camera already had, so that camera was never made single-sampled. The readback refuses a multisampled prepass with a message instead of handing it to the GPU, whose validation error stopped the render. Tests: raea-sys-post's a_camera_whose_prepasses_are_read_stays_single_sampled (before: Sample4 once the bloom changes); bench/aov-msaa/check.sh renders frames 0 to 5 of a bloom ramp and of a game with --aov, and the ramp with RAEA_PASS=depth (before: each refused at frame 2). 2026-11-16 16:32:45 -08:00
shinyobjectz 75c6e74d6d The R3F guide says when to set three's ambient of 0 by hand; skills pinned at raea-skills #96
sdk/guides/craft/bevy/r3f.md: Bevy lights every camera with a white ambient of 80 cd/m², which three never has, so a
three.js scene's metals and dark surfaces glowed where three draws them black (a product shot on black: crop SSIM 0.83,
0.996 with the ambient matched). <R3F> sends an ambient of 0 since 0.1.6 (IR2); the guide says to add it by hand on 0.1.5
and earlier and in a three.js scene rebuilt with raea's own components, and that raea's ambient lights the specular too.

skills: raea-skills #96 (4f32e4b), the guide's copy and reference/files.md's row for the JS heap log
(~/.raea/logs/js-heap-, perf-js-upkeep below).
2026-11-16 16:29:45 -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 db3cbfcaf5 IR2, IR5: an R3F scene's lights and overlays as three draws them
IR2: a three.js scene with no ambient light kept Bevy's default GlobalAmbientLight (80) in raea, which lights every
metal evenly where three leaves it black outside its highlights. input/scene.ts now sends an AmbientLight of 0, white
so it lends no colour, when the scene has none; raea sums a camera's ambient lights, so a composition's own beside the
<R3F> is kept. The engine's global ambient is unchanged (Shane's call). Under direct light the earbuds' case goes from
SSIM 0.83 to 0.996 on the model's crop, the Gerber knife 0.94 to 0.98, the chest 0.88 to 0.94.

IR5: a material with depthTest false (a mascot's face decals on its body shell) was drawn depth-tested and lost. A
basic one is now three's own basic program (builtinPart, as matcap and normal are), a standard or physical one its
patched program, and a ThreeShaderMaterial without the depth test is drawn with the transparent ones, after everything
opaque. The mascot's face is drawn (0.96 to 0.99). renderOrder among such overlays still needs a sort bias in the
engine (left open in IR5).

R3F8's 43 cases score as before (in-drei 0.9935 to 0.9943); sdk/r3f's tests: 2 new, the one failing coverage row fails
on main too.
2026-11-16 16:06:41 -08:00
shinyobjectz 25afb7cbf5 IR1-IR14: docs/img2raea.feature, img2threejs's output held to three.js and made raea's own
The 11-16 goal: three.js parity, an img2raea skill, environments, scene data, and where procedural, neural and
measured methods belong. An img2threejs factory already draws in raea unchanged (<R3F><primitive>); the spec plans the
rest: the showcase as a local parity corpus scored on the model's crop under four rigs (IR1), the five R3F gaps it
found (IR2 Bevy's default ambient light leaking into scenes with none, IR3 ambient lighting specular, IR4 anisotropic
metal, IR5 depthTest-off overlays, IR6 window.location), img2threejs's --target raea-tsx plugin with raea as the
render authority for its gates (IR7), the method in raea's own skill (IR8), a trial on our own pictures (IR9), scene
data both ways (IR10-IR12), places from one picture (IR13) and the map of models and procedures with their licences
(IR14).
2026-11-16 16:06:41 -08:00
shane 1046ee9a83 Merge pull request #166 from wackyza/layers-spec
Spec: a render in layers for CapCut, Premiere, Resolve and raea's timeline (docs/layers.feature)
2026-11-16 14:50:12 -05:00
Zachary GuglinandClaude Opus 5.5 dc2e7a56bb layers spec: a render in layers (captions, text, graphics, footage, under, sound) for CapCut, Premiere, Resolve and raea's timeline
docs/layers.feature LA1-LA7: captions and text marked (data-raea-role), a transparent pass per layer only at export
(a render outside an export stays one pass), the layers composited back checked against the reference render, one
editor-neutral layers.json behind raea export layers, capcut, premiere and resolve (FCP7 XML), captions as a styled
movie with an .srt beside it, reference.mp4 in every export's folder, and raea's timeline laid out the same way.
Spec only; no code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 10:55:46 -08:00
shinyobjectz 977ec312aa grab: a take's look turns the head and neck no more than 30 degrees together (LOOK_MOST); the eyes go the rest of the way. Each joint was capped at 55 on its own, up to 77 in all, and a cup held out at chest height bowed the taker's head onto it. 2026-11-16 10:18:27 -08:00
shinyobjectz 9aee93e518 raea bug: an agent reports a bug in raea itself to raea's server, headless and with no account
Agents using raea, in the app or in a terminal, had no way to tell raea about a bug they hit. raea bug TITLE... --text TEXT [--command CMD] [--error TEXT] [--agent NAME] [--dry-run] posts to raea.io/v1/bugs/agent: words only, raea's version and the OS added by the host (native.ts, curl; RAEA_API names another server), paths, emails and key-shaped strings taken out before it leaves (the server scrubs again), the harness as the agent unless --agent or RAEA_AGENT says. It reads no keychain, so it never raises a prompt in a headless run. The server counts the same bug again on the first report and takes five a day from a machine; --dry-run prints exactly what would go.

engine/cli/conformance/bug.test.ts (5 tests, the command's side with the host faked); docs/manual/reference/cli/bug.md and the index row (Agents and setup).
2026-11-16 07:23:37 -08:00
shinyobjectz 32dcec11b9 PL7: an agent finishes what it planned. A task marked done with a checkbox unticked or a subtask open is refused by the plan tools (plan_close, plan_update's state), naming each by place or id, as Org's org-enforce-todo-dependencies refuses; plan_close's all: true ticks them and closes the subtasks with it, and ticked in the same call it closes. Shane 11-16: "i notice often that it makes tasks but never completes them itself": v0.1.5's agent closed five tasks with every box unticked, so the list read 0/4 on finished work. docs/plan.feature PL7 says the rest, which is the app's (raea-feed plan-finish: raea asks an agent to settle its own open tasks each time it stops).
Checked: bun test (org, edit, extend, tools) 33 of 33; the app's vitest 1621 with these files; e2e chat-plan in raea's window, where a real ACP stand-in's close without all is refused and its retry with all: true closes.
2026-11-16 06:47:24 -08:00
shinyobjectz 3a646fa4bb CH45c: footwear is a hard piece, and garments layer by where they lie
raea clothes cover --hard [--sole MM] [--sole-colour #RRGGBB] [--panels #RRGGBB,...] makes footwear as its own mesh. Each foot gets the convex hull of the skin it covers, remeshed even, corners rounded and the collar opened over the leg. A flat sole sits under it, set out, in its own colour up the side. A toe cap, a heel and a side band take the panels' colours. It is skinned from the nearest covered skin and does not swing. Shoes laid on the skin read as bare toes.

tools/garments/outfit.py turns a description into garments. Footwear is hard; the sole's thickness and colour and the panels come from the words.

hide_under.py leaves out an inner garment's faces where they lie straight under an outer one's face (within 3 cm, at most 2 mm sideways), not only where a ray meets it.

The manual's clothes page describes the new flags. CH15c records the user's look at the Kimodo eval: all ten do lines read right.
2026-11-16 06:44:18 -08:00
shinyobjectz 28f4c2289b skills pin: raea-skills #93 (86d323a): appscreen's motion/apps.md copy (80067cc, pushed and merged), with #91's characters guide and #92's reference/feed.md (plan_close, raea-feed #61), whose stale copy failed every lane's L0 and L1 2026-11-16 06:44:04 -08:00
shinyobjectz 80fbde3c58 H12: app::bundle takes the props its default export is mounted with (WINDOW, SCREEN) in place of two one-line forwarders; the app screens' log read through screen::logged (no new duplicate groups: 292 exact, 59 near) 2026-11-16 06:43:49 -08:00
shinyobjectz c30bcfbbef H12: what reached the app screens (Routed: routed, logged, read back) in raea-runtime-appscreen, and an app screen's texture handed over as bevy's; live play's needs_react in its own file (raea-runtime-page under 2000 lines, runtime/live/src/lib.rs under 500, no new duplicate groups) 2026-11-16 06:43:49 -08:00
shinyobjectz 3ad88f635a H12: done. docs/blitz-bevy.feature H12 @done with its status (ts-native P27c points at it); the appscreen bench (sdk/raea/bench/bevy/appscreen: a button clicked through the 3D, its own timer on the frame's clock; check.sh 9 PASS) and its bench/render-play row (1.000000 at frames 6, 12, 18 and 27; the bench 14 of 14); the apps guide, <Screen app>'s doc and the manual's reference; skills pin: raea-skills #89 (80067cc), motion/apps.md the same guide 2026-11-16 06:43:49 -08:00
shinyobjectz 3cd7f72b4b H12: what reached an app screen in a play is logged and rendered again; exported games bundle app screens as apps
Live play routes the pointer, wheel and keys to an app screen through the 3D (screen.rs route); its input log now keeps what reached the app screens each frame under `apps` (BevyPage::app_input) and leaves the keys they took out of the page's, and raea render --input gives the app screens the same (screen.rs APP_LOG), so the render draws what was played. Live play sets the app screens' frame each step. export-game writes each app screen's X.tsx.surface.js and .surface.css with the new bundle, and its check for the old surface runtime (a marker no player has had since Blitz left) is gone: every player draws app screens on its own Blitz page.
2026-11-16 06:43:49 -08:00
shinyobjectz 2262e1cc7d H12: <Screen app> drawn on a Blitz document of its own
raea-runtime-appscreen opens each app screen's module on a BlitzPage of its own at the screen's size, on the shared device, with the CSS its modules import and Tailwind's for its folder (or an exported game's prebuilt X.tsx.surface.js and .surface.css). It is stepped once a frame: the input route() gave it as Blitz's pointer, wheel and key events, then one update that runs its JS on the frame's clock, and paints; the draw's later updates while faces load only paint. runtime/page's sync steps every app screen (screen.rs step_all, at at_frame's frame in a render and set_app_frame's in live play) instead of saying it isn't drawn, and its picture goes with the nested screens' (screen_textures, frame_all) to Engine::copy_screen or set_screen_picture.
2026-11-16 06:43:49 -08:00
shinyobjectz 4f354e97fc H12: a held JS clock and an app screen's bundle
raea-runtime-jsengine at_clock(ms, f) runs f with this thread's JS clock (the timers' now and performance.now) held at ms, so a root stepped on a composition's frames sees the same time in a render and its play. raea-runtime-bundle-lib app::bundle_screen bundles a module as an app is, its default export given {width: innerWidth, height: innerHeight}: an app screen's, one bundle for a screen of any size. bundle_surface (real react-dom/client into #root, the old Blitz surface's entry) is gone; nothing calls it.
2026-11-16 06:43:49 -08:00
shinyobjectz 1afb2de58d The characters guide says how clothes are made now and teaches raea motion. Clothes: raea clothes make sews a garment from a sewing pattern cut to SOMA (--plain, --set PATH=VALUE, settings), make with words takes the pattern from them, cover lays a skin-tight one on by procedure, wear takes --body and --head; the picture-measured method it described is gone. Motion: an act no capture holds is made from its words with raea motion (Kimodo on MLX), between standing keys, three seeds a line through makedo.ts, the first use's downloads said. Closes L1's skills coverage warning for raea motion. 2026-11-16 02:27:51 -08:00
shinyobjectz b0cd52fd85 A written scroll offset reads back to a hundredth, as raea's window gives it back each frame (sdk/ui's DOM layer)
The host's geometry each frame has every number to a hundredth (systems/page snapshot.rs), scroll offsets among them, and the page's scrollTop read a written offset back unrounded. A write of 1074.9931 then looked like a move the next frame took back to 1074.99. use-stick-to-bottom's spring keeps the part of a step that hasn't moved yet, as Chrome's snapping to pixels needs: here it threw it away each frame, its steps under 0.005 never arrived, and it wrote every frame for good. In the app's chats a long transcript's last turn never held still after a turn ended (the feed's smoke 30 and 37 failed in full runs on it, "moving"), and the window redrew it every frame.

Now a write is held to a hundredth, as the host will show it, the way Chrome snaps a written offset at once: the spring's steps add up and it arrives (1075 in about a second, then still).

sdk/ui/test/scroll.test.tsx: a spring stepping under a hundredth a frame, with the frame's geometry to a hundredth, arrives within 10 frames; it failed before the change (read back 74.9931 where the host shows 74.99). bun test test: 65 pass.
2026-11-16 01:45:01 -08:00
shinyobjectz b5425278b3 CH15c: Kimodo on this Mac. raea-sys-kimodo runs Kimodo-SOMA-RP-v1 and its LLM2Vec text encoder (Llama 3 8B Instruct in 8 bits) on MLX in Rust, with no Python and no cloud GPU; raea motion "LINE" [--keys KEYS.json] writes the clip sdk/body/tools/fromkimodo.ts reads
Checked against the PyTorch reference (tests.rs, fixtures in ~/.cache/raea-kimodo/mlx/ref/rust):
- the denoiser within 2e-3 on its features (two batches, padding, constraints, headings);
- a whole 100-step generation from the same noise and text within 0.002 cm at worst on the 77 joints;
- constraints become the same conditions (mask equal, values within 1e-4);
- the 8-bit encoder at cosine 1.000000 to the Python MLX 8-bit run and 0.999929 to float32 (over eight lines, the motion's joints move 0.01 to 0.74 cm on average and 1.44 cm at worst, against float32 text).

Kimodo's post-processing (its C++ foot-skate and constraint clean-up) is not ported: clips are post_processing=False. A seed here is not that seed in the cloud (PCG32 noise, not torch's).

raea motion is in the manual's CLI reference (docs/manual/reference/cli/motion.md, under "Generate and 3D tools", every flag described, a do line made between standing keys). The crate's small helpers that copied ones elsewhere are written once or rewritten (floats, cross, round, the .npy words, the clip's slug), so dupes stays at 292 and 59; dyn-clone leaves NOTICE's catalog list, since the motion crate brings mlx-rs (which uses it) into a plain raea build. SKILL.md:19 (which workspace, which project): checked, still true; raea motion takes no project and writes where -o says.
2026-11-16 01:43:08 -08:00
shinyobjectz 373b47b964 A page's <img> (and url(), @font-face) of its own /host/* loads from its host in raea's window
raea's window sends the page's fetch of /host/* to RAEA_PAGE_HOST (page-net host.rs), but what the page loads by itself went through FileNet, which looked for /host/* among the page's files and found nothing. An <img src="/host/attachment?..."> drew an empty box: in the feed, a picture attached to a note showed nowhere in raea's window (smoke's "a comment takes files" read naturalWidth 0), and a library's posters on Publish were blank. The feed now reads those through fetch (HostImg), as its other host pictures already were.

FileNet now takes the page's own http://localhost/host/* from the host, as the fetch does (host::load, GET with its query; nothing without a host, or for an answer that isn't 2xx).

systems/page-net/tests/page_host.rs: a load of /host/attachment?... reaches the host with its query; a /media/ path and another origin's /host/ aren't the host's; a host that's gone gives nothing. cargo test -p raea-sys-page-net: all pass.
2026-11-15 23:44:57 -08:00
shinyobjectz 2b9a95366a A React page's getComputedStyle reads a colour and a custom property from the host (sdk/ui's DOM layer)
In DOM mode (a React page in raea's window: the feed), getComputedStyle answered every property from the page's own cascade, which knows boxes and the classes libraries read but not stylo's: a class's colour came back rgb(0, 0, 0) and a var() empty. The feed's starred project mark read black for its gold star (its smoke test 67), and the spectrogram's colours fell back to defaults. Such a page now asks the host (style.computed, as an HTML page asks for every value) for colours, fill, stroke and custom properties alone; display, sizes, transforms and the rest stay call-free.

sdk/ui/test/dom.test.tsx: a React element's display is answered with no host call, its color, background-color and --accent from the host by its wire id; with no host, the page's own value as before. bun test test: 64 pass. The feed's smoke 67 passes in raea's window.
2026-11-15 23:42:56 -08:00
shinyobjectz 4a27753595 CH45c: the clothes help says what make does now (sews from a GarmentCode pattern, settings, cover --over); the manual page and index follow it 2026-11-15 23:40:50 -08:00
shinyobjectz ab0fc62c4c CH45c: raea clothes make sews; the picture-measured garments are gone. make NAME ["WORDS"] [--plain] [--set PATH=VALUE,...] [--colour] makes a sewn garment in the project (a GarmentCode pattern from the words model or the plain base, settings changed by path and checked, cut to SOMA, draped by our cloth, baked: tools/garments/sew.sh, engine/cli/src/sewn.ts, which sets up raea's models folder the first time); settings lists the settings; wear takes sewn garments beside ones laid on the skin and leaves out the skin under them (hide_under.py). Taken out: make by four drawn pictures, remeasure, the mannequin's views (wardrobe.ts's drawing, garment.py's measure, mannequin.py). A tee and trousers by settings in 18 and 28 s, $0, walk as clothes on the generated person. With the earlier garment session's nearest-design fallback (garment_model.py, words.sh, sheet.py). 2026-11-15 21:30:44 -08:00
shinyobjectz 0cf78fb053 CH21b: generated hair moves on the follower. The plan and the numbers: a head's hair cards carried through a performance by the cloth follower, laid over the body at rest and kept outside the skin as drawn, drawn as a Character part with raea's hair shader (3,874 free particles in the skin carried by the head alone, 223 on the follower, on the first head's loose hair over SOMA's locomotion clip). 2026-11-15 21:05:41 -08:00
shinyobjectz 6d8a15ac55 A scroll event no longer puts back an offset the page wrote past (sdk/ui's DOM layer)
The host's scroll event carries the offset it had when it committed, and the DOM layer took it over as scrollTop. A page that had written another one since (each write is sent and shown at once) was put back a step. Two scrollers kept in step, the app's timeline tracks and their heads, then each put the other back, every frame, for good: after a quick drag of the tracks' scroll thumb in raea's window they cycled through five offsets and never stopped (logged event by event in the feed's timeline-nav N1).

Now each scroller keeps the values it wrote that the host hasn't told back. An event carrying one of them retires it and those before it, and if newer ones are still out, the newest written stands: as in Chrome, where a scroll handler reads the offset as it is now. An event carrying a value the page never wrote is the host's own (a wheel, a clamp) and stands.

sdk/ui/test/scroll.test.tsx (the scroll tests moved out of dom.test.tsx, which was over 500 lines; its snapshot helpers shared from test/host.ts): a stale event leaves the newer offset, the host's own stands; two scrollers mirrored both ways, with the host's events a frame late, settle. Both fail without the change (the pair still had 10 events due after 20 frames). bun test test: 62 pass.
2026-11-15 20:57:02 -08:00
shinyobjectz cdebceb9d9 #162: a load with nothing to step has a pure plugin clock: Time (Time<Virtual> too, which the fixed loop copies back) and the keyed rows are the frame drawn's, f / fps, however it was reached. Since #77 skipped the replay, the clock stepped only on the frame after the last stepped: every still sampled globals.time 0, and a batch's second frame drew the first's <Material> uniforms (keyed rows) and component rows. Measured on a face split into globals.time and a uniform from the frame, as seconds: before, lone 60 = 0 / 1.96, batch 30,90 = 0 / 0.97 and 0 / 0.97; after, lone 60 = 2.01 / 2.01, lone 90 = 3.01 / 3.01, batch = 1.00 / 1.00 and 3.01 / 3.01. A stepping clock is unchanged. 2026-11-15 20:33:14 -08:00
shinyobjectz 523fd30929 CH20c: the eyes take a look target. <Character gaze={point}> turns each eye joint to a point in the scene on top of the pose, in its head's frame, within an eye's range (35 degrees to a side, 25 down, 17 up), so the eyes cover what the head has not turned; a part that has the eye joints has its upper lids ride the eyes down (blink morphs raised to 0.45 at the lowest). character/eyes.ts: eyesTo, lidsFor, EYE_RANGE. 2026-11-15 20:31:57 -08:00
shinyobjectz 688e99c971 Blitz: an element styled for the first time is built and laid out from scratch. Stylo gives a first style no damage and clears the data of everything under a display: none element, so a node added under a hidden element kept the layout children it was collected with unstyled (none): showing the element drew it as its padding with nothing in it (the app's notes rail, closed while a note was posted, opened on an empty row; its marks spec failed on main too). 2026-11-15 20:28:16 -08:00
shinyobjectz 71b354007f CH20b: the body's skin is graded to the head at the collar. raea clothes wear takes --head HEAD_DIR: the body it dresses takes the head's neck colour, and each vertex under the collar the colour the head's own skin has above it (head.json's ring colours, evened round the ring), easing into the neck colour 8 cm down, as vertex colours on body.glb (engine/cli/src/grade.ts, plain byte arrays so the native raea runs it). Measured on the first head: the step across the collar at the front from 8 levels of 255 to under 1, 1 to 4 round the rest. 2026-11-15 20:23:54 -08:00
shinyobjectz 8883c30c53 SOMA's body is built with its skin samples on the joints a pose turns (tools/clothes/body.py). SOMA hangs skin on twist joints (all of an arm's and a leg's), the bone in the palm under each finger and the end joint past each fingertip, which no pose, clip or solver turns: left there, a hand on a cup was 12 samples of palm, no forearm, and fingertips 2 cm short. Each sample keeps its part and is written from its carrying joint, its weights summed. A body built this way reads the same in the hands' audit as one mended after. 2026-11-15 20:14:20 -08:00
shinyobjectz 9586aa9689 HG19: a take's hands stay out of the table and the body on SOMA. A reach leans the chest, and the second hand's lean carried the first hand 6 cm off its hold with its fingers still shaped for it: every hand but the last is solved again with the trunk left where it is. A travelling hand keeps off solids by its skin as its fingers are that frame. The audit's standing pose hangs the arms clear of the thighs (SOMA's fingers hung 31 mm inside them before any take). Five of six takes: 0 to 2 mm of hand in the thing, none in the scene, 0 to 6 mm in the body's own solids, all five pads of each holding hand on. The scenario filed as HG17 is HG19 (HG17 was taken). 2026-11-15 20:10:55 -08:00
shinyobjectz 760aea017d HG17: the palm's height read in one chain of samples (the thumb's ball joined before the heights are taken). 2026-11-15 19:56:08 -08:00
shinyobjectz 1c004cc225 HG17: the thumb's ball joins the palm's height in one chain (no closure that copies another crate's). 2026-11-15 19:53:58 -08:00
shinyobjectz a0f85c9023 HG17: the skin's weighted placement is the body crate's (Skeleton::carried, which skin() reads too), so the curl's clearance uses it and the grab crate stays under its size limit. 2026-11-15 19:52:06 -08:00
shinyobjectz fc32762987 HG17: on SOMA's own skin a held thing has no skin of the hand in it. A finger joint stops bending when any bone past it meets the surface (a knuckle bent onto a box's face carried the next two bones 24 and 35 mm in); the curl reads each bone's skin where its joints carry it by their weights, as it is drawn; the hand's frame sets the palm's height on the ball of the thumb too, and only on skin the hand mostly carries. The audit on SOMA, worst over each take: 0 to 1 mm of hand in the thing (3 mm passing a cup hand to hand; was 17 to 36), 4 to 5 pads on, palm 1 to 6 mm off. Its palm gap reads the ball of the thumb with the palm. 2026-11-15 19:50:06 -08:00
shinyobjectz 9365faa43b CH14b: done. The locomotion suite's eight cases pass on SOMA (0 before), and 45 of 48 with 40 paths drawn at random beside them: what each failure was (hip pops, the run's curve, a run's corner, the head on curves, slides), what was tried and taken back, and what is left (three paths 34 to 39 cm off their line at a sharp turn). The code is the private body SDK's (58fed86, 4b1781f) 2026-11-15 19:36:20 -08:00
shinyobjectz 7c32e7cec9 CH14: the cause of the run pops found and fixed in the private body SDK (a switch now carries the hips' speed over the floor): pops 36 to 21, at switches 31 to 12, every other number unchanged 2026-11-15 14:42:19 -08:00
shinyobjectz e8ee46d96e R3F27: done. docs/r3f.feature R3F27 @done with its status; the r3f guide on the box's width and height and on pointer events in a live play, its "not wired yet" line gone; skills pin: raea-skills #88 (d6ba112), 3d/r3f.md the same guide 2026-11-15 14:40:10 -08:00
shinyobjectz 4b1686f254 R3F27: an edit drawing R3F plays live on React
Live play ran every composition on raea's lite runtime, which can't run R3F's reconciler: the bundle failed ("use" isn't exported by lite), so an <R3F> never played live. raea-runtime-live's needs_react scans the edit's own sources for raea/r3f or @react-three/, and such an edit now plays on React, as RAEA_LIVE_REACT=1 does; an exported game the same. The baked-timeline path still bakes on lite.
2026-11-15 14:39:58 -08:00
shinyobjectz fbcc03fc38 R3F27: R3F's pointer events and drei's OrbitControls in a live play
raea's input, frame by frame, goes to R3F's canvas as the DOM events a browser would send (src/input/pointer.ts): the move, the presses, a release and its click, the right button's context menu, the wheel and the pointer gone, each against the frame before, with the modifier keys held. The root runs R3F's own event manager on a stand-in canvas that is an event target (also the renderer's domElement), whose document gets the events that bubble, so R3F raycasts each through its camera and calls the handlers on the mesh it hits, and OrbitControls turn and zoom the camera. A step sends its frame's events before it renders, inside flushSync; a render with no input sends none, and a root stepped again from frame 0 sends the same. An <R3F> in a box takes the pointer in its box (page.viewBox), scaled to its width and height.

test/esm.ts loads drei and three-stdlib as ESM, since their CJS builds pulled in a second three and broke OrbitControls' instanceof. test/pointer.test.tsx: 7 of 7. bench/render-play gains the row sdk/r3f/test/live/pointer.tsx (hover, click, a drag), which plays and renders the same frames at 1.000000.
2026-11-15 14:39:46 -08:00
shinyobjectz 14180f3dfe R3F25 follow-up: the passes a composer frame keeps are read from its post parts and its compute part as well as the scene's (computes counted before passes), so a pass only an effect or a compute reads isn't pruned 2026-11-15 14:39:44 -08:00
shinyobjectz 6665a2e5a8 R3F25: a ShaderMaterial under a composer is scene light, and the composer's own passes aren't drawn. three draws a scene that goes through a composer into the composer's float buffer, where a ShaderMaterial's colour is scene light and its tone mapping and colour space includes do nothing; sdk/r3f sent it as "display", so raea drew it darker and more saturated than three's, out of reach of the composer's tone mapping and encoding. Under a composer it now goes as "linear" with linearToOutputTexel the identity (shader.ts composing): in-shaderbloom, a ShaderMaterial and a faint bloom (test/parity/post2.tsx, tools/parity.sh), goes from 0.9758 to 0.9848, the ball's mean colour from 133,66,33 to 186,135,96 against three's 194,145,110. The passes a composer draws into its own targets, which R3F23 put on raea's GPU, are dropped when raea draws the composer as its own effects: targets.ts passesOf keeps only the passes whose pictures the frame reads, directly or through a kept pass. One bloom was 17 cameras (the scene drawn again into the composer's buffer, and 16 quads for its luminance and mip chain) and is now none, while a target the frame shows is still drawn (test/composer.test.tsx, 3 tests). in-post's frame is the same to the pixel; the full parity list of 42 passes; docs/r3f.feature R3F25 status 2026-11-15 14:15:53 -08:00
shinyobjectz 80d3edb1de skills: raea-skills 6c8f414 (PR #87: 3d/r3f.md lists patched materials and render targets as drawn) 2026-11-15 14:10:21 -08:00
shinyobjectz 20290ff51c R3F24: done. in-patched 0.9717 (drei's MeshWobbleMaterial and MeshDistortMaterial, an app's own waves kept through userData.shader) and in-reflector 0.9256 (drei's MeshReflectorMaterial, which closes R3F23) against three.js, both in tools/parity.sh; the full list of 41 passes, every other case as it was. docs/r3f.feature tags R3F23 and R3F24 @done with their status; the r3f guide lists patched materials and render targets as drawn 2026-11-15 14:07:04 -08:00
shinyobjectz 2a8ea0b81b R3F24: a MeshStandardMaterial or MeshPhysicalMaterial with an onBeforeCompile of its own is three's own program with the patch applied (src/input/patched.ts): ShaderLib's source handed to the patch with the material's defines and uniforms, patched once a program as three does, the material's values refreshed into it each frame, the defines three puts in front for its maps, sides and vertex colours; the fragment cut at three's lights and writing its surface for raea's engine to light (the lit GLSL stage). A patch past the lights is named once and left out. kinds.ts notes; material.ts routes it, scene.ts leaves its uvs as three gives them. test/patched.test.ts 2026-11-15 14:07:02 -08:00
shinyobjectz f3bc3db45a R3F23: a pass camera draws with its projection matrix's lens (passes.ts lensOf): its fov, and its aspect where that isn't its target's shape, which the engine keeps whatever the image's shape (a rendercam's aspect column; matchmove's OffAxis, never copied to a look's camera). drei's reflector copies the screen camera's 16:9 projection into a camera of its own (fov 50, aspect 1 as made) and draws it into a square target: its reflections were stretched and low 2026-11-15 14:07:00 -08:00
shinyobjectz 3f37f7c2a2 R3F24: the white picture a ShaderMaterial gets for a texture with no picture (shader.ts WHITE) decodes: it was a broken PNG (its data cut short, its CRC wrong), so the engine refused every material given it and drew it in its colour. test/shader.test.ts: both stand-in pictures decode (white, opaque black) 2026-11-15 14:06:59 -08:00
shinyobjectz fcd055cca3 R3F24: a three shader's GLSL can write a surface Bevy lights (glsl.rs Source lit, the spec's glsl.lit): its fragment stage's four outputs in turn (base, normal and roughness, emission and metalness, the point in world space) returned as ThreeSurface through three_surface, its varyings carrying the instance, as a lit TSL material's do (surface.rs); a lit stage without four outputs is refused by name. Test: a lit stage returns its surface 2026-11-15 14:01:01 -08:00
shinyobjectz ecef2fee13 R3F26: done: docs/r3f.feature tags R3F26 @done (#130: an <R3F> in a box smaller than the page drawn as its box's own view, landed 3e391e2af, 190ced1d1, b2f2f2af3) 2026-11-15 13:59:57 -08:00
shinyobjectz 10f0c61354 R3F22: parity case in-tsl-fbo: in-fbo's lit knot drawn into a target every frame and shown by a MeshBasicNodeMaterial's texture node under three's WebGPURenderer, SSIM 0.9397 against three.js (test/parity/tsl.tsx, tools/parity.sh) 2026-11-15 13:58:29 -08:00
shinyobjectz f2372ad82b R3F22: an unlit node material's colour is tone-mapped by Bevy's own tone_mapping after the camera's colour grading (three-shader tone.wesl, the prelude importing it where the camera tone-maps in its materials' shaders), as a lit or standard material's is. It had a curve of three-shader's own without the Grade exposure that stands for three's ACES 1/0.6, so it came out darker and redder: in-tsl-particles 0.9510 to 0.9799; in-tsl-lit, in-lettra, in-tslpost and in-tslpost2 unchanged. module.rs test: the prelude's import and the entry's tone_mapping. docs/r3f.feature R3F22 status 2026-11-15 13:58:29 -08:00
shinyobjectz b2f2f2af3d R3F26 (#130): the view a camera on the Engine's target draws moves to a crate of its own, raea-sys-viewbox (TagRowTarget, ViewBox, tag_row_view), with two tests: a box laid out after the first frames takes the camera's view and gives the frame's Viewport back when it goes, and a camera's own Viewport is left as it is. raea-render goes from 2,009 lines to 1,972, back under rask's 2,000 2026-11-15 13:56:56 -08:00
shinyobjectz 190ced1d1f R3F26 (#130), SDK: <R3F width height>, the box's size, and docs/r3f.feature R3F26 done
<R3F> takes the box's width and height in frame pixels: R3F's own size (useThree's size and viewport), its camera's aspect and an orthographic camera's frame are the box's; by default the frame's, as before. raea draws the scene in the box it sits in either way (the engine's fix in the commit before). An orthographic plane R3F frames at zoom 40 is 80 px in a 400 x 300 box with them, as three draws it, and 40 px without. A width or height that isn't a size above 0 is refused, naming it. docs/r3f.feature R3F26's status: the cause, the fix and #130's five cases measured.
2026-11-15 13:50:51 -08:00
shinyobjectz 3e391e2afa R3F26 (#130), engine: a camera in a page element draws its own view in the element's box (docs/sdk.feature S3a), not the page's cropped to it
engine/render target.rs tag_row_view gave a camera on the Engine's target a w x h Viewport (the frame above the tag row) on the frames before the page had laid its box out, a render's first draws, and skipped any camera with a Viewport after that, so a box's sub view (SubCameraView: the box's size as the full view, offset by its place) never came. The Viewport it gives (`ours`) is now taken off when a box comes, and given back when the box goes; a camera's own Viewport (a ViewportNode's) is left as it was. Viewports are compared by place and size (bevy_camera's Viewport has no PartialEq).

#130's five cases, a 2 x 2 plane at the origin seen from z 5 in a 400 x 400 box: on a 600 x 600 page at fov 90 it is 80 px and centred in the box (was 120 px, centred on the page); at fov 32, 278 px (three: 279; was the whole box); at 1080 x 1920, 80 px in the box (was nothing); at 2160 x 3840 with the box at (800, 1600), 80 px in the box (was the whole box). raea's own camera in a box drew the same way and is fixed with it.
2026-11-15 13:50:51 -08:00
shinyobjectz ca825d79ae skills: raea-skills 342e0fc (PR #86: reference/cli.md has raea clothes, from main's help at 68f70eb1e; the strict rc gate failed on it) 2026-11-15 13:49:48 -08:00
shinyobjectz 68f70eb1e6 R3F23d: in-fbo 0.9941 and in-pingpong 0.9949 against three.js at frame 12, both now in tools/parity.sh (the ping-pong case clears to black, as three's canvas does under it); the full list of 38 passes. docs/r3f.feature R3F23 says what R3F23c built and what is left: in-reflector, an onBeforeCompile patch (R3F24) 2026-11-15 13:37:03 -08:00
shinyobjectz e67910028a R3F23c: a DataTexture keeps its rows in order (texture.ts bytesOf turned a flipY=false one upside down, on maps and in shaders): its first row is the picture's top, Bevy's v 0 as it is three's unflipped; a test reads the PNG's rows back 2026-11-15 13:37:01 -08:00
shinyobjectz 6a2646b5a5 R3F23c: a still with a camera into a render image steps every frame before it (runtime-scene carries_state), so what a pass drew lasts: a ping-pong's start drawn at frame 0 is there at frame 12 2026-11-15 13:36:59 -08:00
shinyobjectz f1292b4db0 R3F23c: a three shader drawn into a render target writes its colour as it is (raea-sys-three-shader output "target": no tone mapping, colour space or exposure, and it doesn't follow the screen camera's tone mapping), as three tone-maps and encodes only what it draws to the screen; passes.ts marks every ThreeShaderMaterial on a pass's layer so 2026-11-15 13:36:57 -08:00
shinyobjectz 53b5da60b3 R3F23c: the engine's load empties its render images before its rows spawn, not after (runtime/plugins apply_rows reset them once the rows were in, so a three:uniforms row naming a render image made a second, blank image under the same name and every ShaderMaterial reading a target read black) 2026-11-15 13:36:44 -08:00
shinyobjectz 6ef6c573fd skills: raea-skills 4919fa9 (PR #85: reference/files.md, ~/.raea/cache is also RAEA_EMOJI3D_CACHE, as raea-feed's main keeps it) 2026-11-15 13:34:15 -08:00
shinyobjectz dbe00072b6 skills: raea-skills 5fab9ca (PR #84: 3d/r3f.md, TSL compute runs) 2026-11-15 13:30:41 -08:00
shinyobjectz f2429a0b97 R3F22: the r3f guide lists TSL compute as drawn (renderer.compute and computeAsync on raea's GPU, storage buffers shared with node materials, an InstancedMesh's node material drawn as copies) and names what a compute can't use yet 2026-11-15 13:30:37 -08:00
shinyobjectz 66f8c17a1d skills: raea-skills d0eb0fd (PR #83: 3d/r3f.md lists three/webgpu's PostProcessing as drawn) 2026-11-15 13:25:47 -08:00
shinyobjectz 80d07fda07 R3F25 (part): three/webgpu's PostProcessing as raea's effects, an additive Bloom, a FramePass's frame() clamped to its Viewport
three/webgpu's PostProcessing (RenderPipeline) draws one QuadMesh whose fragmentNode is the whole chain. sdk/r3f's stand-in renderers (renderer.ts for R3F, program.ts for a plain program) hand that quad to src/input/tsl-post.ts. It walks the graph for the pass(scene, camera) the chain starts from, which raea draws as the frame, and for the nodes the frame goes through, in order. Bloom, GTAO, depth of field, FXAA, SMAA (TRAA and TAAU as SMAA), SSAA and pixelation become raea's own effects. film, dotScreen, rgbShift, chromaticAberration, lut3D, sepia and bleach become FramePasses doing what their setup() builds (effects-tsl.ts). The output's tone mapping and three's exposure become raea's tone mapping and Grade exposure. post.ts reads them as it reads a composer's effects. The other display nodes and an Fn of the app's own are named once. kinds.ts TSL_POST names every post node three ships, and a test holds it to three's own list.

Bloom gains `additive` (the bloom_additive column; Bevy's Additive composite). three's UnrealBloom adds its glow on top, where Bevy's natural bloom takes the light from around it and darkened the rest of the frame. A TSL bloom is raea's additive Bloom at 4 times its strength.

systems/framepass: frame() read past the edge takes the frame's edge pixel, as a clamped texture does, never the tag row under the Viewport (a chromatic aberration drew a teal line along the foot). depth() and normal() clamp the same way.

COMPONENTS.FramePass and COMPONENTS.Fragment move into parts.tsx's table now that R3F22 has landed.

Tests: test/tsl-post.test.ts (a program's pipeline: the pass's scene drawn, bloom, film and ACES with exposure; an effect after renderOutput() runs after the tone mapping, sepia() known; a node with no counterpart named; every node three ships covered), runtime/look's an_additive_bloom_says_so_and_a_natural_one_doesnt, framepass's prelude test. The parity cases in-tslpost (bloom, 0.9737) and in-tslpost2 (sepia and chromatic aberration, 0.9233) in test/parity/tslpost.tsx; the full parity list of 36 passes unchanged. The guide's Drawn paragraph lists TSL PostProcessing, docs/r3f.feature R3F25's status says what's done and left, and the manual reference has Bloom's additive.
2026-11-15 13:21:02 -08:00
shinyobjectz 47a93b740a R3F22: test/targets.test.tsx: a MeshBasicNodeMaterial reading a target drawn in useFrame names the camera's image, read as sRGB, its samples turned over in v (texture.ts flipsY, targets.ts onGpu in tsl.ts) 2026-11-15 13:18:38 -08:00
shinyobjectz 24fadef05e R3F22: a TSL node material reads a render target raea draws on its GPU as a ShaderMaterial does (texture.ts flipsY, targets.ts onGpu): its samples turned over in v, since the camera's image counts rows from the top where three's target counts from the bottom, and the image read as it is drawn (sRGB) rather than as a raw linear copy taken before any pass drew 2026-11-15 13:18:38 -08:00
shinyobjectz 05356f6b70 CH14: the locomotion suite rebuilt on SOMA, first run 0 of 8 (walking slides under 1 cm; pops at switches in jogs and runs, slide in three cases, head roll on curves; align is not the pops' cause). CH15b done: a do line's clip made by Kimodo from its words, checked against the captures that end standing and kept in the project's made clips, played by the stage 2026-11-15 13:16:57 -08:00
shinyobjectz 8f49748322 CH48c: a drape fails with any seam open over 2 cm (closed), and the garment model trains only on drapes that pass. The long-sleeved shirt's short-looking sleeve was a cuff narrower than SOMA's forearm that slid off and hung open, one pair 8 cm apart, passed by the 95th-percentile check; 23 of the first 139 lean drapes have such a seam, mostly at sleeve-to-cuff corners. A gathering thread (a gathered edge drawn to its partner's length) changed none of the eight worst and was left out 2026-11-15 13:16:57 -08:00
shinyobjectz 186098d162 R3F23: in-pingpong, three's GPUComputationRenderer stepping a wave between two float targets, the plane's ShaderMaterial showing the one written (test/parity/targets.tsx). targets.test.tsx follows a GPUComputationRenderer through frames 0 to 2: the start drawn into both targets and the first step at frame 0, one step a frame after, alternating targets, the display reading the target each step wrote, and a step's pass keeping its name 2026-11-15 13:08:50 -08:00
shinyobjectz ae905b9fd1 R3F23: a ShaderMaterial's texture follows the render target an app drew this frame (R3F23c, part). raea-runtime-look's three_uniforms puts a material's textures that name render images in its keyed three:uniforms rows, and raea-sys-three-shader's patch binds the image each names to that texture's slot by name (ThreeShader keeps its textures' names in bind order), so a display material reading GPUComputationRenderer's current target reads the one drawn last 2026-11-15 13:05:02 -08:00
shinyobjectz 4edb80b80d R3F23: no new near copies. sync_render_maps checks the shown map with a match before it asks for the material mutably, and parts.rs reads each frame's map by a match on its value 2026-11-15 13:05:00 -08:00
shinyobjectz 840de67569 R3F23: a standard material's map follows the render target an app drew this frame (R3F23c, part). A mesh's map that names render images is keyed frame by frame (runtime/scene parts.rs: maps, map_k by step), and the new crate raea-sys-rendermap's sync_render_maps points the material's base colour texture at the image its row names this frame, so two targets ping-ponged (GPUComputationRenderer, a feedback effect) show the one drawn last. A map naming a picture keeps its first frame's, as before. runtime/scene drops two doc lines left over from moved modules 2026-11-15 13:03:41 -08:00
shinyobjectz f7b1cdad92 R3F23: no new copies. rendercam.rs finds a camera's ambient lights through one ambients() (the first one's colour, the frame's sum); spawn.rs and instance.rs take apart a SceneTarget and an asset event as their own patterns, not closures the dupes ratchet matches elsewhere 2026-11-15 13:03:41 -08:00
shinyobjectz eb43664245 R3F23: a pass is the same one frame to frame by what was drawn, and a ShaderMaterial reads a target's image as drawn (R3F23c, part). targets.ts names what a pass drew (its scene, and the lone mesh's material or the override material) and counts passes into the same target by that, so GPUComputationRenderer's quad, drawn once with its pass-through shader and then each frame with the variable's, keeps one layer and camera for its compute pass from frame 0 on, not the init's (passes.ts keys a pass by texture, what and count). shader.ts never asks for a raw linear copy of a target raea's engine draws: three-shader takes that copy once, before any pass has filled it. Tests: targets.test.tsx (the swapped quad's compute pass at frames 0 and 2; a ShaderMaterial's texture is the camera's image, v turned over) 2026-11-15 13:03:41 -08:00
shinyobjectz 5fc163ba9f R3F20: the engine reads a colour a copy. An <Instances> row with inst_tint sends 13 numbers a copy, and scene3d's instance.rs now takes them: a tinted set's copies share one TintMaterial over the row's standard material, each copy's MeshTag its number, and sync_instances rewrites the buffer of colours when the frame's list changes and copies the standard material in again when that changes. The list parser (stride_of, copies) lives in raea-sys-material's tint.rs beside the material, with a unit test, so raea-runtime-scene3d stays inside its budget 2026-11-15 13:03:41 -08:00
shinyobjectz 2598a75942 R3F23: a camera into an image within the crate budgets, and its ambient light shared with the screen camera's. raea-render's spawn_camera takes its size and target together and ends with raea-sys-frame's into_image, which a screen camera's row passes through; image_of gives a rendercam's image as its target, so load and apply_rows spawn camera and rendercam rows in one arm (raea-render stays under 2,000 lines, with is_3d_spawn moved to raea-sys-frame's store). runtime/scene takes rendercam tracks where it hands them to raea-runtime-look. rendercam.rs's ambient_columns is the one place a camera's ambient columns come from (a pass camera now carries the ambient colour too) 2026-11-15 13:03:41 -08:00
shinyobjectz 8a333c02c4 R3F23: in-fbo measured: SSIM 0.9557 against three.js at frame 12 (docs/r3f.feature status). The pass matches three's; what's left is the unlit plane showing the target, drawn without three's ACES 1/0.6, which a plain meshBasicMaterial shows too 2026-11-15 13:03:41 -08:00
shinyobjectz 0226bbb21b R3F23: what an app draws into a render target itself, drawn on raea's GPU (R3F23b). A gl.render into a target that sdk/r3f doesn't do on the CPU is recorded on the renderer that drew it (targets.ts renderInto) with its scene's parts as they were then, so two passes of one quad with another uniform each keep their own. passes.ts puts each pass's parts on a render layer of its own (64 up) and adds a camera part into the target's image ("render:<texture uuid>@WxH:WxH", ":float" for a float target), ordered before the screen's in draw order, cleared to the pass scene's background or the renderer's clear colour; a bare THREE.Camera's full-screen quad is drawn by an orthographic one. A material reading the target's texture names that image, with v turned over as a flipY picture's is (texture.ts flipsY, in scene.ts and shader.ts). session.ts and program.ts empty a renderer's passes as each frame steps, so a still of frame 3 has frame 3's passes. Cube and 3D targets stay left out. Tests: test/targets.test.tsx (the fbo probe, one frame's passes, two passes of one quad), the reflector case in errors.test.tsx; the parity case test/parity/targets.tsx (in-fbo) 2026-11-15 13:03:41 -08:00
shinyobjectz 744c5a2a1f R3F23: a camera drawing into an image, in the engine (R3F23a). A PerspectiveCamera row whose target is "render:NAME:WxH" (":float" for an Rgba16Float image) is a rendercam: raea-runtime-look's rendercam.rs gives it a row of its own (into, on keyed by step, no tone curve, the ambient light of its own layers), the engine spawns it on that image (RenderTarget::Image, no multisampling or dither, Hdr for a float image) before the screen's camera, and a material's map naming the image reads what it drew. raea-sys-frame's render_image.rs parses and makes the image once for every source naming it; a three shader follows only the screen camera's tone mapping; the TSX PerspectiveCamera takes target and layers, and a camera with a target isn't the one the pointer picks through 2026-11-15 13:03:41 -08:00
shinyobjectz db9dcda0a8 R3F22: the lane's copies folded (tools/dupes.sh). raea-sys-shader's uniform_bytes packs a written compute's, a written frame pass's and three's kernels' uniforms in their declared WGSL layout, where compute slab.rs, framepass written.rs and compute three.rs each had their own; three-shader storage.rs reads a per-vertex and a per-copy attribute's item through one padded; shared.rs's size error reads the spec's size by index 2026-11-15 13:01:38 -08:00
shinyobjectz 090cfeff1a R3F22: manual reference regenerated for the SDK's TSL compute (bun tools/manual-ref/sdk.ts gen): ThreeShaderMaterial's wgsl names the lit surface and the storage buffers it reads, and Compute takes three's kernels as well as ComputeProps 2026-11-15 12:59:13 -08:00
shinyobjectz 4d79a3f12f R3F22: tsl.ts under the 500-line limit: the WGSL text a node material compiles to, read and rewritten (its structs, entry parameters, texture samples flipped, words and indexed reads renamed, the contract's vertex attributes and stored types, the Unsupported refusal), moves to tsl-wgsl.ts 2026-11-15 12:58:22 -08:00
shinyobjectz fef9a1bd38 R3F22: three's compute and storage buffers run in the engine. raea-sys-shader shared.rs keeps a storage buffer by key (Bevy's ShaderBuffer, made once with its size and first contents, kept on the GPU, reset by a fresh three session; the empty one for an unused slot), the facility the computes that write it and the node materials that read it share. raea-sys-compute three.rs reads a <Compute kernels shared runs>: each kernel three's own WGSL with its storage bindings by key and its uniforms packed by three's struct, and the frame's runs queued once each by (epoch, seq) and dispatched in order before the other computes, a run whose pipeline or buffer isn't ready held. raea-sys-three-shader storage.rs binds two read-only shared buffers to a node material (bindings 11 and 12), and repeats a BufferMesh with copies count times with each copy's number, matrix and attributes (not frustum-culled). Two fixes the parity render found: runtime-scene keys a compute row's kernels, shared and runs frame by frame (a run after frame 0 never reached the engine), and three-shader's unlit entry premultiplies an additive material's colour with no alpha (three_blend in tone.wesl), since Bevy blends AlphaMode::Add as premultiplied alpha. compute lib.rs's groups_of and column serve the written, inline and three computes alike. docs/r3f.feature: R3F22 done, in-tsl-particles SSIM 0.9510 2026-11-15 12:58:22 -08:00
shinyobjectz 371751d5ed R3F22: sdk/r3f runs TSL compute: gl.compute and computeAsync record each ComputeNode as three's own WGSL (its WGSLNodeBuilder against the stand-in renderer), its dispatch size as three's WebGPU backend works it out and its uniforms' values then, and the walk empties them into one Compute part a frame (src/input/tsl-compute.ts: kernels, shared buffers by their attribute's key, the frame's runs in order; epoch, seq, fresh). A node material reading a storage buffer (.element(i), .toAttribute()) reads the same shared buffer by key (tsl-storage.ts, tsl.ts: at most two, tsl_s0 and tsl_s1), and one on an InstancedMesh is compiled for copies: one BufferMesh of the geometry with copies {count, attributes, matrices}, instance_index its own attribute tsl_copy (tsl-instances.ts, scene.ts instancedParts before copyParts). sdk/render: Compute takes {kernels, shared, runs} as keyed columns, BufferMesh takes copies. test/compute.test.tsx 6/6; the parity case in-tsl-particles (65,536 particles a compute swirls, drawn as copies) in test/parity/tsl.tsx and tools/parity.sh 2026-11-15 12:58:22 -08:00
shinyobjectz 33a803733b R3F22: the plan in docs/r3f.feature: storage buffers a compute and a material share by key, three's compute WGSL as <Compute kernels> whose frame's dispatches run once each in order (a fresh three session resetting them), a node material's storage reads, a node material on an InstancedMesh as one mesh of copies, in-tsl-particles 2026-11-15 12:58:22 -08:00
shinyobjectz 7d893bb612 CH48c: words to a sewn garment through SigLIP 2, trained with no captions. Each lean design is pictured from four sides (bake_batch.py PICTURES=1) and embedded with SigLIP 2 on the CPU (garment_embed.py); a small network learns the design's 122 settings as 196 slots (garment_params.py) from the picture embeddings, centred and with noise added, and is asked with a line's text embedding centred on a bank of garment lines (garment_model.py train, eval, make). words.sh makes each line a design, cuts it to SOMA, drapes and pictures it. First run on 86 designs: held out, the top's kind 0.66 against 0.44 most common, the bottom's 0.59 against 0.31; twelve lines of words 11 of 12, as many as the nearest picture, where a random design passes one or two; seven lines all valid patterns that hang right, six read as asked. sample_designs.py takes a given design (DESIGN, GID); sheet.py labels a garment asked in words with its words 2026-11-15 12:57:15 -08:00
shinyobjectz 34339ba0d9 skills: raea-skills 1a289f3 (PR #82: 3d/r3f.md lists the postprocessing effects drawn as frame passes) 2026-11-15 12:52:33 -08:00
shinyobjectz 41780e9784 Manual reference: Grade's exposure (bun tools/manual-ref/sdk.ts gen) 2026-11-15 12:50:26 -08:00
shinyobjectz f5f7b72912 R3F25 (part): postprocessing's effects as raea FramePasses, a FramePass's uv over the camera's Viewport, three's tone exposure as a Grade exposure
sdk/r3f src/input/effects.ts and effects-sampled.ts: postprocessing's Noise, Scanline, Sepia, DotScreen, ColorAverage, ColorDepth, Grid, Glitch, ShockWave, LUT3D and @react-three/postprocessing's ASCII and TiltShift2 become <FramePass>es running the effect's own shader in WGSL, with its uniforms as the effect set them, its textures (a perturbation map, the ASCII characters drawn on raea's canvas, a 3D LUT as a strip of slices), blended as its EffectPass blends it (all 22 of the blend functions it has), before or after the tone mapping as the composer orders it; an sRGB-input effect reads and writes sRGB as its pass does. TiltShift (its Kawase blur as one Gaussian of the same spread) and GodRays (the sun's disc on screen against the depth prepass, the rays unblurred) are close and say so once. SKIP is BlendFunction 9 (was read as 0, ADD). kinds.ts rows follow.

systems/framepass: an inline pass draws in the camera's Viewport and frame(), depth() and normal() map its uv onto the texture (a new view vec4 in the pass's uniforms). The Engine's target is w x (h + 1), a tag row under the frame, and Bevy's frame textures are the target's size, so in.uv spanned h + 1 rows and any pattern by uv drifted a row by the frame's foot (scanlines 0.8914 -> 0.9927, grid 0.8668 -> 0.9984). A pass as written keeps the whole texture.

Grade exposure (systems/post camera/on.rs grade_exposure, runtime/look post.rs, sdk/render GradeProps): stops on every pixel just before the curve, Bevy's ColorGrading. three's toneMappingExposure and its ACES's 1/0.6 go there now (lights.ts toneParts, post.ts), not into <ToneMapping exposure>, the camera's, which lights only lit and emissive shading: under ACES every unlit R3F colour was 0.74 stops dark (found by lane r3f-gpu), and effects before a composer's ToneMapping saw lit pixels in one scale and the rest in another. The three host folds a Grade's exposure into toneMappingExposure, so a round trip keeps it.

Parity: in-post2 0.8407 -> 0.9879, in-post3 0.8333 -> 0.9767, the rest of the list unchanged (in-basic 0.9917, in-vanilla 0.9921, in-tsl-lit 0.9906). parity.sh hands Chrome its whole list (shoot.ts's own list lacked in-instanced and the later cases) and runs in-post2 and in-post3. Tests: post.test.ts 9/9 (glitch, LUT strip, TiltShift2 told apart by its taper, the Grade exposure), roundtrip; framepass unit test of the Viewport rect. Left in R3F25: Outline, Texture, Depth, LUT1D, three/webgpu's PostProcessing (in-tslpost).
2026-11-15 12:48:19 -08:00
shinyobjectz af1a2c4199 CH49: worn pieces across periods and genres (a futuristic motorcycle helmet, a Victorian top hat, a Roman legionary's helmet, sci-fi armour), and the keyed fit made to hold them. The colour decides what is body, not the distance: a helmet's crown within the cut of the skull was cut through, showing the skin. A separate piece hugging the skin all over (the soles, never drawn) is dropped, as is one mostly magenta and a shadowed hand's dark magenta. Each piece rides one bone whole, the one nearest its centre, never a neck bone, a midline bone when it crosses the middle: before, a helmet split across head and neck and a breastplate rode the right arm. CH48: the data engine resumes (samples only the designs short of N, skips draped ones), a rejected design leaves no folder, and a failed drape is one line instead of a traceback that stopped the run 2026-11-15 12:44:17 -08:00
shinyobjectz 4fc9d5251b CH15b, CH15c: Kimodo's text path, first run: a line made into a clip between two standing poses (3 of 3 seeds passed, only the right hand rose; 1.6 s a clip on the cloud GPU), and the plan to move Kimodo onto the user's Mac in MLX once a ten-line eval holds 2026-11-15 12:23:13 -08:00
shinyobjectz 9055f7273f CH49: worn hard pieces from words, and CH48b: the garment training data at scale. tools/garments/wear.sh draws a piece on SOMA's mannequin with an image model, makes it 3D with Idol on this machine, lays it on SOMA (the turn searched, then turn, size and place refined against the skin), cuts the bare body away (by distance, or by a magenta key for pieces that leave skin bare), lifts what is kept 4 mm off the skin, and gives each face the bone it lies nearest, so each piece rides its bone rigidly as one part. Pilot: plate armour, fitted at SOMA's height within 0.05 per cent, walks with the body front and back. engine.sh LEAN=1 keeps what training needs, about 0.4 MB a design. The plan: periods, genres and armour in the training set (CH48b), rigid worn pieces (CH49) 2026-11-15 12:16:57 -08:00
shinyobjectz e7f16a86bc R3F18: done: docs/r3f.feature tags R3F18 @done with what landed (the guide and skill's 3d/r3f.md, the routers, the four lines; raea-skills #81 pinned at 89ab557, 1f02317e8) 2026-11-15 12:00:37 -08:00
shinyobjectz 1f02317e87 R3F18: agents are taught three.js work. sdk/guides/craft/bevy/r3f.md (the skill's 3d/r3f.md): an R3F scene in <R3F> (useFrame, refs and drei work there, stepped from the frame), a plain three.js page in <Three program> (raea 0.1.5), what draws and what doesn't yet; bevy.md routes three.js work to it, and the lines in bevy.md, bevy/scene.md, bevy/animation.md and bevy/limits.md that said useFrame and drei don't exist now say they don't drive raea's own components. skills pin: raea-skills #81 (89ab557): the same guide as 3d/r3f.md, 3d.md and SKILL.md routing three.js work to it, directory/ rebuilt 2026-11-15 11:58:23 -08:00
shinyobjectz 1d04a18d54 R3F19: raea's bundler resolves three and three/webgpu imported by the edit's own code (the work folder's src/ and ext/, never the SDK's copies: the playable host keeps three's real renderer) to the r3f copy's vanilla.ts and vanilla-webgpu.ts, so a plain three.js program's new THREE.WebGLRenderer() is raea's stand-in with no import of raea's (engine/bundle edit.rs, its own-code test). tools/parity.sh and shoot.ts run in-vanilla. docs/r3f.feature tags R3F19 @done: in-vanilla SSIM 0.9921 through the bundler, the R3F cases whose three is now the stand-in module unchanged (in-basic 0.9917, in-shader 0.9935, in-drei 0.9932, in-tsl-lit 0.9906, in-instanced 0.9819, in-sky 0.9986) 2026-11-15 11:54:51 -08:00
shinyobjectz 9dbb9b5400 CR12: a dog and a cat from another project on the creature solver, recorded. A fore leg may end in a paw, and a body on straighter legs takes shorter, quicker steps at the same speed; before, setting off left a hind foot out of its leg's reach 2026-11-15 11:47:27 -08:00
shinyobjectz ede2903d4a CH2a: bodies, heads and creatures read as one form and checked. The body SDK's folder reader takes a person's skeleton.json or a creature's rig.json as the same skeleton, with skin samples from the creature's mesh, and lists a folder's problems against CH2, CH20 and CH21; SOMA's headless body with the generated head, hair and hats, and the raccoon, have none; what is left is written down for each owner 2026-11-15 11:47:27 -08:00
shinyobjectz 415391a9e1 R3F19: a plain three.js program drawn by raea: <Three program={fn}> runs a single-file demo's script as a function, its renderers raea's stand-ins (src/input/vanilla.ts for "three", vanilla-webgpu.ts for "three/webgpu": three re-exported, its renderer replaced by one that records a render to the screen and its animation loop into the program running it). Its setAnimationLoop and requestAnimationFrame step once a frame at i*1000/fps ms with performance.now() at that time and Math.random seeded, so a frame is the same played to or rendered alone; a frame before the last runs it again from the start, an async one (await renderer.init()) holds the frame until it's ready. The scene it last rendered is converted as <R3F>'s is; a full-screen pass to the screen (three's EffectComposer) is drawn as the scene it rendered. The stand-in renderer and the seeded random move out of session.ts (renderer.ts, seed.ts) so a composition's three needs nothing of React Three Fiber's. test/program.test.ts 7/7; test/parity programs.ts in-vanilla (native.tsx, the Chrome page) SSIM 0.9921 2026-11-15 11:45:29 -08:00
shinyobjectz fc3bba9b1a R3F20: TintPlugin registered by its path (raea-render stays within its 2,000 lines); tint's colour buffer padded in a loop, not a closure dupes matched 2026-11-15 11:44:00 -08:00
shinyobjectz 8df71aceba R3F20: done: docs/r3f.feature tags R3F20 @done with what was built and measured: 2,000 moving copies 25.5 ms a frame (0.1.4: 94), 20,000 41.9 ms (1,220), coloured 43.7 and 74.6 ms; in-instanced SSIM 0.9819; a plain <Instances> scene unchanged 2026-11-15 11:40:45 -08:00
shinyobjectz 12f0eb09a0 R3F20: test/parity in-instanced (2,000 copies moved and recoloured each frame, lit by a sun) and speed.tsx (the 2k and 20k bars' compositions, with and without colours) 2026-11-15 11:40:45 -08:00
shinyobjectz dc4558dc7a R3F23: the plan in docs/r3f.feature: a camera row drawing into a render image (target, float images, linear), maps reading render:NAME, the stand-in renderer recording passes in draw order, ping-pong by frame, cases in-fbo, in-pingpong, in-reflector 2026-11-15 11:40:45 -08:00
shinyobjectz 5b52eb4aed R3F20: an InstancedMesh is one <Instances>, still or moving, with a colour a copy
raea/3d <Instances>: an Instance takes `color` ("#rrggbb" or linear [r, g, b]), multiplied with the material's as
three's instanceColor; a set with colours packs 12 numbers a copy, data-at {"stride":12,"at":[...]}. runtime/look reads
it as plain numbers (not JSON values) and writes inst at 13 numbers a copy with inst_tint 1. scene3d: a tinted set's
copies share one TintMaterial (raea-sys-material tint.rs, TintPlugin: the standard material extended by a ShaderBuffer
of the copies' linear colours, read by the copy's MeshTag above compose's two pass bits), the buffer rewritten in place
when the frame's list changes, the row's standard material copied into its base when it changes; compose's
sync_passes keeps a tag's high bits. sdk/r3f: scene.ts sends every InstancedMesh with a standard surface as one
<Instances> (instanceMatrix.count copies, those past count shrunk to 1e-5, instanceColor as colours); a ShaderMaterial,
several materials, MeshNormalMaterial, a shadow catcher or clipping keep a mesh a copy. The three.js host draws the
coloured form as instanceColor. Tests: conformance instances (12 numbers a copy), look's a_colour_a_copy, tint's tag
bits, r3f input (moving and coloured copies stay one Instances; a ShaderMaterial is a mesh a copy), the three host's
instanceColor.
2026-11-15 11:40:45 -08:00
shinyobjectz e2b41e8df6 R3F20: the plan in docs/r3f.feature: moving InstancedMesh copies as one <Instances> whose list is the frame's buffer, with a colour a copy (TintMaterial read by MeshTag), lists parsed once, in-instanced 2026-11-15 11:40:45 -08:00
shinyobjectz bfbfc91d40 R3F21: done: docs/r3f.feature tags R3F21 @done: in-tsl-lit SSIM 0.9906 against three.js in Chrome, where 0.1.4 drew the blob black. The lit entry's imports go at the fragment module's top (WESL takes them nowhere else; a test holds it); tools/parity.sh runs in-tsl-lit; tools/shoot.ts takes a case name with dashes 2026-11-15 11:38:43 -08:00
shinyobjectz 7af167433d R3F21: test/parity's INPUTS take the TSL cases of test/parity/tsl.tsx (in-tsl-lit) 2026-11-15 11:34:37 -08:00
shinyobjectz 52ccddd1df R3F21: test/parity in-tsl-lit (the noise blob: an icosahedron its positionNode pushes out along the normal by 3D noise, coloured by the same noise, under a directional light; its motion a uniform R3F's clock sets, never TSL's wall-clock time) in test/parity/tsl.tsx, and the node materials' row in kinds.ts says a lit one is lit by Bevy's lights 2026-11-15 11:33:42 -08:00
shinyobjectz fcd8105d93 R3F21: a lit TSL node material's surface lit by Bevy's lights: three's builder writes it with no lights of its own, its output (context.getOutput) the colour and opacity, view normal and roughness, emission and metalness, and world point after positionNode (sdk/r3f src/input/tsl-lit.ts); three-shader's lit entry makes Bevy's PbrInput of it and runs the standard lighting, fog and tone mapping, the instance carried to the fragment for the mesh's shadow flags (systems/three-shader surface.rs). Lambert is fully rough, Phong's shininess a roughness. The plan in docs/r3f.feature; test/tsl.test.ts 8/8. Also carries R3F16's three:uniforms on a part whose shader fell back: Ok, never a refused frame 2026-11-15 11:25:07 -08:00
shinyobjectz 4259cd9c01 R3F16: what three can't draw in raea is named and drawn, never refused. The R3F stand-in renderer answers coordinateSystem, an inert GL state, extensions and a full info, and takes compute/computeAsync into gl.__raea.computes (named once until R3F22 runs them); the TSL stand-in's WebGPU backend has a device with wgpu's limits, any Error building a node graph draws that material flat, and a graph reading an attribute the drawn mesh can't carry (an InstancedMesh past 1,024 copies) is refused in tsl.ts instead of by the engine; a sampler2D the material never sets reads opaque black; an http(s) picture is fetched through raea's cache. R3F17: a vertex put on three's far plane (X.z = X.w, gl_Position = X.xyww) is written on reverse-Z's (z = 0) in GLSL and in a node material's WGSL, so <Sky> is behind the scene: in-sky SSIM 0.9986. The audit's six refused probes render; test/errors.test.tsx 10/10; parity.sh takes R3F_CASES for a subset 2026-11-15 11:22:21 -08:00
shinyobjectz d88d19e149 R3F16: docs/r3f.feature: R3F16 to R3F27, what three.js work online is made of drawn in raea for 0.1.5 (the 11-15 audit's six refusals, five wrong draws, moving instances, the skill), each held by a parity case or a test; R3F15 tagged done (landed in 0.1.4 with test/errors.test.tsx) 2026-11-15 11:20:43 -08:00
shinyobjectz 5c788473f7 CH17a: the character plan opens with the whole system on one page (body, motion, staging and NPCs, heads, creatures, clothes, who holds what); CH17a (do lines and unmet asks, done in the body SDK); the picture-measured clothes rule marked as rejected 2026-11-15 11:19:14 -08:00
shinyobjectz 8cfb2241c2 CH48a: the garment data engine (tools/garments): random GarmentCode designs cut to SOMA, draped by our own cloth on the GPU with pins at the waist, neck and armpit, skinned, pictured and labelled; CH48 proposed 2026-11-15 11:11:58 -08:00
shinyobjectz 2f89374c47 CH47a: garments from sewing patterns: GarmentCode's pattern programs (MIT; its non-commercial simulator not used) cut to SOMA's measurements and draped by a position-based cloth of our own, a T-shirt, trousers and a hoodie over them worn through the matched walk; CH47 proposes patterns as the clothing standard, for the user to decide 2026-11-15 10:18:42 -08:00
shinyobjectz 04b06c500b CH32: the creature solver's leg order fixed and recorded: a fore foot now lands 0.10 of a stride after its hind (a raccoon's 0.14; anymove's best clip 0.36), so the solver owns footfall order as CH31 says 2026-11-15 09:59:00 -08:00
shinyobjectz 7ef89d4c13 CH45: skills pin: raea-skills #80 (0247f25): the characters guide teaches raea clothes (make, cover, wear, and that a garment lies on the skin) 2026-11-15 09:33:53 -08:00
shinyobjectz 11931d4958 CH45: raea clothes in the manual's CLI reference (its group, every flag described, an outfit layer by layer) and in the characters guide, so an agent knows when to use it 2026-11-15 09:28:44 -08:00
shinyobjectz 4110989ed4 CH45: raea clothes, garments for SOMA's body: make draws the mannequin's four views with an image model and measures them onto SOMA's template vertices (over garments already made, a procedure-made one drawn on the mannequin first); cover makes one by procedure with no picture; wear writes a dressed body folder; remeasure re-reads kept pictures. SOMA-X's body files are fetched once at a fixed commit by SHA-256; tools/clothes ships in a release. Measuring: hems evened, stand-off capped per part, shoulder tops and collar slopes covered, backdrop texels take the measured colour 2026-11-15 09:03:32 -08:00
shinyobjectz 878cfe1dac CH15a: Kimodo measured and two situations the captures lack made from two of their poses. CH11 gets Kimodo's numbers with no text (constraints only: keyframes 0.5 cm mean after its post-processing, feet exact, hands 2.4 to 3 cm, a root path within its 4 cm margin; 4.3 s of GPU a 5 s clip) and why text waits (the gated encoder's form asks for the account holder's own details). The run-time position is confirmed: clips at run time, models at build. CH1a records the SDK on SOMA's names. CH15a: between two library poses as Kimodo keyframes, the motion brought back onto SOMA, put on the captures' elbow and knee hinges with hands and feet kept, and judged against the captures it joins on the same body; turn and sit kept 4 of 5 seeds, rise and walk off 2 of 5 2026-11-15 08:36:17 -08:00
shinyobjectz dc8038add1 CH1a: the old character SDK names SOMA's joints. sdk/character bones.ts B gives SOMA's names (Hips, Spine1, Spine2, Chest, Neck1, Head, LeftShoulder, LeftArm, LeftForeArm, LeftHand, LeftLeg, LeftShin, LeftFoot, LeftToeBase; a finger's phalanges 1 to 3 as SOMA's 2 to 4, the thumb's 1 to 3), BODY_JOINTS is SOMA's 23 with Neck2. Bodies on the old game_engine rig still load: joint() finds a SOMA name by its old one and an old name on a SOMA body (somaName, oldName, sameJoint), the side, mirror, role and finger helpers read both, captured() takes the body's own count or stops at the first joint that isn't the body's, and retarget's BVH maps keyed by old names still map. A body named as CMU or Mixamo name theirs (LeftUpLeg, their LeftLeg being the shin) is refused with a message instead of read wrong. systems/body Skeleton::joint reads a SOMA name on an old body the same way. The conformance stick body is on SOMA's names; a new test checks both names find one joint and the two turn into each other; character.test 27 of 29 pass, the 2 that fail failing the same way before the change 2026-11-15 08:36:02 -08:00
shinyobjectz f9b9aeff95 CR18: how an eye is placed: the drawing registered to the model made from it (the side it was drawn from, found by outline), the eye's pixel cast onto the raw model; where it stands on each creature 2026-11-15 07:25:31 -08:00
shinyobjectz 0076952a6b CH42c: the skin at the shoulders is the t-shirt's neckline read too wide, not a hole in the jacket; two things tried and taken back 2026-11-15 07:24:16 -08:00
shinyobjectz 3525e74875 CH44a: the skirt's seat and its riding up mended, the thighs at a long stride still open 2026-11-15 07:20:16 -08:00
shinyobjectz c3bc7d7bc7 CH16a: a stop's overshoot measured (26 cm on average over six paths) and brought to 6 by replaying with the mark set back 2026-11-15 07:15:27 -08:00
shinyobjectz 984be1686a CH42c: done: a garment's colour baked as a picture in the body's own UVs (the drawing's detail, where a colour per vertex gave a blur), small bare patches walled in by cloth filled 2026-11-15 07:07:54 -08:00
shinyobjectz 016ef5347e CH21a: done: hair cards ride the head, and a whole person stands on the standard (SOMA body, generated head, hair, glasses, two layers of generated clothes, motion matching) 2026-11-15 07:03:36 -08:00
shinyobjectz ccf6eda50b CH16a: take added to the acts (put, throw, hand over and use are the same act with another spec), two raised-arms turn captures dropped 2026-11-15 07:01:19 -08:00
shinyobjectz 102352c44d CR18: mouths and eyelids as one method on every creature: the head cut along the lips with a dark inside, lids as caps that turn about an axis along the head, the eye placed from its pixel in the drawing; what is still rough 2026-11-15 06:59:25 -08:00
shinyobjectz face0fe8bc CH44a: done: a skirt made for the body by measure hangs from the waist and moves through a walk on the cloth follower, first cut 2026-11-15 06:53:41 -08:00
shinyobjectz 159fcbdb94 CH46a: done: a dressed body measured through a walk (cloth under skin, under the layer beneath, edge stretch by joint), first numbers 2026-11-15 06:50:24 -08:00
shinyobjectz 1b22805edc IX8: Google Drive tried on a real account. A video picked in Google's Picker went in from Drive's thumbnail in 1.2 s, came first for words describing its picture, and opened its page in Drive. The status says the Picker's key must also allow https://docs.google.com/*, where the Picker's frame runs; without it the Picker says the developer key is invalid 2026-11-15 06:47:13 -08:00
shinyobjectz 250b8fed84 CH18a: the finger curl's fault on SOMA found and fixed, six takes drawn on SOMA's body 2026-11-15 06:46:07 -08:00
shinyobjectz 19ff72740c HG16: the finger curl places a knuckle from the hand's joint, whatever lies between (SOMA has a bone in the palm there: its fingers were worked out 8 cm from where they are). The audit on SOMA: finger pads on a cup 0 to 6, hand skin in a box 22 to 17 mm; turbo unchanged. The audit prints each hand part's nearness to the thing with FINGERS=1 2026-11-15 06:37:20 -08:00
shinyobjectz 712b1c73e9 CH42b: done: the same garment files worn by a SOMA body of another build (SOMA's own shape model), nothing refitted 2026-11-15 06:30:33 -08:00
shinyobjectz 406a1417fa CH16a, CH18a: face and sit added to the acts, the matcher's one-frame return to its guide found and limited, SOMA's limits in Rust noted 2026-11-15 06:27:17 -08:00
shinyobjectz ec33701acf HG16: joint limits for a SOMA body in Rust: the table measured over the library moved to SOMA (the body SDK's), with the elbow's fold read from the captures; the old rig keeps its own 2026-11-15 06:21:34 -08:00
shinyobjectz 67f33b2460 CH42a, CH43a, CH45a: done: a garment as a file on SOMA's template vertices worn with the skin under it left out, a jacket layered over a shirt, and one command from a line of words to a garment (20 cents, 36 seconds) 2026-11-15 06:18:26 -08:00
shinyobjectz 7551eb17b9 IX14: bench/index measures the Index's fast pass on a fixed public set. Open Images V4 validation pictures (CC BY 2.0, the first N by id, cached once) and two Blender films (CC BY) cut into 30 s clips, indexed into a new home: pictures a second, seconds to the first searchable, peak memory, warm search time, and precision@5 against Open Images' verified labels for 38 words. On v0.1.5-rc4's Mac build on an M5 Pro: 10,000 pictures searchable 55.7 to 57.1 s after raea index add started (177 to 181 a second, the first at 0.4 s, 244 to 266 MB), warm search 13 to 19 ms, precision@5 0.879; 47 clips (23.2 min) in 2.2 s, 371 frames at their moments. So IX12's 10,000 photos in about a minute holds. Unsplash's Lite set was dropped: its terms forbid publishing any of it 2026-11-15 06:13:54 -08:00
shinyobjectz c735bd06a2 CH41a: done: a garment's stand-off read where each view sees the body's outline and spread over the garment, so the jeans hang as trousers 2026-11-15 06:10:00 -08:00
shinyobjectz c0f1c3786c HG16: the role lookup without the two copies the check found 2026-11-15 06:07:35 -08:00
shinyobjectz 6d49104881 HG16: one lookup between a role and SOMA's name, read both ways (rig.rs rename) 2026-11-15 06:03:13 -08:00
shinyobjectz 2ebe989c05 HG16: the role and SOMA names kept in one table (rig.rs TRUNK, LIMB), read both ways 2026-11-15 06:00:20 -08:00
shinyobjectz d2f6ec0831 CH16a, CH18a: done: acts and controllers carried out by the matcher on SOMA, and the takes running on a SOMA body (a joint found by its role on either rig: rig.rs soma_name, role_name; holds within 2 to 8 mm in the audit's six takes, the fingers not yet fitted to SOMA's hand) 2026-11-15 05:58:22 -08:00
shinyobjectz d991b4e9d2 CH40a, CH40b: done: clothes drawn on SOMA's mannequin by an image model lie on it pixel for pixel one view at a time, and become an outfit on the body's own vertices worn through a walk; the clothing standard filed (CH41 to CH46): a garment as data on SOMA's topology, its shape measured from outlines, layers built up, free-hanging cloth, a wardrobe from words, checks 2026-11-15 05:51:26 -08:00
shinyobjectz c53605cd51 CR12, CR15 to CR17: a creature is a spec and one flow makes it: a dragon (wings, long neck and tail, horns, scales) and a restyled raccoon made by the raccoon's own commands and moved by its solver, sized by the legs' reach; the coat by the spec; wings as limbs with built membranes 2026-11-15 05:49:18 -08:00
shinyobjectz e9b22ad3eb CH14a, CH20a: done: the rebuilt body SDK, its library and its matcher on SOMA (23 of 27 tests, a path walked with feet held within 17 mm), and the first generated head joined to SOMA's body at a level cut through the neck 2026-11-15 05:42:38 -08:00
shinyobjectz ef46cab89f CH20: a Character part may name the body's joints it has (a head has the neck, the head and the eyes), so a part with some of the joints is drawn; the generated head rides SOMA's body through a library walk with its expressions driven by name 2026-11-15 05:36:21 -08:00
shinyobjectz 1dee5992e5 HG16: in progress: a SOMA body's twist joints set on any pose (raea-sys-body with_twists, native call character.twists, raea/character withTwists), so a clip or a solver that turns the named joints only draws with the limbs' twist spread. The body library's captures, moved to SOMA joint for joint, play on SOMA's body through it 2026-11-15 05:33:25 -08:00
shinyobjectz 3073fc5739 CH32: two rerolled raccoon clips with the carriage and a pacing walk named: carriage in range, 7 of 9 measures in range on the better clip, the order of the legs and the tail's tip still off 2026-11-15 05:27:02 -08:00
shinyobjectz 914fabd377 CH32: anymove run end to end on the raccoon: reader error 6.9 and 4.8 px, two walk clips fitted, paw agreement 0.23 and 0.56 against a keep line of 0.8, about 2.10 dollars 2026-11-15 05:19:23 -08:00
shinyobjectz 19c877037a #158: a render can't wait forever on a frame its runtime lost. Ragul's long 4K renders hung before their first frame about half the time on 0.1.4 (2 of 6 on 0.1.2): the main thread waiting in settle's wait_flush, the JS thread idle, no output, no exit. Settle's no-progress guard took any JS time anywhere as progress, and the JS thread ticks its timer queue every 500 ms even when it's empty, so a frame that would never come was waited on for good; it also read every runtime's flushes, and a render's 3D rows run three runtimes.
Now each runtime keeps its own JsState (runtime/shared stall.rs, with Settling, the settle's watch over it): its flushes, its work (an event delivered, or a timers call with a timer due; an empty tick isn't work), its current call and since when it has sat idle with nothing scheduled. Settle reads its own runtime's counts; a thread that only runs timers without committing is given at most HOLD_SECS. A runtime stepping a range (step_frames sets Stepping) whose JS thread sits idle for a second with its frame neither drawn nor held is asked for the rest of the range again from that frame, up to three times (frames are pure), and the render says so. A frame still not drawn fails after 20 s naming the frame, the marker, how long the thread sat idle and how often it was asked. The bridge's event loop ending by a throw (a rejection nothing caught, so events queued unread) is now a composition error the render reports at once (the prelude's __raea_loop_died, which entry.rs catches with), and the prelude's __raea_deliver says when an event went unheard, which the stall error reports.

The hang didn't reproduce here: 587 runs of a composition like his (2160x3840, 752 and 3840 frames, Sequences, @font-face, Img, #96's six-layer Freeze blur), 3 and 16 runtimes under load, 0 hangs. So the cause in his project is still unknown. RAEA_FAULT_DROP_EVENT=raea-frames loses the 3D rows' range event as such a hang would: tools/settle-nudge.sh shows the render asking again and finishing, and with raea-frames* (every one lost) failing in 23 s with the named error instead of hanging. Smoke on the new build: 60 scene-rows passes with no re-asks, a 600-frame PNG folder, mp4, the 752-frame 4K mp4, and examples/games/lighting.tsx. Dupes: one exact group gone (tools/dupes.max 293 -> 292).
2026-11-15 05:08:52 -08:00
shinyobjectz f8dd70c80a CH10: the clip format starts from the SDK's clip file 2026-11-15 05:06:20 -08:00
shinyobjectz bdb77110de HG16: in progress: a SOMA body posed from a motion's turns in the SDK. raea-sys-body turns.rs: from_turns (a joint's world turn from bind is the motion's turn after the turn from bind to SOMA's T-pose; a joint the motion doesn't name rides its parent) and set_twists (each limb segment's four twist joints by SOMA's shares); native call character.turns; raea/character turnsPose and TurnsClip. Test: a forearm's twist joints take 5 to 95 per cent of the hand's turn, an upper arm's stay with the chest near the shoulder 2026-11-15 05:01:35 -08:00
shinyobjectz 4f589c5597 CH2, CH10, CH30: a body of several skinned pieces, contacts by joint name, the creature flow owned in docs/creatures.feature with Kimodo no part of it; CH20: Character's morphs prop carries the face's weights 2026-11-15 04:58:00 -08:00
shinyobjectz a57c2209d2 HG16b: done: a SOMA body folder (flat joints under SOMA's names, the twist joints as helpers, each joint's turn to the T-pose, skin samples) posed by Character from a Kimodo motion's own joint turns 2026-11-15 04:56:34 -08:00
shinyobjectz 87aa6ac0a1 CH21: hair as a card mesh with a stray distance per vertex, hats and glasses rigid on the head; CH20: the head's fitted size in head.json 2026-11-15 04:53:12 -08:00
shinyobjectz 73af431001 CH0: the character SDK as one system (docs/character.feature): people on SOMA's skeleton, one body folder for people and creatures, one clip format, Kimodo and anymove as cloud steps that write clips, motion matching at run time, staging and NPC controllers in one vocabulary of steps, the generated head at the collar, clothes after 2026-11-15 04:51:15 -08:00
shinyobjectz 4f6bfe82d6 HG16a: done: SOMA's own body plays a generated motion in raea with nothing fitted (its template rig posed from Kimodo's joint turns, twist joints set by SOMA's shares, as a glTF clip). SOMA filed as the standard body for people: HG16 a SOMA body as a raea body, HG17 its shape model, HG18 its surface and the generated head 2026-11-15 04:45:45 -08:00
shinyobjectz 3bbd1469ac HG12b: done: generated motion on a raea body, with the licences read (Kimodo usable, BONES-SEED not); HG15 filed: twist joints measured on a body's skin (a 90 degree hand turn thins the wrist to 71 per cent, four twist joints keep 97 to 99) 2026-11-15 04:30:30 -08:00
shinyobjectz 228984a74c HG12b: a body following SOMA motion keeps its head level: the head's frame is set rigidly from SOMA's head and two eyes (rest offset of the eyes from the head joint as a constant), where a single bone direction left it tipped back; a hand points at SOMA's middle finger end. Kimodo's four shipped example motions (slow walk, walk then sneak, run and leap, zombie) read on turbo with the source's own head pitch (15 degrees up at 2 s of the slow walk, as in the source) 2026-11-15 04:29:59 -08:00
shinyobjectz 56c71ed264 HG12a: motion on SOMA's skeleton plays on a raea body. SOMA (NVlabs/SOMA-X, Apache-2.0) is the 78-joint skeleton NVIDIA's motion models and datasets speak. raea-sys-body soma.rs points each of raea's bones the way SOMA's matching bone points, at raea's own lengths, fits the pose to those places, and turns each arm's and leg's first bone so its elbow or knee flexes about its own axis (settle_hinge, shared with two_bone). raea/character: readSomaUsda reads a SOMA animation saved as text USD; somaPose is the native call character.soma. A body 1.3 times the size under SOMA's names is followed within 2 degrees a bone; SOMA-X's example animation plays on turbo. 37 tests 2026-11-15 04:16:41 -08:00
shinyobjectz af8eb9ffbd HG14: fetch is rendered on turbo with a walk capture retargeted to it (said in docs/hands.feature) 2026-11-15 03:42:34 -08:00
shinyobjectz ee91bf13a8 IX10: status, in 0.1.5 (raea-feed #44 merged, raea-api deployed); plans count it as storage only 2026-11-15 03:41:44 -08:00
shinyobjectz 4a339cf0e3 IX10: status, the feed side built and measured live (raea-feed #44 held until 0.1.5); raea-api not deployed 2026-11-15 02:53:29 -08:00
shinyobjectz 0722ce3ae4 IX10: the index hands out its rows and a query's vector, so the feed can keep a Pro or Team account's index in raea's cloud too. raea index serve answers rows {after, limit} (export.rs: the searchable rows after a row, oldest first, each with its item, moment, thumbnail and its vector as base64 of the f16 bits the rows' file keeps, 2 KB a row, and next to ask from), and a search with vector: true also answers its query's vector the same way. Tested: export.rs's unit tests (base64, f16 bits, paging past an item not yet searchable) and on a real index (3 pictures: rows in pages of 2 then 1, "a cat" with its 2,048-character vector) 2026-11-15 02:27:43 -08:00
shinyobjectz 2d9d1cfd93 IX3, IX8 status: more like this on the Index page (raea-feed #40); files picked in Google's Picker go into the Index from Drive's own thumbnails, the token only to Google and no picture through raea-api, so Free can (raea-feed #41); what is not yet 2026-11-15 02:19:00 -08:00
shinyobjectz 1bf0c2075a IX11, IX12 status: the Index page's rows, bytes, model and folder, and Show in Finder through the Index (raea-feed #38); the counter, rate and wall move in raea's own window through a long poll, and the Index spec runs whole there (raea-feed #39) 2026-11-15 01:47:05 -08:00
shinyobjectz a84aedca3d skills pin: raea-skills #79 (9bdd33c): reference/files.md names the raea app's Index folder (~/.raea/library/fast, raea-feed #37) 2026-11-15 01:29:57 -08:00
shinyobjectz d77c46ab60 IX3 status: the Library's Search asks the Index beside the libraries (raea-feed #37), and what is not yet: one fused ranking, more like this from the page, agents' library search on the fast rows 2026-11-15 01:25:10 -08:00
shinyobjectz 24b456ecd0 IX8 status: Google Drive for desktop, Dropbox, OneDrive and Box are Index switches when mounted (raea-feed #36); the API route needs a restricted scope, since drive.file reaches only picked files and a picked folder shares the folder alone. Open question 3 for Shane: drive.readonly with Google's verification and CASA, or the desktop app's folder plus picked files 2026-11-15 01:15:45 -08:00
shinyobjectz d13ab74d9a CR10: each leg its own piece of skin under the fur: the skin holds in 10 of 13 moves, and what is left 2026-11-15 01:11:15 -08:00
shinyobjectz 8e86f0a3ba IX7: a file kept only in iCloud goes into the Index from Quick Look's thumbnail, never downloaded. cloud.rs asks QLThumbnailGenerator for the 256 px thumbnail iCloud keeps (objc2-quick-look-thumbnailing), after a folder's local files and eight at a time, since iCloud hands them over about one by one; the fast pass writes a waiting batch after a second, so a slow source still lands each picture as it comes. walk.rs lists iCloud's cloud-only files again (937387c3d left them out) and still leaves out and counts other providers' (Google Drive, Dropbox), which aren't shown to answer Quick Look without a download. Measured: 40 fresh cloud-only pictures and videos searchable in 17.9 s (2 a second), all 40 still dataless after; a mixed folder searchable whole, words finding an iCloud picture 2026-11-15 01:09:53 -08:00
shinyobjectz 104763b1e3 IX7 status: Quick Look gives a cloud-only iCloud file's thumbnail without downloading it, 1.7 a second the first time (40 in 23 s, all still dataless after) and from its cache after that (0.02 s), so iCloud Drive's cloud-only files can come in as a slow second stage 2026-11-15 00:31:39 -08:00
shinyobjectz 0f4c6626e8 CR11: the gallop's legs reach their feet now; what is still rough 2026-11-15 00:18:21 -08:00
shinyobjectz 9a236c1194 CR0: the plan table names its crate column 2026-11-15 00:15:32 -08:00
shinyobjectz 3f7945b7a6 CR0: docs/creatures.feature: a four-legged body in the character SDK, what was built for it (rig measures, a gait with feet planted in the world, one rigging and one solver, the tail), what building a raccoon on it found, and what is left 2026-11-15 00:15:32 -08:00
shinyobjectz 937387c3db IX7: a file kept only in iCloud is left out of the fast pass and counted, not read: reading a dataless file (SF_DATALESS, iCloud Drive with Optimise Mac Storage) downloads its original. On this Mac all 3,849 iCloud Drive files were cloud-only, 2,245 of them pictures and videos, which switching iCloud Drive on in the Index page would have pulled down. walk.rs cloud_only reads the flag from the stat it already has; Listed and Progress say how many (cloud), the listing's last event carries it, and the CLI says "N only in iCloud, left out". Checked on a folder of three cloud-only pictures and two local ones: two searchable, three left out, all three still dataless after. The Quick Look path that indexes them without a download stays IX7's plan 2026-11-15 00:14:03 -08:00
shinyobjectz 13886ff3c5 skills pin: raea-skills #78 (5645c8c) for 0.1.5: reference/cli.md has raea index (add FOLDER|photos:, search, status, remove, serve), regenerated from main 7ac71240d's help, the one file the strict skills gate failed on; with #77 (c22c4f1): footage.md teaches raea index, plan.md and collaborate.md plan a round of notes first and teach /goal, and raea's hook hands a session what the person sent from the app 2026-11-15 00:10:48 -08:00
shinyobjectz 7ac71240db app.share: macOS's share sheet for files from raea's window (NSSharingServicePicker beside the point the person right-clicked), for the feed's menu on any image or video (Shane 11-14: copy, open in Finder, share). Recorded in native.log off screen 2026-11-14 23:59:36 -08:00
shinyobjectz 2686a55190 IX6: the manual's raea index page names photos: (bun tools/manual-ref/cli.ts gen) 2026-11-14 23:58:12 -08:00
shinyobjectz 8caedfbaa1 IX6: Apple Photos as an index source (raea index add photos:): PhotoKit lists every photo and video, keyed by the asset's local identifier with Photos' original filename, its dates, size and length; the fast pass reads the small copy Photos keeps on this Mac (PHImageManager at 256 px, synchronous, never the network), so an iCloud library goes in without downloading originals, a video by its poster. macOS asks the person once (access(): read-write is the only reading level). Folders and Photos list through one list_source; root_of and list_root are what an add names, for the CLI and serve alike, and serve lists Photos again at start like a folder. The app's Info.plist has NSPhotoLibraryUsageDescription and its entitlements the Photos library (private tools/raea-app). Not yet run against a real library 2026-11-14 23:46:19 -08:00
shinyobjectz 31876c7d1c HG14: the hand's clearance from solids and its back-off from a hold ease in (both had a corner that showed as a kink in the arm's speed); the audit prints every joint jump over POPS degrees a second. The box take's worst jump 419 to 328 2026-11-14 23:39:29 -08:00
shinyobjectz 76a11076ea A3c: raea hook hands an agent what the person sent from the raea app, after any tool and as its turn ends
A session that posted with raea show has an inbox; the app writes there what the person sends on its items or to it
in the feed. raea hook now reads what was added since its last look (raea-app-check-inbox, apps/check/inbox: a byte
mark in <inbox>.read the app reads to say Read) and hands it over: as PostToolUse context after any tool, and on Stop
as the reason the turn goes on, so a reply reaches a busy terminal session at its next step instead of waiting for it
to follow the file. raea skills install gives Claude Code the PostToolUse hook on every tool and a Stop hook, widening
an older raea's after-save matcher (Shane 11-14: a reply in the feed didn't confirm or interrupt the agent). The inbox
is its own crate to keep raea-app-check under the size limit.
2026-11-14 23:38:01 -08:00
shinyobjectz a904a86429 HG14: the floor take was measured on an impossible set-up (the box on the body's toes, a solid table 17 cm from it); set where a body would stand for it, the hold is within 5 mm (from 69) and no body skin is in the box. The trunk's lean comes on as soon as an arm ends short, and the squat's give is a smooth measure of the room the head and chest have, where a search for the least give jumped: the floor take's worst joint jump 1,706 to 707 degrees a second 2026-11-14 23:33:01 -08:00
shinyobjectz 32587e0b9d IX2: a video's fast pass is its keyframes: one for each 4 s, at most 16 spread over the whole, each the sync frame nearest its moment (AVAssetImageGenerator, tolerance unbounded, so nothing between keyframes is decoded), the first its thumbnail; each frame a row with its moment, an item's frames embedded in one batch so it counts once. On 35 of our own videos: 109 frames, all searchable in 0.9 s; "a monk in a dark stone hall" finds MUSPILLI's opening at 153 s. Listing a video's length before its frames is still to do 2026-11-14 23:27:56 -08:00
shinyobjectz d37f835bfd HG14: a grip chosen by the thing's shape for a rod lying down (taken over the top, the fingers round it across its length); raea/character's fetch takes a thing as asked when it is in reach and otherwise walks the body to the take's standing place first and puts the take off until it arrives. 35 tests. fetch is not rendered yet 2026-11-14 23:26:39 -08:00
shinyobjectz b305638248 HG14: the typed call table has character.take's reach 2026-11-14 23:25:42 -08:00
shinyobjectz 2f5ad766d7 HG14: a thing held in one hand is where that hand has it: when the wrist is at its limit the thing turns with the hand instead of the hand passing through it. The elbow's swing also counts what the wrist can't do, over a wider range. On turbo's skin: finger skin in the mug 26 to 1 mm with five pads on it, in a moved cup 5 to 2 mm. Exposed and not fixed: the mug tips up to 50 degrees at the mouth where 29 was asked and touches the face, and that take has a joint jump of 1,378 2026-11-14 23:25:42 -08:00
shinyobjectz 20ccabb8dd HG14: a thumb that is in the thing is spread out from the palm until it is clear; a leaving hand stays on its cleared path for longer; character.take answers reach (whether the body can take the thing from where it stands, and how far it must move if not). On turbo's skin: skin in the table 0 mm in four of six takes, finger jumps 67 to 242 degrees a second. The body-only JSON calls (character.fit, character.hand) and the readers the calls share are raea-sys-body's 2026-11-14 23:25:42 -08:00
shinyobjectz 6df5edbde0 HG14: the body follows the hands down (where the arms fall short of where they are sent, the body goes down by that much more); the knees open for a low thing close in front of the feet, so it comes up between them. On turbo's skin the floor take: thigh skin in the box 18 to 11 mm, the hold 83 to 69 mm off. Still not right 2026-11-14 23:25:42 -08:00
shinyobjectz e80bde56c2 HG14: a limb's middle joint flexes about its own axis. The first bone is turned about itself (an upper arm in its socket) until the hinge the rest pose bends about is the one the limb is bent about, so an elbow or a knee never reads as bent sideways. On turbo the arm was reported at a limit on about 100 frames of every take; now 0 in three takes and 30 to 73 in the others 2026-11-14 23:25:42 -08:00
shinyobjectz 86cf4fe12e IX13: raea-sys-index in tools/layers.toml (systems); its copies folded: the models folder and the index home through raea-io-home's env_path, the Core ML cache judged by the package's Manifest.json (no walk of the package), the text tower loaded from SigLIP 2's folder 2026-11-14 23:20:17 -08:00
shinyobjectz b24a4537c0 IX13: raea index in the manual's CLI reference (Projects, beside library), its page indexer.md
index.md is the CLI section's own page, so raea index's page is indexer.md (pageOf in tools/manual-ref/cli.ts). Fixes
L1's manual reference step for every lane: "index: in no group".
2026-11-14 23:03:18 -08:00
shinyobjectz c5d3f83c79 IX13: raea index add|search|status|remove|serve, the fast pass kept open for the feed
raea-sys-index gains its CLI (cli.rs, wired as raea index with its usage in the help) and serve.rs: one JSON ask a
line on stdin (add, search, similar, status, remove, stop, warm), answered by id on stdout with progress events
between. A worker lists and embeds one folder at a time with its own connection and the Neural Engine model; a
searcher keeps SigLIP 2's text tower and the rows loaded, growing them from the vectors' tail as batches land and
reading them all again after a remove or a changed file. The store drops a changed file's old rows, lists sources
with their counts, removes a source with its rows and thumbnails, and never reuses a removed source's id. A run
can be stopped mid-way. Measured on 3000 pictures: 3000 embedded at 152 a second with the text tower loading
alongside, a search 22-42 ms for the words and about 1 ms over the rows.
2026-11-14 23:00:18 -08:00
shinyobjectz ef747f9b24 IX1, IX3: Index's fast pass, raea-sys-index: a folder's pictures listed, decoded from their small copy and embedded by SigLIP 2 B/16-256 on the Neural Engine, searchable by words
docs/index.feature is 0.1.5's plan (Shane 11-14: "the fastest fucking indexing tool for videos and images on the OS
and on your phone/photos/icloud"): a fast pass before Libraries' EmbeddingGemma 2 deep pass, whose picture tower
(a 16-layer ViT over up to 2,520 patches) can't be a first pass; sources for folders and drives, Photos, iCloud Drive
and Google Drive; Free local, Pro and Team also in raea's cloud; Settings -> Index; the counter as the wow.

systems/index (raea-sys-index): walk.rs lists a folder's pictures and videos (packages, hidden folders and caches
skipped); apple.rs decodes each picture's small copy with ImageIO (its embedded preview when it is 256 px or more,
else the file at a reduced size) into a 256 x 256 BGRA buffer, writes a 256 px JPEG thumbnail, and runs SigLIP 2
B/16-256 on Core ML's CPU and Neural Engine, 32 at a time (never the GPU: coreml-gpu-siglip); lib.rs overlaps the two
(decoding on every core but two, a bounded channel to the embedder); store.rs keeps a SQLite list of sources and items
keyed by where they live, and one append-only file of f16 rows per model, written as each batch finishes; text.rs is
SigLIP 2's text tower on ort; search.rs scores every row on every core and keeps the best moment per item.

Measured on this Mac (M5 Pro) with the e2e suite running beside it, examples/fast on 3,000 real files, mostly big PNGs
with no embedded preview (the worst case): listed, decoded, thumbnailed, embedded and written in 17.3 s, 173 a second
(Libraries' path: 12.6 s a file, LB1). A query 21-28 ms, a search over 3,000 rows 1 ms. "a cat" ranks the cat
references first. About 12 KB an item on disk (an 11 KB thumbnail, a 1.5 KB row).
2026-11-14 22:42:22 -08:00
shinyobjectz 578bc1d159 HG14: third round against the audit. A carried thing is pushed out of the body's skin as it will be posed (squatting for a low thing, its knees making way for the thing); the grip is chosen between the forearm's way at the grab and at the carry; the hand's skin keeps 2 cm off solids while it travels and 4 mm on its hold; a hold's hand shape is used only for fingers that miss the thing; the squat eases in and out; a heavy thing is carried within reach. On turbo: skin in the table 0 to 11 mm (from 7 to 30), body skin in a carried box 0 mm, holds within 4 to 9 mm in five of six takes. The floor take and the mug are still wrong (docs/hands.feature HG14) 2026-11-14 22:40:59 -08:00
shinyobjectz c135130ccb HG14: a carried thing is pushed out of the body's own skin (after a throw's wind-up, which drew a box 99 mm into the waist); the grip of a low thing is found with the squat the body will have there; the whole hand's skin, not three points, keeps off the scene's solids. On turbo's skin: body skin in a thrown box 99 to 0 mm, in a 14 kg box 45 to 0; finger skin in the table 7-21 to 0-13 mm. Not fixed: the floor take, and the 14 kg box's hold now 41 mm off 2026-11-14 22:32:04 -08:00
shinyobjectz ffb56a8f09 HG14: the grip's code (the hand's lie at its grab, the swivel, an arm past its ranges) is its own file; take.rs is back under 500 lines 2026-11-14 22:27:56 -08:00
shinyobjectz 761e6b98f9 HG14: the grip is the one the hand has at its grab, kept in the thing's frame, so a hand doesn't shift on what it holds; fingers curl on the body's own skin samples, and a finger that misses settles at its nearest approach instead of snapping to a fallback; the palm's place is its real skin's; a thing in one hand turns about the vertical with the forearm, up to a quarter turn. On turbo's skin: finger jumps 67 to 362 degrees a second (from up to 4,300), body-joint jumps 311 to 955, finger skin in a cup 4 to 7 mm with 4 to 5 pads on it. Still wrong and said so in docs/hands.feature HG14: the mug at the mouth (palm up to 5 cm off), the floor take, a box drawn into the waist for a throw, fingers in the table, the squat's depth. The shapes (Solid, Thing) are raea-sys-body's 2026-11-14 22:25:56 -08:00
shinyobjectz 4a0dacc29b HG14: the hold's finger direction uses the maths library's own projection (no copied helper) 2026-11-14 22:17:22 -08:00
shinyobjectz 38db0f2f23 HG14: joint turns read the short way round (a turn and its negative are one turn; the limits read a 31 degree wrist as 329 and held it to limits it was nowhere near, a 100 degree jump in one frame); the fingers' direction on a hold no longer flips where the forearm arrives straight into the surface. The audit's worst body-joint jump in the mug take: 6,107 to 1,118 degrees a second 2026-11-14 22:15:02 -08:00
shinyobjectz 03de032a28 HG14: the bar, and the audit that measures against it. tools/hands-audit runs six takes on a clean body's own skin (skeleton.json's surface samples, now read and posed by raea-sys-body) at 60 frames a second and prints the worst of each measure: skin in the thing, the scene and the body, finger pads on, joint speeds and their jumps, limits, bend. The first run showed the takes were not seamless or clip-free (docs/hands.feature HG14 has the numbers). The elbow's swing, the hand's lie on its hold, the squat's give and the knees' set-back are now continuous instead of chosen from steps: body-joint jumps down from about 3,500 to 400-750 degrees a second in five of six takes. Open: a wrist flip, finger jumps, and all the clipping 2026-11-14 22:09:20 -08:00
shinyobjectz e24d71b3b9 HG6e: the carried thing and the hands on it out of the body. own_solids: the trunk and both thighs as capsules where the pose has them; a carried thing is moved the way the body faces until none of its corners, nor the wrists behind its holds, is in them. The stick-figure filmstrip example is gone (the renders on a character replaced it, and the crate was at its size limit). 32 tests 2026-11-14 21:58:10 -08:00
shinyobjectz 55a95b4d17 HG7b, HG6d: walking up to the thing, a thing handed to another body, and an elbow out of the body's own trunk. A take works wherever the body stands and faces (a test with the body turned 120 degrees and moved 2 m). raea/character's placedPose stands a pose somewhere else; walkUp is the body's own motion for arriving at a take's standing place on a walk capture set down to end there. A hand-over is two takes: the giver's holds the thing out and leaves it as the taker's hand is on. 31 tests 2026-11-14 21:52:34 -08:00
shinyobjectz f3f7207001 HG9b, HG6c: a thing passed from hand to hand, a thing moved where it is and left (a drawer), a throw's wind-up and follow-through; forearms, knees and the carried thing out of the scene's solids. Each hand has its own part in a take (when it starts, is on, lets go), so hands come and go separately. The body bends for a thing only when it is lower than 0.88 of an arm below the shoulders. The body crate's own tests (limits, the hand prior) are its own; 29 tests in all 2026-11-14 21:46:53 -08:00
shinyobjectz ee8edf43b1 HG8a, HG9a, HG10a: a thing held one way brings its holds and hand shape; a carried thing follows a path (a drink is a key at the mouth); weight. The hand lies along the forearm as it arrives, brought level where that would tip fingers into a solid, and the elbow's swing is chosen inside the shoulder's and elbow's ranges instead of clamping the arm after the solve (clamping threw the wrist up to 18 cm off). All of a wrist's twist goes to the forearm. 25 tests 2026-11-14 21:36:00 -08:00
shinyobjectz f085ac07da HG0: done (the two crates are on main) 2026-11-14 21:25:55 -08:00
shinyobjectz f715c40319 HG0: raea-sys-body is a facility (the rig, IK and limits that raea-sys-grab builds on), so the layers allow the edge 2026-11-14 21:25:26 -08:00
shinyobjectz 705504ddf1 HG0: arm.rs is raea-sys-body's (its move was left out of the split's commit) 2026-11-14 21:25:26 -08:00
shinyobjectz 604064e720 HG0: two crates. raea-sys-grab passed 2,000 lines, so the body's half is raea-sys-body (systems/body: the rig, arm IK, joint limits, pose fitting, the hand prior and its data), what sdk/body is in TypeScript; raea-sys-grab keeps what the hands do with things (shapes, holds, the trunk's part, the take, the JSON calls). No behaviour changes; 23 tests 2026-11-14 21:25:26 -08:00
shinyobjectz f6b3188d9f HG6b, HG5b: the arms inside the rig's ranges, the head and chest out of the scene's solids, and SOMA-X's hand prior on raea's fingers. limits.rs is sdk/body's axes and limits in Rust (the same ranges); a take holds both arms inside them and says when it had to. When a solved pose puts the head, neck or chest within 9 cm of a solid the take is solved again with less bend and lean and more squat. prior.rs and data/soma_hand_prior.bin (SOMA-X, Apache-2.0; data/README.md): a 32-component model of real hand poses cut to the rig's fifteen finger joints; a hand shaped by a few numbers, any hand read back and scored; a take opens the hand as it comes in. raea/character's handShape is the native call character.hand. 23 tests. The take scene is the Character SDK project's 2026-11-14 21:25:26 -08:00
shinyobjectz 853183e2f4 HG5: the take scene is the Character SDK project's, on its drawn character (teal, 1.70 m), not a psx person; the same code runs on both bodies 2026-11-14 21:25:26 -08:00
shinyobjectz a68b96cf89 HG5a: the rest of both sources, in Rust. From Ik-Object-Holding: interact.rs pick (the nearest thing in reach that the eyes see past the scene's solids) and body.rs look (the head turned to the thing, neck and head sharing it), on through a take. From SOMA-X: fit.rs, the analytical pass of its pose inversion on marks (20 random poses recovered from joint heads and bone ends, every joint within 4 mm), and arm.rs twist_joints, its procedural twist-joint evaluator. raea/character's fitPose is the native call character.fit. A wrist stops at 70 degrees and the frame says so; the fingers point the level way the arm comes; the squat takes more from the hips and less from the back. 19 tests. docs/hands.feature says what of SOMA-X is not converted and why 2026-11-14 21:25:26 -08:00
shinyobjectz 613645ffc6 HG6a: hands stay out of the scene's solids; HG7a: a low thing is taken by bending with the feet planted, and the take says where to stand; HG4a: the carry is against the body. body.rs: clear moves a wrist's place the least that keeps the hand 2 cm off every solid in a take's avoid list; stoop lowers the hips and bends the trunk for hands that must go low, by as much as the hands have got along their reach, with leg IK holding both ankles within 5 mm; stand_for gives the place a forearm off the thing's near face (character.take answers it as stand). The wrist's path arcs up and backs off a hold's surface when leaving. 16 tests: a box on the floor held within 2 cm with the hips over 30 cm down, no point of the hand in a table at any frame. Rendered on a psx person: a cup taken over a table's edge, a box lifted from the floor onto a table. Not right yet: the squat folds the head to the knees, and the body itself keeps out of nothing 2026-11-14 21:25:26 -08:00
shinyobjectz 986fae3c62 HG5: a character in a scene takes a thing. raea/character's take(skel, base, spec, t) makes the native call character.take (runtime/calls), which is systems/grab's take_json: the pose for <Character> and the thing's place each frame, with how far a wrist missed and how far the body was turned from its own motion. Asked as JSON it is the same frame as asked in Rust (a test; 13 pass). Rendered on a psx person: a box taken off a table with both hands and thrown, a cup moved across the table in one hand, upright, the fingers round it; 420 frames, no errors. Not fixed here: hands pass through the table (HG6), and the box's carry place wants tuning by eye 2026-11-14 21:25:26 -08:00
shinyobjectz e4add11c80 HG1: systems/grab, procedural arms and hands (docs/hands.feature HG1 to HG4). A body reaches for a thing, takes it with one hand or two, carries it, and puts it down or throws it, with no capture of the action: two-bone arm IK with a pole and a reach that leans the trunk by capped shares; hold points found by casting from the holder's left and right into the thing's shape (musthafa45/Ik-Object-Holding's method, MIT), kept in the thing's frame with the surface's facing; the palm laid on a hold; each finger joint curled until its bone meets the surface; a wrist's twist moved to the forearm by SOMA-X's swing-twist split (Apache-2.0); the whole take a function of time. Plain glam, no engine yet (HG5). 12 tests on a stand-in body: 600 targets hit within 0.1 mm, palms within 6 mm of their holds from grab to release, a carried cup upright while the body turns, no body joint over 6 degrees a 60th of a second. docs/hands.feature holds what the sources and patch.gg gave and the scenarios after (HG5 to HG13) 2026-11-14 21:25:26 -08:00
shane c4fa90de4c skills at 9eea993: the Copy reference example in SKILL.md no longer reads as a raea command (#157)
raea-skills#76. engine/cli/conformance/surface.test.ts reads every backticked "raea WORD" in the agent's context as a
command that must exist, and the example "raea feed item ..." (from e2490012, landed with a4bb6e5c1) failed every
lane's L0 check with "skills/skills/raea/SKILL.md: raea feed".
2026-11-15 00:19:33 -05:00
shaneandshinyobjectz ad2e7e1cd4 docs/manual/whats-new/0.1.4.md: raea 0.1.4's notes as the manual's What's new page (published 2026-11-15 04:55 UTC, promoted from v0.1.4-rc4 at d870159c4) (#156)
Co-authored-by: shinyobjectz <[email protected]>
2026-11-15 00:12:18 -05:00
549 changed files with 26576 additions and 1813 deletions

No files matched your search

Generated
+203
View File
@@ -11460,6 +11460,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b0446e98cf4a784cc7a0177715ff317eeaa8463841c616cfc78aa4f953c4ea"
dependencies = [
"block2 0.6.2",
"objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
@@ -11550,6 +11551,20 @@ dependencies = [
"objc2-metal 0.3.2",
]
[[package]]
name = "objc2-photos"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6ea9a706f18e32cf8a0723e99855af4f135282891e07259301bae9135ae3872"
dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-core-foundation",
"objc2-foundation 0.3.2",
]
[[package]]
name = "objc2-quartz-core"
version = "0.2.2"
@@ -11577,6 +11592,20 @@ dependencies = [
"objc2-metal 0.3.2",
]
[[package]]
name = "objc2-quick-look-thumbnailing"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac8e00da1ca87ffe3ea8d20981026f013df91072a140432f0f88da9a356d9b3c"
dependencies = [
"bitflags 2.13.2",
"block2 0.6.2",
"objc2 0.6.5",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation 0.3.2",
]
[[package]]
name = "objc2-symbols"
version = "0.2.2"
@@ -13716,6 +13745,7 @@ checksum = "019b4b213425016d7d84a153c4c73afb0946fbb4840e4eece7ba8848b9d6da22"
name = "raea-app-capcut"
version = "0.1.0"
dependencies = [
"dunce",
"image",
"raea-core-scene",
"raea-io-alpha",
@@ -13730,10 +13760,13 @@ dependencies = [
name = "raea-app-check"
version = "0.1.0"
dependencies = [
"dunce",
"raea-app-check-flash",
"raea-app-check-inbox",
"raea-core-brief",
"raea-core-facts",
"raea-io-ffmpeg",
"raea-io-home",
"raea-io-trace",
"raea-sys-measure",
"serde_json",
@@ -13743,6 +13776,14 @@ dependencies = [
name = "raea-app-check-flash"
version = "0.1.0"
[[package]]
name = "raea-app-check-inbox"
version = "0.1.0"
dependencies = [
"raea-io-home",
"serde_json",
]
[[package]]
name = "raea-app-ci"
version = "0.1.0"
@@ -13756,11 +13797,13 @@ dependencies = [
name = "raea-app-direction"
version = "0.1.0"
dependencies = [
"dunce",
"raea-app-check",
"raea-app-notes",
"raea-app-registry",
"raea-core-brief",
"raea-core-facts",
"raea-io-home",
"raea-io-trace",
"raea-runtime-bundle",
"raea-runtime-react",
@@ -13788,8 +13831,10 @@ name = "raea-app-fingerprint"
version = "0.1.0"
dependencies = [
"anyhow",
"dunce",
"fastrand",
"raea-app-check",
"raea-io-home",
"raea-sys-columns",
"raea-sys-fingerprint",
"raea-sys-fingerprint-things",
@@ -13803,6 +13848,7 @@ name = "raea-app-game"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"dunce",
"raea-gpu-device",
"raea-io-home",
"raea-io-media",
@@ -13821,6 +13867,7 @@ dependencies = [
name = "raea-app-interchange"
version = "0.1.0"
dependencies = [
"dunce",
"raea-core-scene",
"raea-core-shape",
"raea-runtime-bundle",
@@ -13834,6 +13881,7 @@ name = "raea-app-judge"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"dunce",
"image",
"raea-core-facts",
"raea-io-home",
@@ -13861,6 +13909,7 @@ name = "raea-app-notes"
version = "0.1.0"
dependencies = [
"raea-core-facts",
"raea-io-home",
"raea-io-trace",
"serde",
"serde_json",
@@ -13889,8 +13938,10 @@ dependencies = [
name = "raea-app-registry"
version = "0.1.0"
dependencies = [
"dunce",
"oxc",
"raea-core-facts",
"raea-io-home",
"serde_json",
]
@@ -13898,6 +13949,7 @@ dependencies = [
name = "raea-app-solid"
version = "0.1.0"
dependencies = [
"dunce",
"raea-app-judge",
"raea-core-facts",
"raea-core-meshcheck",
@@ -13911,6 +13963,7 @@ dependencies = [
name = "raea-app-sound"
version = "0.1.0"
dependencies = [
"dunce",
"raea-io-media",
"raea-runtime-bundle",
"raea-runtime-export",
@@ -13922,6 +13975,7 @@ name = "raea-app-targets"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"dunce",
"raea-io-home",
"raea-runtime-bundle",
"serde_json",
@@ -13931,12 +13985,14 @@ dependencies = [
name = "raea-app-tools"
version = "0.1.0"
dependencies = [
"dunce",
"raea-io-assets",
"raea-io-gen",
"raea-io-home",
"raea-io-media",
"raea-runtime-bundle",
"raea-runtime-export",
"raea-sys-kimodo",
"serde_json",
]
@@ -13944,10 +14000,12 @@ dependencies = [
name = "raea-app-workspace"
version = "0.1.0"
dependencies = [
"dunce",
"raea-app-check",
"raea-app-registry",
"raea-core-brief",
"raea-core-facts",
"raea-io-home",
"serde_json",
]
@@ -14019,6 +14077,7 @@ dependencies = [
"chacha20 0.10.2",
"indexmap",
"nonmax",
"raea-io-home",
"raea-sys-parity",
"rand 0.10.3",
]
@@ -14102,6 +14161,7 @@ name = "raea-bridge-bench"
version = "0.1.0"
dependencies = [
"bevy",
"dunce",
"image",
"raea-core-alloc",
"raea-core-wire",
@@ -14126,6 +14186,7 @@ name = "raea-bundle"
version = "0.1.0"
dependencies = [
"anyhow",
"dunce",
"lightningcss",
"oxc",
"raea-io-home",
@@ -14161,6 +14222,7 @@ name = "raea-cli"
version = "0.1.0"
dependencies = [
"bevy",
"dunce",
"raea-app-capcut",
"raea-app-check",
"raea-app-ci",
@@ -14195,6 +14257,7 @@ dependencies = [
"raea-runtime-plugins",
"raea-runtime-react",
"raea-runtime-sound",
"raea-sys-index",
"regex",
"serde",
"serde_json",
@@ -14240,6 +14303,7 @@ version = "0.1.0"
name = "raea-core-facts"
version = "0.1.0"
dependencies = [
"dunce",
"raea-core-brief",
"serde",
"serde_json",
@@ -14349,6 +14413,15 @@ dependencies = [
"wgpu",
]
[[package]]
name = "raea-hands-audit"
version = "0.1.0"
dependencies = [
"glam 0.33.12",
"raea-sys-body",
"raea-sys-grab",
]
[[package]]
name = "raea-io-alpha"
version = "0.1.0"
@@ -14408,6 +14481,7 @@ dependencies = [
name = "raea-io-assets"
version = "0.1.0"
dependencies = [
"dunce",
"image",
"raea-io-home",
"ruzstd",
@@ -14430,6 +14504,7 @@ dependencies = [
name = "raea-io-capcut"
version = "0.1.0"
dependencies = [
"raea-io-home",
"serde_json",
]
@@ -14458,6 +14533,7 @@ dependencies = [
name = "raea-io-gen"
version = "0.1.0"
dependencies = [
"dunce",
"image",
"raea-io-gen-comfy",
"raea-io-gen-core",
@@ -14497,6 +14573,7 @@ dependencies = [
name = "raea-io-home"
version = "0.1.0"
dependencies = [
"dunce",
"serde_json",
"url",
]
@@ -14574,6 +14651,7 @@ dependencies = [
name = "raea-io-shell"
version = "0.1.0"
dependencies = [
"dunce",
"flate2",
"htmd",
"raea-core-calls",
@@ -14614,6 +14692,7 @@ name = "raea-modules"
version = "0.1.0"
dependencies = [
"deno_ast",
"dunce",
]
[[package]]
@@ -14621,10 +14700,12 @@ name = "raea-native"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"dunce",
"flate2",
"getrandom 0.3.4",
"libc",
"raea-core-calls",
"raea-io-home",
"raea-io-shell",
"raea-modules",
"raea-runtime-jsengine",
@@ -14649,6 +14730,7 @@ dependencies = [
"bevy",
"blitz-dom",
"blitz-html",
"dunce",
"image",
"parley",
"raea-core-wire",
@@ -14682,6 +14764,7 @@ dependencies = [
"blitz-traits",
"image",
"keyboard-types",
"raea-io-home",
"raea-io-media",
"raea-io-net-calls",
"raea-io-os",
@@ -14720,6 +14803,7 @@ dependencies = [
"bevy",
"blitz-dom",
"raea-gpu-device",
"raea-io-home",
"raea-runtime-bake",
"raea-runtime-dom",
"raea-runtime-js",
@@ -14767,6 +14851,7 @@ version = "0.1.0"
dependencies = [
"bevy",
"bytemuck",
"dunce",
"image",
"raea-core-program",
"raea-core-shape",
@@ -14797,6 +14882,7 @@ dependencies = [
"raea-sys-phase",
"raea-sys-post",
"raea-sys-procmat",
"raea-sys-rendermap",
"raea-sys-rt",
"raea-sys-sampler",
"raea-sys-screen",
@@ -14805,6 +14891,7 @@ dependencies = [
"raea-sys-sprite",
"raea-sys-text3d",
"raea-sys-three-shader",
"raea-sys-viewbox",
"raea-sys-volume",
"raea-sys-wear",
"serde_json",
@@ -14938,6 +15025,24 @@ dependencies = [
"serde_json",
]
[[package]]
name = "raea-runtime-appscreen"
version = "0.1.0"
dependencies = [
"bevy",
"blitz-traits",
"keyboard-types",
"raea-io-home",
"raea-page",
"raea-runtime-bundle",
"raea-runtime-dom",
"raea-runtime-js",
"raea-runtime-jsengine",
"raea-sys-fonts",
"raea-sys-page",
"serde_json",
]
[[package]]
name = "raea-runtime-bake"
version = "0.1.0"
@@ -14973,6 +15078,7 @@ dependencies = [
name = "raea-runtime-bundle-lib"
version = "0.1.0"
dependencies = [
"dunce",
"libloading",
"raea-io-home",
"serde_json",
@@ -14995,6 +15101,7 @@ dependencies = [
"raea-native",
"raea-runtime-plugins",
"raea-sys-fonts",
"raea-sys-grab",
"raea-sys-mix",
"raea-sys-ml",
"raea-sys-speech",
@@ -15091,6 +15198,7 @@ name = "raea-runtime-export"
version = "0.1.0"
dependencies = [
"bevy",
"dunce",
"image",
"raea-core-facts",
"raea-core-program",
@@ -15160,6 +15268,7 @@ dependencies = [
"base64 0.22.1",
"bevy",
"cpal 0.15.3",
"dunce",
"raea-bevy-world",
"raea-core-wire",
"raea-io-home",
@@ -15178,6 +15287,7 @@ name = "raea-runtime-jsengine"
version = "0.1.0"
dependencies = [
"objc2 0.6.5",
"raea-io-home",
"rquickjs",
]
@@ -15187,6 +15297,7 @@ version = "0.1.0"
dependencies = [
"bevy",
"cpal 0.15.3",
"dunce",
"image",
"raea-core-program",
"raea-gpu-device",
@@ -15232,6 +15343,7 @@ dependencies = [
"raea-io-net",
"raea-page",
"raea-render",
"raea-runtime-appscreen",
"raea-runtime-input",
"raea-runtime-react",
"raea-runtime-twins",
@@ -15391,6 +15503,7 @@ dependencies = [
name = "raea-runtime-track"
version = "0.1.0"
dependencies = [
"dunce",
"raea-io-assets",
"raea-native",
"raea-runtime-bundle",
@@ -15444,6 +15557,7 @@ name = "raea-runtime-world"
version = "0.1.0"
dependencies = [
"bevy",
"dunce",
"image",
"raea-core-facts",
"raea-core-scene",
@@ -15508,12 +15622,21 @@ name = "raea-sys-bake"
version = "0.1.0"
dependencies = [
"image",
"raea-io-home",
"rapier3d",
"serde_json",
"sha2 0.10.9",
"simba",
]
[[package]]
name = "raea-sys-body"
version = "0.1.0"
dependencies = [
"glam 0.33.12",
"serde_json",
]
[[package]]
name = "raea-sys-canvas"
version = "0.1.0"
@@ -15538,6 +15661,7 @@ dependencies = [
"half",
"image",
"ort",
"raea-io-home",
"raea-io-media",
"raea-sys-ml",
"rustfft",
@@ -15611,6 +15735,7 @@ name = "raea-sys-fingerprint"
version = "0.1.0"
dependencies = [
"anyhow",
"raea-io-home",
"raea-sys-columns",
"serde",
"serde_json",
@@ -15634,6 +15759,7 @@ name = "raea-sys-fingerprint-use"
version = "0.1.0"
dependencies = [
"anyhow",
"dunce",
"fastrand",
"image",
"raea-sys-columns",
@@ -15686,7 +15812,9 @@ dependencies = [
name = "raea-sys-footage"
version = "0.1.0"
dependencies = [
"dunce",
"image",
"raea-io-home",
"raea-io-media",
"raea-sys-layout",
"raea-sys-song",
@@ -15721,6 +15849,15 @@ dependencies = [
"serde_json",
]
[[package]]
name = "raea-sys-grab"
version = "0.1.0"
dependencies = [
"glam 0.33.12",
"raea-sys-body",
"serde_json",
]
[[package]]
name = "raea-sys-grass"
version = "0.1.0"
@@ -15756,6 +15893,37 @@ dependencies = [
"bevy",
]
[[package]]
name = "raea-sys-index"
version = "0.1.0"
dependencies = [
"anyhow",
"block2 0.6.2",
"dunce",
"half",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
"objc2-av-foundation",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-core-media",
"objc2-core-ml",
"objc2-core-video",
"objc2-foundation 0.3.2",
"objc2-image-io",
"objc2-photos",
"objc2-quick-look-thumbnailing",
"ort",
"raea-io-home",
"raea-sys-ml",
"rayon",
"rusqlite",
"serde",
"serde_json",
"tokenizers",
"walkdir",
]
[[package]]
name = "raea-sys-k"
version = "0.1.0"
@@ -15768,6 +15936,19 @@ dependencies = [
"wgpu",
]
[[package]]
name = "raea-sys-kimodo"
version = "0.1.0"
dependencies = [
"anyhow",
"mlx-rs",
"raea-io-home",
"raea-sys-ml",
"raea-sys-mlx",
"serde_json",
"tokenizers",
]
[[package]]
name = "raea-sys-layers"
version = "0.1.0"
@@ -15880,6 +16061,7 @@ name = "raea-sys-ml"
version = "0.1.0"
dependencies = [
"anyhow",
"dunce",
"half",
"ort",
"raea-io-home",
@@ -15926,6 +16108,7 @@ dependencies = [
"bevy",
"blitz-dom",
"blitz-traits",
"dunce",
"percent-encoding",
"raea-io-net",
"raea-sys-image",
@@ -15997,6 +16180,14 @@ dependencies = [
"serde_json",
]
[[package]]
name = "raea-sys-rendermap"
version = "0.1.0"
dependencies = [
"bevy",
"raea-sys-frame",
]
[[package]]
name = "raea-sys-rt"
version = "0.1.0"
@@ -16068,6 +16259,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"ort",
"raea-io-home",
"raea-sys-ml",
"serde_json",
"tokenizers",
@@ -16116,8 +16308,10 @@ dependencies = [
"bevy",
"image",
"naga",
"raea-sys-frame",
"raea-sys-material",
"raea-sys-sampler",
"raea-sys-shader",
"serde_json",
]
@@ -16138,6 +16332,14 @@ dependencies = [
"serde_json",
]
[[package]]
name = "raea-sys-viewbox"
version = "0.1.0"
dependencies = [
"bevy",
"raea-sys-frame",
]
[[package]]
name = "raea-sys-vision"
version = "0.1.0"
@@ -16150,6 +16352,7 @@ dependencies = [
"objc2-core-video",
"objc2-foundation 0.3.2",
"objc2-vision",
"raea-io-home",
"raea-io-media",
"raea-sys-layout",
"serde",
+9
View File
@@ -81,10 +81,12 @@ members = [
"systems/mix",
"systems/ml",
"systems/mlx",
"systems/kimodo",
"systems/speech",
"systems/layout",
"systems/vision",
"systems/columns",
"systems/index",
"systems/fingerprint",
"systems/fingerprint-use",
"systems/fingerprint-things",
@@ -106,6 +108,8 @@ members = [
"systems/page-ops",
"systems/frame",
"systems/hold",
"systems/body",
"systems/grab",
"systems/layers",
"systems/splat",
"systems/sprite",
@@ -116,6 +120,8 @@ members = [
"systems/screen",
"systems/matchmove",
"systems/grid",
"systems/viewbox",
"systems/rendermap",
"systems/meshseq",
"systems/environment",
"systems/look",
@@ -162,6 +168,7 @@ members = [
"runtime/export",
"runtime/live",
"runtime/page",
"runtime/appscreen",
"runtime/sound",
"runtime/look",
"runtime/scene",
@@ -169,6 +176,7 @@ members = [
"runtime/shared",
"apps/check",
"apps/check/flash",
"apps/check/inbox",
"apps/direction",
"apps/notes",
"apps/fingerprint",
@@ -187,6 +195,7 @@ members = [
"apps/capcut",
"apps/play",
"tools/sdk-props",
"tools/hands-audit",
]
exclude = [
"engine/sandbox/rtools",
-176
View File
@@ -1,176 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
-23
View File
@@ -1,23 +0,0 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-1
View File
@@ -175,7 +175,6 @@ LICENSES/<crate>-<version>/.
deterministic-hash 1.0.2: MIT
disjoint-sets 0.4.2: MIT/Apache-2.0
dot_vox 5.2.0: MIT
dyn-clone 1.0.20: MIT OR Apache-2.0
dyn-eq 0.1.3: MPL-2.0
dyn-hash 1.0.0: MIT OR Apache-2.0
earcut 0.4.5: ISC
+44 -6
View File
@@ -32,14 +32,42 @@
---
> **v0.1.1** is raea's first full release: the engine and, for the first time, the desktop app, on macOS (Apple
> Silicon), Linux (x86_64) and, newest and least tested, Windows (x86_64). raea is young: expect rough edges and gaps
> in the docs.
> **0.1.6** (17 November 2026) is the latest release: the engine and the desktop app on macOS (Apple Silicon), Linux
> (x86_64) and, newest and least tested, Windows 10 and 11 (x86_64). raea is young and moves fast, with a release most
> days since 0.1.1 on 11 November: expect rough edges, and tell us what you hit in an
> [issue](https://github.com/shinyobjectz/raea/issues), or from your agent with `raea bug`.
## The app
The raea app is where you make video and games with your AI. Download it from [raea.io](https://raea.io) for the Mac,
Windows or Linux. It tells you when a new version is out; on the Mac it updates itself.
The raea app is where you make video, 3D and games with your AI. You ask in a chat; your own AI (Claude, ChatGPT, Kimi
or a local model) writes the raea code and renders it; what it makes lands in the project's feed, where you watch it,
scrub it, mark it up and send it back with notes. Download it from [raea.io](https://raea.io) for the Mac, Windows or
Linux. It tells you when a new version is out; on the Mac it updates itself.
<p align="center">
<a href="https://media.raea.io/#goose-learns-raea"><img src="docs/readme/goose-learns-raea.jpg" width="720" alt="The raea app tutorial"></a>
</p>
New to the app? **[Watch the tutorial](https://media.raea.io/#goose-learns-raea)** (5:50).
What the app does now:
- **The chat comes first** (0.1.5): your projects in a rail, the conversation in the middle, and `/goal` to keep an
agent going until a condition you set holds.
- **A timeline you edit by hand** (0.1.4): trim, split and move clips, speed curves, freeze frames and keys, the way
CapCut works, under every film, sound and scene.
- **Scenes you walk around in** (0.1.3): your agent posts a 3D scene and you walk through it, pin comments in it and
move its parts by hand; every change is written into the scene's own code.
- **Index** (0.1.5): your folders, drives and Apple Photos made searchable by what's in them, on your Mac. On an M5 Pro,
10,000 pictures were searchable in under a minute.
- **Review** (0.1.6): each project has a Review tab, every comment you leave reaches the agent, and export is one
window.
- **Lighter** (0.1.6): the window gives back memory it's finished with and rests when nothing changes, 34% less CPU
at rest.
The app and the engine are free. Pro adds cloud storage, search across your computers and publishing; Team puts up to
five people on one plan ([pricing](https://raea.io/pricing/)). Each release's notes are on the
[releases page](https://github.com/shinyobjectz/raea/releases).
## Install
@@ -92,12 +120,19 @@ floor (`raea check hello.mp4`). `raea init` starts a project, and `raea --help`
- **Games.** Input, physics, sound and 3D, played live with `raea play`, and exported as a program of their own
(`raea export-game`).
- **3D.** Scenes in TypeScript drawn by [Bevy](https://bevyengine.org) 0.20: cameras, lights, materials, glTF models,
Gaussian splats, and Bevy plugins compiled into the engine.
Gaussian splats, and Bevy plugins compiled into the engine. three.js work runs as it's written: a React Three Fiber
scene inside `<R3F>`, or a three.js page's script inside `<Three program>`.
- **Sound.** One mixer for live play and offline render, instruments and effects, and local models for foley and
instrument notes (`raea sao`, `raea tokensynth`).
- **Built for agents.** Everything it draws stays queryable as data, so an agent can render a frame, look at it, and
fix what's wrong without a person in the loop.
## Made in raea
Films, music videos, a tutorial and a game made with raea are on [media.raea.io](https://media.raea.io). Six of them
come with their source in [raea-films](https://github.com/shinyobjectz/raea-films): each project's code under
Apache-2.0, to read, render and take apart, and its models, textures and sound for anyone with a free raea account.
## Use it from your agent
- **Agent skills.** They live in [raea-skills](https://github.com/shinyobjectz/raea-skills), pinned here as
@@ -108,6 +143,9 @@ floor (`raea check hello.mp4`). `raea init` starts a project, and `raea --help`
folder of raea-skills, and `/plugin marketplace add shinyobjectz/raea` installs the same one.
- **Craft guides.** `raea guide` prints the floor every edit is held to and the guides for pitches, explainers, stories,
games, motion, music and layout. `raea context PROJECT` says what to read before working on a project.
- **Bug reports.** When an agent finds a bug in raea itself, `raea bug TITLE --text TEXT` sends it to raea's server
with raea's version and the OS, no account needed. It sends words only: paths, emails and keys are taken out before
it goes, and `--dry-run` prints what would go.
## Build from source
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "`raea export capcut`: a composition as a CapCut draft ready in its timeline, its footage and sounds as clips of their files and what raea draws as transparent overlays (docs/capcut.feature)"
[dependencies]
dunce = "1"
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-io-capcut = { path = "../../io/capcut" }
raea-io-alpha = { path = "../../io/alpha" }
+1 -1
View File
@@ -64,7 +64,7 @@ fn render(args: &[String], env: &[(&str, &str)]) -> R<()> {
fn export(args: &[String]) -> R<String> {
let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?;
let tsx = PathBuf::from(tsx).canonicalize().map_err(|e| format!("{tsx}: {e}"))?;
let tsx = dunce::canonicalize(&PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?;
let dir = tsx.parent().unwrap().to_path_buf();
let codec = flag(args, "--alpha-codec").map_or(Ok(raea_io_alpha::Codec::default_here()), |c| raea_io_alpha::Codec::parse(&c))?;
let (root, in_store) = match flag(args, "-o") {
+1 -1
View File
@@ -178,5 +178,5 @@ pub fn lay(kind: Kind, name: &str, clips: Vec<Clip>) -> Vec<Track> {
/// media/, then the project's media/ and assets/; else absolute; else relative to the composition's folder.
pub fn resolve(dir: &Path, src: &str) -> PathBuf {
let p = raea_core_scene::media_path(dir, src);
p.canonicalize().unwrap_or(p)
dunce::canonicalize(&p).unwrap_or(p)
}
+1 -1
View File
@@ -77,7 +77,7 @@ fn a_static_file_is_found_in_the_edits_media_folder() {
let dir = std::env::temp_dir().join(format!("raea-capcut-resolve-{}", std::process::id()));
std::fs::create_dir_all(dir.join("media")).unwrap();
std::fs::write(dir.join("media/a.mp4"), "").unwrap();
let want = dir.join("media/a.mp4").canonicalize().unwrap();
let want = dunce::canonicalize(&dir.join("media/a.mp4")).unwrap();
assert_eq!(resolve(&dir, "/media/a.mp4"), want);
assert_eq!(resolve(&dir, "media/a.mp4"), want);
assert_eq!(resolve(&dir, want.to_str().unwrap()), want);
+4
View File
@@ -7,10 +7,12 @@ publish = false
description = "`raea check`: the floor's measurable lines on an export, ranked P0-P3"
[dependencies]
dunce = "1"
# taste.ts rules, as the raea CLI evaluates them (docs/projects.feature PJ0)
raea-core-brief = { path = "../../core/brief" }
# a transcript's words, read as `raea world` reads them (docs/direction.feature DR1)
raea-core-facts = { path = "../../core/facts" }
raea-io-home = { path = "../../io/home" }
# a check's record named by when it was (UTC, DR3)
raea-io-trace = { path = "../../io/trace" }
# ffmpeg's flag for every decoded frame, by its version
@@ -19,4 +21,6 @@ raea-io-ffmpeg = { path = "../../io/ffmpeg" }
raea-sys-measure = { path = "../../systems/measure" }
# the flashing screen (WCAG 2.3.1), split out to keep this crate small
raea-app-check-flash = { path = "flash" }
# what the person sent from the raea app, handed to the agent (split out to keep this crate small)
raea-app-check-inbox = { path = "inbox" }
serde_json = "1"
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "raea-app-check-inbox"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "`raea hook`'s hand-over: what the person sent from the raea app, read from the session's inbox once and handed to the agent at its next step"
[dependencies]
serde_json = "1"
# the inbox folder, under the home folder
raea-io-home = { path = "../../../io/home" }
+105
View File
@@ -0,0 +1,105 @@
//! What the person sent from the raea app, handed to the session it's for at its next step (docs/agents.feature A3c;
//! Shane 11-14: a reply in the feed "doesn't confirm, doesn't interrupt the agent", and the app forked a copy of the
//! session so two agents ran). A session that posted with `raea show` has an inbox, ~/.raea/inbox/<inbox>.jsonl, and
//! the app writes there what the person sends on its items or to it in the feed, even while its terminal is busy. This
//! hook reads what was added since it last looked, after any tool call and when a turn is about to end, and hands it
//! over: as the tool's context, or as the reason the turn goes on. How far it has read is kept beside the inbox
//! (<inbox>.read, a byte offset), which the app reads to say the message was read.
use serde_json::Value;
use std::path::{Path, PathBuf};
/// The session's inbox, named as `raea show` names it (engine/cli/src/show.ts posterOf): the harness's name and the
/// first eight of its session id.
pub fn name(agent: &str, v: &Value) -> Option<String> {
let session = v["session_id"].as_str().map(String::from).or_else(|| std::env::var("CLAUDE_CODE_SESSION_ID").ok()).filter(|s| !s.is_empty())?;
let slug = match agent {
"claude" => "claude-code",
"codex" => "codex",
"gemini" => "gemini",
_ => return None,
};
// the id's word characters, dots and dashes, as posterOf's /[^\w.-]/ leaves them
let id: String = session.chars().filter(|c| c.is_ascii_alphanumeric() || "_.-".contains(*c)).take(8).collect();
Some(format!("{slug}-{id}"))
}
/// $RAEA_INBOX_DIR, else ~/.raea/inbox
pub fn dir() -> PathBuf {
raea_io_home::env_path("RAEA_INBOX_DIR", ".raea/inbox")
}
/// The lines added to the inbox since the last look, each read once: the cursor moves past them.
pub fn unread(dir: &Path, inbox: &str) -> Vec<Value> {
let file = dir.join(format!("{inbox}.jsonl"));
let mark = dir.join(format!("{inbox}.read"));
let Ok(all) = std::fs::read(&file) else { return vec![] };
let from = std::fs::read_to_string(&mark).ok().and_then(|s| s.trim().parse::<usize>().ok()).unwrap_or(0).min(all.len());
// only whole lines: one being written stays for the next look
let Some(end) = all[from..].iter().rposition(|&b| b == b'\n').map(|i| from + i + 1) else { return vec![] };
let lines = String::from_utf8_lossy(&all[from..end]).lines().filter_map(|l| serde_json::from_str(l).ok()).collect();
let _ = std::fs::write(&mark, end.to_string());
lines
}
/// One line as the agent reads it: who it's on, what kind, the words.
fn said(l: &Value) -> String {
let s = |k: &str| l[k].as_str().unwrap_or("").trim().to_string();
let on = if s("item").is_empty() { String::new() } else { format!(" on item {} \"{}\"", s("item"), s("title")) };
let kind = s("kind");
let text = s("text");
let what = match kind.as_str() {
"message" => format!("a message{}: {text}", if s("project").is_empty() { String::new() } else { format!(" (project {})", s("project")) }),
"edits" => format!("edits{on}:\n{text}{}", if s("tasks").is_empty() { String::new() } else { format!("\n({})", s("tasks")) }),
"note" => format!("a note{on}: {text}"),
"answer" => format!("answers{on}: {text}"),
"result" => format!("a result{on}: {text}"),
"correction" => format!("a correction{on}: {text}"),
"sign" => format!("a sign-off{on} (ask {})", l["ask"]),
k => format!("{}{on}: {text}", if k.is_empty() { "something" } else { k }),
};
format!("- {what}")
}
/// What the agent is told, or None when nothing's new.
pub fn told(agent: &str, v: &Value) -> Option<String> {
let inbox = name(agent, v)?;
let lines = unread(&dir(), &inbox);
if lines.is_empty() {
return None;
}
let list = lines.iter().map(said).collect::<Vec<_>>().join("\n");
Some(format!(
"raea: the person just sent this from the raea app (your inbox, ~/.raea/inbox/{inbox}.jsonl; marked read, so the app shows it as read):\n{list}\nTake it up now, before going on: it may change what you're doing. What you say next shows under your session in their feed; answer an item with raea show --on ITEM --note LINE, or post the next version with raea show FILE --replaces ITEM."
))
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
#[test]
fn each_line_is_handed_over_once_and_a_half_written_one_waits() {
let d = std::env::temp_dir().join(format!("raea-inbox-{}", std::process::id()));
let _ = std::fs::remove_dir_all(&d);
std::fs::create_dir_all(&d).unwrap();
let f = d.join("claude-code-abcd1234.jsonl");
std::fs::write(&f, "{\"kind\":\"message\",\"text\":\"more epic\"}\n{\"kind\":\"no").unwrap();
let first = unread(&d, "claude-code-abcd1234");
assert_eq!(first.len(), 1);
assert_eq!(said(&first[0]), "- a message: more epic");
assert!(unread(&d, "claude-code-abcd1234").is_empty());
std::fs::write(&f, "{\"kind\":\"message\",\"text\":\"more epic\"}\n{\"kind\":\"note\",\"item\":\"i-1\",\"title\":\"Board\",\"text\":\"hills taller\"}\n").unwrap();
let next = unread(&d, "claude-code-abcd1234");
assert_eq!(next.len(), 1);
assert_eq!(said(&next[0]), "- a note on item i-1 \"Board\": hills taller");
assert_eq!(std::fs::read_to_string(d.join("claude-code-abcd1234.read")).unwrap(), std::fs::metadata(&f).unwrap().len().to_string());
let _ = std::fs::remove_dir_all(&d);
}
#[test]
fn the_inbox_is_named_as_raea_show_names_it() {
assert_eq!(name("claude", &json!({"session_id": "15cd6bb0-8829-466f-a28a-bbca3d35be92"})).as_deref(), Some("claude-code-15cd6bb0"));
assert_eq!(name("kimi", &json!({"session_id": "x"})), None);
}
}
+15 -4
View File
@@ -3,7 +3,8 @@
//! --agent A` adds them, and they hold inside the raea app too, which leaves each agent its own shell). Before a shell
//! command: media opened in the Mac's viewer or a browser is stopped once while the raea app is installed, the reason
//! naming `raea show`; the same command tried again goes through, so an agent that means it says so twice. After a
//! file is saved: the quick check on a composition. A stop is exit 2 with the reason on stderr, which every harness
//! file is saved: the quick check on a composition. After any tool, and as a turn ends: what the person sent from the raea
//! app (inbox.rs). A stop is exit 2 with the reason on stderr, which every harness
//! hands its agent; the quick check's findings go back in the shape each one reads.
use serde_json::{Value, json};
use std::path::{Path, PathBuf};
@@ -144,8 +145,16 @@ pub fn hook(args: &[String]) -> R<String> {
std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).map_err(|e| e.to_string())?;
let v: Value = serde_json::from_str(&input).unwrap_or_default();
let agent = named.unwrap_or_else(|| agent_of(&v));
if let Some(cmd) = shell_command(&v) {
let home = std::env::var("HOME").unwrap_or_default();
let event = v["hook_event_name"].as_str().unwrap_or("");
// what the person sent from the raea app since the last look (inbox.rs): handed over after any tool, and a turn about
// to end goes on to take it up
let sent = if matches!(event, "PostToolUse" | "AfterTool" | "Stop") { crate::inbox::told(agent, &v) } else { None };
if event == "Stop" {
return Ok(sent.map(|s| json!({"decision": "block", "reason": s}).to_string()).unwrap_or_default());
}
let after_tool = matches!(event, "PostToolUse" | "AfterTool");
if let Some(cmd) = shell_command(&v).filter(|_| !after_tool) {
let home = raea_io_home::user_home().unwrap_or_default().display().to_string();
let files = opened_media(cmd);
let key = format!("{}\n{}\n{cmd}", v["session_id"].as_str().unwrap_or(""), v["cwd"].as_str().unwrap_or(""));
if !files.is_empty() && app_installed(&home) && !tried_before(&PathBuf::from(&home).join(".raea/hooks/again"), &key) {
@@ -159,7 +168,9 @@ pub fn hook(args: &[String]) -> R<String> {
let (report, _) = crate::quick::quick(std::slice::from_ref(path), Vec::new())?;
found.extend(report.lines().skip(1).filter(|l| !l.starts_with("ok ")).map(String::from));
}
Ok(if found.is_empty() { String::new() } else { after(agent, &format!("raea check --quick after this save:\n{}", found.join("\n"))) })
let quick = (!found.is_empty()).then(|| format!("raea check --quick after this save:\n{}", found.join("\n")));
let text = [sent, quick].into_iter().flatten().collect::<Vec<_>>().join("\n\n");
Ok(if text.is_empty() { String::new() } else { after(agent, &text) })
}
#[cfg(test)]
+1
View File
@@ -26,6 +26,7 @@ mod text;
use text::*;
pub mod quick;
pub mod hook;
pub use raea_app_check_inbox as inbox;
#[cfg(test)]
mod tests;
+1 -1
View File
@@ -22,7 +22,7 @@ pub(crate) struct Run {
pub(crate) fn brand_kit(near: &[&str], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let mut seen = std::collections::HashSet::new();
for start in near.iter().filter(|p| !p.is_empty()) {
let abs = std::path::Path::new(start).canonicalize().unwrap_or_else(|_| std::path::PathBuf::from(start));
let abs = dunce::canonicalize(&std::path::Path::new(start)).unwrap_or_else(|_| std::path::PathBuf::from(start));
let mut d = abs.parent();
for _ in 0..5 {
let Some(here) = d else { break };
+2
View File
@@ -7,6 +7,8 @@ publish = false
description = "How raea takes direction (docs/direction.feature): `raea world`, a composition's frame as one world of facts, queried across media"
[dependencies]
dunce = "1"
raea-io-home = { path = "../../io/home" }
raea-runtime-world = { path = "../../runtime/world" }
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-core-facts = { path = "../../core/facts" }
+4 -4
View File
@@ -32,7 +32,7 @@ pub struct Host {
/// The person's taste folder: RAEA_TASTE, else ~/.raea/taste.
pub fn taste_dir() -> Option<PathBuf> {
std::env::var_os("RAEA_TASTE").map(PathBuf::from).or_else(|| std::env::var_os("HOME").map(|h| PathBuf::from(h).join(".raea/taste")))
std::env::var_os("RAEA_TASTE").map(PathBuf::from).or_else(|| raea_io_home::user_home().map(|h| h.join(".raea/taste")))
}
/// The .ts files `--taste` names: the file, or every .ts in the folder. A file named under the person's taste folder
@@ -133,12 +133,12 @@ fn held(project: &Path, given: Vec<PathBuf>, host: &Host) -> (Vec<Rule>, Vec<Fin
/// The compositions `target` names: each (its file, its id when the file registers several).
fn compositions(target: &Path, args: &[String]) -> R<Vec<(PathBuf, Option<String>)>> {
let one = flag(args, "--composition");
let (dir, file) = if target.is_dir() { (target.to_path_buf(), None) } else { (target.parent().unwrap_or(Path::new(".")).to_path_buf(), Some(target.canonicalize().map_err(|e| format!("{}: {e}", target.display()))?)) };
let (dir, file) = if target.is_dir() { (target.to_path_buf(), None) } else { (target.parent().unwrap_or(Path::new(".")).to_path_buf(), Some(dunce::canonicalize(&target).map_err(|e| format!("{}: {e}", target.display()))?)) };
let reg = raea_app_registry::scan(&dir, &[]);
let mut out: Vec<(PathBuf, Option<String>)> = Vec::new();
for c in &reg.compositions {
let path = reg.dir.join(&c.file);
let path = path.canonicalize().unwrap_or(path);
let path = dunce::canonicalize(&path).unwrap_or(path);
let id = (c.how == raea_app_registry::How::Registered).then(|| c.id.clone());
if file.as_ref().is_none_or(|f| *f == path) && one.as_ref().is_none_or(|o| Some(o) == id.as_ref()) {
out.push((path, id));
@@ -325,7 +325,7 @@ pub fn check(args: &[String], host: &Host) -> R<(String, bool)> {
let target = raea_app_check::words(args, &TAKES).first().map_or_else(|| PathBuf::from("."), PathBuf::from);
// the folder it is in, made whole (`lyric.tsx`'s is the empty path): a rule's check is a path from it
let here = if target.is_dir() { target.clone() } else { target.parent().filter(|p| !p.as_os_str().is_empty()).map_or_else(|| PathBuf::from("."), Path::to_path_buf) };
let here = here.canonicalize().map_err(|e| format!("{}: {e}", here.display()))?;
let here = dunce::canonicalize(&here).map_err(|e| format!("{}: {e}", here.display()))?;
let project = record::up(&here, ".raea/project").unwrap_or(here);
let (mut rules, unread, notes) = rules(&project, taste_files(args), host);
if let Some(only) = flag(args, "--only") {
+1 -1
View File
@@ -84,7 +84,7 @@ pub fn cli(args: &[String]) -> Result<String, String> {
}
let target = args.get(1).filter(|a| !a.starts_with("--")).map_or_else(|| PathBuf::from("."), PathBuf::from);
// made absolute first: a bare name's parent is "", which names no folder
let from = if target.is_file() { target.canonicalize().unwrap_or_else(|_| target.clone()).parent().map_or_else(|| PathBuf::from("."), Path::to_path_buf) } else { target.clone() };
let from = if target.is_file() { dunce::canonicalize(&target).unwrap_or_else(|_| target.clone()).parent().map_or_else(|| PathBuf::from("."), Path::to_path_buf) } else { target.clone() };
let project = record::up(&from, ".raea/project").ok_or_else(|| format!("raea findings: {} isn't in a raea project (no .raea/project at or above it), so nothing is recorded\n{USAGE}", target.display()))?;
let (about, check, since) = (flag(args, "--about"), flag(args, "--check"), flag(args, "--since"));
let keep = |f: &Finding| about.as_deref().is_none_or(|n| f.about.iter().any(|a| a.name == n || a.key.as_deref() == Some(n))) && check.as_deref().is_none_or(|c| f.check == c);
+1 -1
View File
@@ -69,7 +69,7 @@ pub fn run(files: &[PathBuf], plan: &[Planned], worlds: &[Facts], host: &Host) -
std::fs::create_dir_all(&work).map_err(|e| e.to_string())?;
let data = work.join("worlds.json");
std::fs::write(&data, serde_json::to_string(worlds).map_err(|e| e.to_string())?).map_err(|e| e.to_string())?;
let imports: String = files.iter().enumerate().map(|(i, f)| format!("import c{i} from {:?};\n", f.canonicalize().unwrap_or_else(|_| f.clone()).display().to_string())).collect();
let imports: String = files.iter().enumerate().map(|(i, f)| format!("import c{i} from {:?};\n", dunce::canonicalize(&f).unwrap_or_else(|_| f.clone()).display().to_string())).collect();
let checks = (0..files.len()).map(|i| format!("c{i}")).collect::<Vec<_>>().join(", ");
let planned: Vec<Value> = plan.iter().map(|p| json!({"check": p.check, "frames": p.frames, "values": p.values, "level": p.level, "by": p.by})).collect();
let entry = format!(
+1 -1
View File
@@ -47,7 +47,7 @@ pub(crate) fn spec(p: &Path) -> String {
}
pub fn run(args: &[String]) -> R<String> {
let ts = PathBuf::from(&args[2]).canonicalize().map_err(|e| format!("{}: {e}", args[2]))?;
let ts = dunce::canonicalize(&PathBuf::from(&args[2])).map_err(|e| format!("{}: {e}", args[2]))?;
let file = args.get(3).filter(|a| a.ends_with(".blend")).map(PathBuf::from);
// ARGS for Blender's sys.argv, without raea's own --timeout SECS
let mut rest = args[if file.is_some() { 4 } else { 3 }..].to_vec();
+1 -1
View File
@@ -197,7 +197,7 @@ pub fn setup(args: &[String]) -> R<String> {
/// The project folder: DIR, else the current folder; it needs its project.godot.
fn project(arg: Option<&String>) -> R<PathBuf> {
let dir = arg.map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
let dir = dir.canonicalize().map_err(|e| format!("{}: {e}", dir.display()))?;
let dir = dunce::canonicalize(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
if !dir.join("project.godot").is_file() {
return Err(format!("{} has no project.godot", dir.display()));
}
+2 -2
View File
@@ -38,7 +38,7 @@ fn opts(args: &[String]) -> R<Opts> {
let script = args.get(2).ok_or("raea godot run SCRIPT.ts [--project DIR] [--window] [--movie FILE [--fps N] [--frames N]] [--scene res://X.tscn] [--size WxH] [--timeout S] [ARGS...]")?;
// no script, only flags: the project's --scene plays with nothing of yours added (sdk/godot/src/host/none.ts)
let bare = script.starts_with("--");
let script = if bare { raea_io_home::home().join("sdk/godot/src/host/none.ts") } else { PathBuf::from(script).canonicalize().map_err(|e| format!("{script}: {e}"))? };
let script = if bare { raea_io_home::home().join("sdk/godot/src/host/none.ts") } else { dunce::canonicalize(&PathBuf::from(script)).map_err(|e| format!("{script}: {e}"))? };
let mut o = Opts { script, project: None, window: false, timeout: 3600.0, movie: None, fps: 30, size: None, frames: None, scene: None, rest: Vec::new() };
let mut it = args[if bare { 2 } else { 3 }..].iter();
while let Some(a) = it.next() {
@@ -176,7 +176,7 @@ pub fn run(args: &[String]) -> R<String> {
}
// the project: --project, the nearest project.godot above the script, else an empty one for this run
let found = match &o.project {
Some(p) => Some(p.canonicalize().map_err(|e| format!("{}: {e}", p.display()))?),
Some(p) => Some(dunce::canonicalize(&p).map_err(|e| format!("{}: {e}", p.display()))?),
None => nearest_project(o.script.parent().unwrap_or(Path::new("."))),
};
let temp = std::env::temp_dir().join(format!("raea-godot-{}", std::process::id()));
+2 -2
View File
@@ -69,7 +69,7 @@ pub fn godot_export(args: &[String]) -> R<String> {
}
pub fn godot_back(args: &[String]) -> R<String> {
let dir = PathBuf::from(args.get(2).ok_or(USAGE)?).canonicalize().map_err(|e| format!("{}: {e}", args[2]))?;
let dir = dunce::canonicalize(&PathBuf::from(args.get(2).ok_or(USAGE)?)).map_err(|e| format!("{}: {e}", args[2]))?;
let media = media_of(&dir)?;
let now = dir.join(".raea-now.json");
let script = raea_io_home::home().join("sdk/godot/src/host/back.ts");
@@ -129,7 +129,7 @@ pub fn blender_open(args: &[String]) -> R<String> {
}
pub fn blender_back(args: &[String]) -> R<String> {
let blend = PathBuf::from(args.get(2).filter(|a| a.ends_with(".blend")).ok_or(USAGE)?).canonicalize().map_err(|e| format!("{}: {e}", args[2]))?;
let blend = dunce::canonicalize(&PathBuf::from(args.get(2).filter(|a| a.ends_with(".blend")).ok_or(USAGE)?)).map_err(|e| format!("{}: {e}", args[2]))?;
let dir = blend.parent().ok_or("the .blend's folder")?.to_path_buf();
if !dir.join("scene.json").is_file() {
return Err(format!("{} has no scene.json beside it: raea blender back reads a .blend raea blender open made", blend.display()));
+1 -1
View File
@@ -113,7 +113,7 @@ pub fn blender(args: &[String]) -> R<String> {
let entry = if is_blend {
format!("{shoot}Promise.resolve().then(() => shoot({opts})){}\n", blender_ts::CLOSE)
} else {
let ts = src.canonicalize().map_err(|e| format!("{}: {e}", s.src))?;
let ts = dunce::canonicalize(&src).map_err(|e| format!("{}: {e}", s.src))?;
format!("import * as M from {};\n{shoot}{}.then(() => shoot({opts})){}\n", blender_ts::spec(&ts), blender_ts::DEFAULT, blender_ts::CLOSE)
};
let mut rest = s.rest.clone();
+2
View File
@@ -7,6 +7,8 @@ publish = false
description = "`raea fingerprint` (docs/fingerprint.feature FP3a): new, bootstrap, teach, score and report, run by a resident service on localhost that keeps the encoders loaded"
[dependencies]
dunce = "1"
raea-io-home = { path = "../../io/home" }
# the taxonomy, evidence and heads
raea-sys-fingerprint = { path = "../../systems/fingerprint" }
# scoring and the sheet, which one judges a piece, diff and profiles
+2 -2
View File
@@ -23,7 +23,7 @@ pub const INBOX: &str = "fingerprint";
/// A post's video on this machine: the renders library, else the project's own folder
fn media(project: &Path, m: &Value) -> Option<PathBuf> {
let p = m["path"].as_str()?;
let home = PathBuf::from(std::env::var("HOME").unwrap_or_default());
let home = raea_io_home::user_home().unwrap_or_default();
[home.join(".raea/feed/media").join(p), project.join(p)].into_iter().find(|f| f.is_file())
}
@@ -208,7 +208,7 @@ pub(crate) fn readings_here(args: &[String], cwd: &Path) -> i32 {
}
if has(args, "--tally") {
let asked: serde_json::Map<String, Value> = std::fs::read(dir.dir.join("asked.json")).ok().and_then(|b| serde_json::from_slice(&b).ok()).unwrap_or_default();
let inbox = PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(format!(".raea/inbox/{INBOX}.jsonl"));
let inbox = raea_io_home::user_home().unwrap_or_default().join(format!(".raea/inbox/{INBOX}.jsonl"));
for line in std::fs::read_to_string(inbox).unwrap_or_default().lines() {
let Ok(v) = serde_json::from_str::<Value>(line) else { continue };
let Some(batch) = v["item"].as_str().and_then(|i| asked.get(i)).and_then(Value::as_array) else { continue };
+2 -2
View File
@@ -10,7 +10,7 @@ use raea_sys_fingerprint::evidence::{Row, features};
use raea_sys_fingerprint::retrain;
use raea_sys_fingerprint_use::postmortem::{self as pm, MOST};
use raea_sys_fingerprint_use::score::{Scored, score};
use std::path::{Path, PathBuf};
use std::path::Path;
pub(crate) fn run(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let project = crate::pick::piece_in(args, cwd).parent().map(Path::to_path_buf).unwrap_or_else(|| cwd.to_path_buf());
@@ -18,7 +18,7 @@ pub(crate) fn run(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -
let (dir, fp, w) = crate::verbs::open(enc, args, eval, Some(&crate::pick::piece_in(args, cwd)))?;
let before = dir.trained()?.map(|t| t.0).ok_or_else(|| anyhow!("{} has no trained heads yet: `raea fingerprint bootstrap` or teach it first", fp.name))?;
if has(args, "--tally") {
let inbox = std::fs::read_to_string(PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(format!(".raea/inbox/{}.jsonl", pm::INBOX))).unwrap_or_default();
let inbox = std::fs::read_to_string(raea_io_home::user_home().unwrap_or_default().join(format!(".raea/inbox/{}.jsonl", pm::INBOX))).unwrap_or_default();
let answers = pm::answered(&dir.dir, &inbox);
let mut l = dir.ledger()?;
// every tally adds every answer again, so tallying twice is safe
+2 -2
View File
@@ -12,10 +12,10 @@ use std::path::{Path, PathBuf};
pub(crate) fn run(enc: &mut Encoders, args: &[String], cwd: &Path) -> Result<(String, i32)> {
let file = cwd.join(args.first().filter(|a| !a.starts_with("--")).ok_or_else(|| anyhow::anyhow!("things FILE"))?);
let project = flag(args, "--project").map_or_else(|| cwd.to_path_buf(), |p| cwd.join(p));
let me = file.canonicalize().ok();
let me = dunce::canonicalize(&file).ok();
let marks: Vec<Mark> = crate::notes::pinned(&project)
.into_iter()
.filter(|r| r.media.canonicalize().ok() == me)
.filter(|r| dunce::canonicalize(&r.media).ok() == me)
.filter_map(|r| Some(Mark { name: r.text.chars().take(40).collect(), t: r.t, a: (r.t - 1.0).max(0.0), b: r.to.unwrap_or(r.t + 1.0), region: r.region? }))
.collect();
let t = things(enc, &file, &marks)?;
+1
View File
@@ -19,6 +19,7 @@ player = []
surfaces = ["raea-runtime-react/surfaces"]
[dependencies]
dunce = "1"
raea-runtime-react = { path = "../../runtime/react", default-features = false }
raea-runtime-page = { path = "../../runtime/page" }
raea-runtime-export = { path = "../../runtime/export" }
+7 -13
View File
@@ -14,7 +14,7 @@ pub(crate) fn keep_dsym(player: &Path) {
let Ok(o) = std::process::Command::new("dwarfdump").arg("--uuid").arg(&dsym).output() else { return };
let text = String::from_utf8_lossy(&o.stdout);
let Some(uuid) = text.split_whitespace().nth(1).filter(|u| u.len() == 36) else { return };
let Some(home) = std::env::var_os("HOME") else { return };
let Some(home) = raea_io_home::user_home() else { return };
let to = Path::new(&home).join("Library/Caches/raea/dsym").join(uuid).join("raea-game.dSYM");
if to.exists() {
return;
@@ -34,7 +34,7 @@ pub const USAGE: &str = "raea export-game EDIT.tsx -o OUT [--target mac-app|mac-
pub fn export(args: &[String]) -> R<String> {
let usage = USAGE;
let tsx = PathBuf::from(args.get(1).filter(|a| !a.starts_with("--")).ok_or(usage)?);
let tsx = tsx.canonicalize().map_err(|e| format!("{}: {e}", tsx.display()))?;
let tsx = dunce::canonicalize(&tsx).map_err(|e| format!("{}: {e}", tsx.display()))?;
let dir = tsx.parent().unwrap().to_path_buf();
let out = PathBuf::from(flag(args, "-o").ok_or(usage)?);
let target = flag(args, "--target").unwrap_or_else(|| if out.extension().is_some_and(|x| x == "app") { "mac-app".into() } else { "mac-cli".into() });
@@ -88,7 +88,10 @@ pub fn export(args: &[String]) -> R<String> {
opts.push(p.display().to_string());
}
}
opts.push("--lite".into());
// on live play's runtime, or React for an edit drawing R3F (raea_runtime_live::needs_react)
if !raea_runtime_live::needs_react(&dir) {
opts.push("--lite".into());
}
let js = game.join("bundle.js");
raea_runtime_react::scene::bundle_composition(&tsx, &js, &raea_runtime_react::scene::comp_opts(&opts)?, Some(&game))?;
@@ -98,10 +101,7 @@ pub fn export(args: &[String]) -> R<String> {
gather(&mut bundle, &dir, &game, &mut got)?;
std::fs::write(&js, &bundle).map_err(|e| e.to_string())?;
// an app screen needs a player with the surface runtime (the `surfaces` feature), which the size-built one leaves out
if got.files.iter().any(|(rel, _)| rel.ends_with(raea_runtime_page::screen::BUNDLED)) && !player_has_surfaces(&player)? {
return Err(format!("this game has an app screen (<Screen app>), and the player {} can't run one: build it with them (cargo build --profile game -p raea-app-game --bin raea-game --features player,surfaces) and export again", player.display()));
}
// an app screen (<Screen app>) draws on the player's own Blitz page (raea-runtime-appscreen): every player has one
// 3. what play works out at open, worked out now from the package itself (so the package is known to load)
let src = std::fs::read_to_string(&tsx).unwrap_or_default();
@@ -252,12 +252,6 @@ pub(crate) fn imported(dir: &Path, file: &Path) -> bool {
false
}
/// Whether the player at `bin` was built with the surface runtime (app screens): its shim's text is in it.
pub(crate) fn player_has_surfaces(bin: &Path) -> R<bool> {
let bytes = std::fs::read(bin).map_err(|e| format!("{}: {e}", bin.display()))?;
Ok(bytes.windows(14).any(|w| w == b"__surfaceFrame"))
}
pub(crate) fn default_name(tsx: &Path) -> String {
let stem = tsx.file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default();
let base = if stem == "edit" { tsx.parent().and_then(|p| p.file_name()).map(|s| s.to_string_lossy().to_string()).unwrap_or(stem) } else { stem };
+15 -7
View File
@@ -85,7 +85,7 @@ pub(crate) fn gather(bundle: &mut String, dir: &Path, game: &Path, got: &mut Gat
}
}
}
let inside = |p: &Path| -> Option<String> { p.canonicalize().ok().and_then(|c| c.strip_prefix(dir.canonicalize().ok()?).ok().map(|r| r.to_string_lossy().to_string())) };
let inside = |p: &Path| -> Option<String> { dunce::canonicalize(&p).ok().and_then(|c| c.strip_prefix(dunce::canonicalize(&dir).ok()?).ok().map(|r| r.to_string_lossy().to_string())) };
let mut rewrites: Vec<(String, String)> = Vec::new();
for s in &lits {
if s.contains("://") || s.starts_with("data:") || s.len() < 2 || s.contains('\u{0}') {
@@ -105,13 +105,21 @@ pub(crate) fn gather(bundle: &mut String, dir: &Path, game: &Path, got: &mut Gat
let ext = file.extension().and_then(|x| x.to_str()).unwrap_or("").to_ascii_lowercase();
if SOURCE_EXTS.contains(&ext.as_str()) || file.file_name().is_some_and(|n| n == MANIFEST) {
// an app screen's module (`<Screen app="chat.tsx">`, a component on react-dom): bundled now with its npm
// packages beside where it was, as `chat.tsx.surface.js`, which the player opens (it bundles nothing)
// packages beside where it was, as `chat.tsx.surface.js` and its CSS `chat.tsx.surface.css`, which the
// player opens (it bundles nothing; raea-runtime-appscreen code_of)
if matches!(ext.as_str(), "tsx" | "jsx") && std::fs::read_to_string(&file).is_ok_and(|t| t.contains("export default") && !t.contains("registerRoot(")) && !imported(dir, &file) {
if let Some(rel) = inside(&file) {
let rel = format!("{rel}{}", raea_runtime_page::screen::BUNDLED);
if !got.has(&rel) {
raea_runtime_react::scene::bundle_surface(&file, &game.join(&rel))?;
got.files.push((rel, file.clone()));
let (js_rel, css_rel) = (format!("{rel}{}", raea_runtime_page::screen::BUNDLED), format!("{rel}{}", raea_runtime_page::screen::BUNDLED_CSS));
if !got.has(&js_rel) {
let (js, css) = raea_runtime_page::screen::build_app(&file)?;
for (r, text) in [(&js_rel, js), (&css_rel, css)] {
let out = game.join(r);
if let Some(d) = out.parent() {
std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?;
}
std::fs::write(&out, text).map_err(|e| format!("{}: {e}", out.display()))?;
got.files.push((r.clone(), file.clone()));
}
}
}
}
@@ -126,7 +134,7 @@ pub(crate) fn gather(bundle: &mut String, dir: &Path, game: &Path, got: &mut Gat
}
}
None => {
let canon = file.canonicalize().unwrap_or(file.clone());
let canon = dunce::canonicalize(&file).unwrap_or(file.clone());
let h = twox_hash::XxHash3_64::oneshot(canon.to_string_lossy().as_bytes());
let rel = format!("media/_ext/{:08x}-{}", h as u32, file.file_name().unwrap().to_string_lossy());
put(&file, &rel, game, got)?;
+3 -3
View File
@@ -50,11 +50,11 @@ pub(crate) fn find_game(args: &[String]) -> R<PathBuf> {
return Ok(PathBuf::from(d));
}
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
let exe = exe.canonicalize().unwrap_or(exe);
let exe = dunce::canonicalize(&exe).unwrap_or(exe);
let here = exe.parent().unwrap_or(Path::new("."));
for c in [here.join("../Resources/game"), here.join("game")] {
if c.join(MANIFEST).exists() {
return Ok(c.canonicalize().unwrap_or(c));
return Ok(dunce::canonicalize(&c).unwrap_or(c));
}
}
Err(format!("no game beside {} (an exported game's player looks in ../Resources/game or game/; --game DIR names one)", exe.display()))
@@ -300,7 +300,7 @@ pub(crate) fn selftest(game: &Game, secs: f64, args: &[String]) -> R<String> {
"has_3d": game.has_3d,
"snapshots": snapped,
"panics": panics,
"env": {"home": std::env::var("HOME").unwrap_or_default(), "raea_vars_given": std::env::vars().filter(|(k, _)| k.starts_with("RAEA_") && k != "RAEA_AUDIO_MUTE" && k != "RAEA_AUDIO_TAP").count()},
"env": {"home": raea_io_home::user_home().unwrap_or_default().display().to_string(), "raea_vars_given": std::env::vars().filter(|(k, _)| k.starts_with("RAEA_") && k != "RAEA_AUDIO_MUTE" && k != "RAEA_AUDIO_TAP").count()},
});
if let Some(p) = flag(args, "--json") {
std::fs::write(&p, serde_json::to_string_pretty(&report).unwrap()).map_err(|e| format!("{p}: {e}"))?;
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "A composition's 3D as data another tool builds (`raea scene export`: scene.json, its meshes and models), a Godot project written from it, and what changed in Blender or Godot read back as edits to the TSX (docs/blender.feature BL37-BL39, docs/godot.feature GD12-GD13)"
[dependencies]
dunce = "1"
# the composition bundled and stepped to its frames' 3D (raea-runtime-export's scene_frames), walked into parts
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-runtime-export = { path = "../../runtime/export" }
+1 -1
View File
@@ -237,7 +237,7 @@ pub fn scene(all: &[Vec<Item>], frames: &[i64], dir: &Path, out: &Path) -> R<Val
/// `raea scene export ...`: scene.json written, and its value.
pub fn export(args: &[String]) -> R<(PathBuf, Value)> {
let edit = args.get(2).ok_or(USAGE)?;
let tsx = PathBuf::from(edit).canonicalize().map_err(|e| format!("{edit}: {e}"))?;
let tsx = dunce::canonicalize(&PathBuf::from(edit)).map_err(|e| format!("{edit}: {e}"))?;
let dir = tsx.parent().ok_or("the edit's folder")?.to_path_buf();
let out = args.iter().position(|a| a == "-o").and_then(|i| args.get(i + 1)).ok_or(USAGE)?;
let out = std::path::absolute(out).map_err(|e| e.to_string())?;
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "raea judge: a review's sheets judged by clef-omni on a frozen rubric, the pass decided in code, calibrated against the person's eye before it gates"
[dependencies]
dunce = "1"
raea-io-home = { path = "../../io/home" }
# what a judge saw, as raea's one Finding (docs/direction.feature DR3)
raea-core-facts = { path = "../../core/facts" }
+1 -1
View File
@@ -84,7 +84,7 @@ pub fn read(v: &Value) -> (Map<String, Value>, Vec<Value>, Value) {
/// said on stderr as it comes, so a watcher sees it working through a judgement that can take minutes.
pub fn ask(by: &str, dir: &Path, brief: &Value, target: Option<&Path>) -> Result<Value, String> {
use std::io::BufRead as _;
let dir = dir.canonicalize().map_err(|e| format!("judge: {}: {e}", dir.display()))?;
let dir = dunce::canonicalize(&dir).map_err(|e| format!("judge: {}: {e}", dir.display()))?;
let p = prompt(&dir, brief, target);
let mut cmd = match by {
"kimi" => {
+1
View File
@@ -9,6 +9,7 @@ description = "A person's notes on a project as files the work is held to (docs/
[dependencies]
# Note and Ask, the project found by its .raea/project, and the world a note is an entity in
raea-core-facts = { path = "../../core/facts" }
raea-io-home = { path = "../../io/home" }
# when a run of an ask's check was (UTC), as raea check stamps its record
raea-io-trace = { path = "../../io/trace" }
# what each ask has been through, kept as JSON (state.rs)
+1 -1
View File
@@ -27,7 +27,7 @@ pub(crate) struct New {
fn inbox_dir() -> PathBuf {
match std::env::var_os("RAEA_INBOX_DIR") {
Some(dir) => dir.into(),
None => Path::new(&std::env::var_os("HOME").unwrap_or_default()).join(".raea/inbox"),
None => raea_io_home::user_home().unwrap_or_default().join(".raea/inbox"),
}
}
+4
View File
@@ -237,6 +237,10 @@ pub(crate) fn offscreen(mut run: Run, json: Option<String>, flat_out: bool, snap
if let Some((x, y, down)) = run.pointer {
e["pointer"] = serde_json::json!({"x": x, "y": y, "down": down});
}
// what reached its app screens (the keys they took aren't the page's above), given them again in a render
if let Some(apps) = live.app_input() {
e["apps"] = apps;
}
// the session's seed and start with its first frame: a render of the log draws the same Math.random and Date
if logged.is_empty() {
e["session"] = live.session();
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "raea solid info and raea solid view: a solid file run, its parts measured (raea-core-solidinfo), and its review sheets in colour and clay"
[dependencies]
dunce = "1"
raea-core-solidinfo = { path = "../../core/solidinfo" }
# what solid info finds, as raea's one Finding (docs/direction.feature DR3)
raea-core-facts = { path = "../../core/facts" }
+1 -1
View File
@@ -102,7 +102,7 @@ pub fn verb(args: &[String]) -> Option<Result<String, String>> {
pub fn cli(args: &[String]) -> Result<String, String> {
let (Some(verb @ ("info" | "view" | "export")), Some(file)) = (args.get(1).map(String::as_str), args.get(2)) else { return Err(USAGE.into()) };
let file = PathBuf::from(file).canonicalize().map_err(|e| format!("{file}: {e}"))?;
let file = dunce::canonicalize(&PathBuf::from(file)).map_err(|e| format!("{file}: {e}"))?;
let json_out = args.iter().any(|a| a == "--json");
let set = flag(args, "--set").map(|s| parse_set(&s)).transpose()?.unwrap_or_default();
let expect_path = flag(args, "--expect").map(PathBuf::from).or_else(|| {
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "A render's sound alone (`raea render EDIT.tsx -o OUT.wav`, no frames drawn) and a video's sound written beside it from the same pass (`--audio OUT.wav`)"
[dependencies]
dunce = "1"
raea-runtime-export = { path = "../../runtime/export" }
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-sys-mix = { path = "../../systems/mix" }
+1 -1
View File
@@ -42,7 +42,7 @@ pub fn render(args: &[String]) -> Option<R<String>> {
/// mastered by its <Mix>, written as 48 kHz WAV, with what it measures.
fn sound(args: &[String], out: &Path) -> R<String> {
let edit = args.get(1).filter(|a| !a.starts_with('-')).ok_or("raea render EDIT.tsx -o OUT.wav")?;
let tsx = PathBuf::from(edit).canonicalize().map_err(|e| format!("{edit}: {e}"))?;
let tsx = dunce::canonicalize(&PathBuf::from(edit)).map_err(|e| format!("{edit}: {e}"))?;
let dir = tsx.parent().ok_or("the edit has no folder")?.to_path_buf();
let js = std::env::temp_dir().join(format!("raea-sound-{}.js", std::process::id()));
raea_runtime_bundle::bundle_composition(&tsx, &js, &raea_runtime_bundle::comp_opts(args)?, None)?;
+1
View File
@@ -6,6 +6,7 @@ license = "FSL-1.1-ALv2"
description = "An app's target, web (Blitz on Bevy) or native (Rune), read from its file, and raea app run|check|bundle on either (docs/targets.feature)"
[dependencies]
dunce = "1"
serde_json = "1"
# the page host's frames over BRP
base64 = "0.22"
+59 -10
View File
@@ -1,6 +1,7 @@
//! `raea app bundle` on the web target: a Mac app that opens the page in raea-page-host's window. App.app/Contents has
//! the page host, the app's script and stylesheet in Resources/, and a launcher in MacOS/ that starts the host on them
//! at the app's title and size, signed by the developer (sign.rs, T1d).
//! at the app's title and size, signed by the developer (sign.rs, T1d). The launcher runs the host as its child and
//! waits for it: a launcher that execs it leaves the app without a pid in AppKit (#163, `launcher`).
use std::path::PathBuf;
@@ -37,6 +38,20 @@ fn sh(s: &str) -> String {
format!("'{}'", s.replace('\'', "'\\''"))
}
/// The app's executable (Contents/MacOS/NAME): the page host in Resources, on the app's script and stylesheet, in a
/// window at the app's title and size. The host is this script's child, never exec'd in its place: when the process
/// macOS launched execs another program, AppKit keeps the app's bundle id but loses its pid (NSRunningApplication's
/// processIdentifier -1), so window managers that find an app's windows by its pid never see the window (#163). The
/// host still checks in as the app, from inside it; a signal to the launcher is passed on to it.
fn launcher(name: &str, size: (u32, u32)) -> String {
format!(
"#!/bin/sh\n# made by raea app bundle: the page in raea-page-host's window, the host this script's child (an exec loses the app's pid)\nR=\"$(cd \"$(dirname \"$0\")/../Resources\" && pwd)\"\n\"$R/raea-page-host\" \"$R/app.js\" --css \"$R/app.css\" --window --title {} --size {}x{} &\nhost=$!\ntrap 'kill -TERM \"$host\" 2>/dev/null' TERM INT HUP\nwait \"$host\"\n",
sh(name),
size.0,
size.1
)
}
/// The bundle id from the title: ascii letters and digits, under app.raea.local
fn bundle_id(title: &str) -> String {
let id: String = title.chars().filter(|c| c.is_ascii_alphanumeric()).collect::<String>().to_lowercase();
@@ -58,20 +73,54 @@ pub fn web(a: &Ask) -> Result<String, String> {
std::fs::copy(&host, res.join("raea-page-host")).map_err(|e| format!("{}: {e}", host.display()))?;
let name = &a.title;
std::fs::write(contents.join("Info.plist"), plist(name, &bundle_id(name))).map_err(|e| e.to_string())?;
let launcher = macos.join(name);
let script = format!(
"#!/bin/sh\n# made by raea app bundle: the page in raea-page-host's window\nR=\"$(cd \"$(dirname \"$0\")/../Resources\" && pwd)\"\nexec \"$R/raea-page-host\" \"$R/app.js\" --css \"$R/app.css\" --window --title {} --size {}x{}\n",
sh(name),
a.size.0,
a.size.1
);
std::fs::write(&launcher, script).map_err(|e| e.to_string())?;
let exe = macos.join(name);
std::fs::write(&exe, launcher(name, a.size)).map_err(|e| e.to_string())?;
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
std::fs::set_permissions(&launcher, std::fs::Permissions::from_mode(0o755)).map_err(|e| e.to_string())?;
std::fs::set_permissions(&exe, std::fs::Permissions::from_mode(0o755)).map_err(|e| e.to_string())?;
}
let mut said = crate::sign::sign(&out, &a.sign)?;
said.push(format!("{} (web)", out.display()));
Ok(said.join("\n"))
}
#[cfg(all(test, unix))]
mod tests {
use std::os::unix::fs::PermissionsExt;
use std::process::Command;
/// The launcher run as macOS runs an app's executable, with a page host that writes down its own pid, its parent's
/// and its arguments, and exits 3: the host must be the launcher's child (an exec ran it in the launcher's
/// process, the pid macOS launched, and AppKit lost the app's pid: #163), on the app's files, and the launcher must
/// end with the host's status.
#[test]
fn the_host_runs_as_the_launchers_child() {
// canonical, so the launcher's own `pwd` names Resources as this test does (macOS's temp folder is a link)
let dir = dunce::canonicalize(&std::env::temp_dir()).unwrap().join(format!("raea-macapp-launcher-{}", std::process::id()));
let _ = std::fs::remove_dir_all(&dir);
let (macos, res) = (dir.join("T.app/Contents/MacOS"), dir.join("T.app/Contents/Resources"));
std::fs::create_dir_all(&macos).unwrap();
std::fs::create_dir_all(&res).unwrap();
let ran = res.join("ran");
let host = res.join("raea-page-host");
std::fs::write(&host, format!("#!/bin/sh\necho \"$$ $PPID $*\" > '{}'\nexit 3\n", ran.display())).unwrap();
let exe = macos.join("T");
std::fs::write(&exe, super::launcher("My App", (800, 600))).unwrap();
for f in [&host, &exe] {
std::fs::set_permissions(f, std::fs::Permissions::from_mode(0o755)).unwrap();
}
let mut child = Command::new(&exe).spawn().unwrap();
let launched = child.id().to_string();
let status = child.wait().unwrap();
let said = std::fs::read_to_string(&ran).unwrap();
let mut words = said.split_whitespace();
let (pid, parent) = (words.next().unwrap(), words.next().unwrap());
assert_ne!(pid, launched, "the host ran in the launcher's own process (exec'd): {said}");
assert_eq!(parent, launched, "the host isn't the launcher's child: {said}");
let args = format!("{0}/app.js --css {0}/app.css --window --title My App --size 800x600", res.display());
assert_eq!(said.trim_end().splitn(3, ' ').nth(2), Some(args.as_str()));
assert_eq!(status.code(), Some(3), "the launcher didn't end with the host's status");
let _ = std::fs::remove_dir_all(&dir);
}
}
+2 -2
View File
@@ -64,14 +64,14 @@ pub fn host(args: &[String]) -> Result<String, String> {
let p = Path::new(a);
if p.extension().is_some_and(|x| x == "tsx" || x == "ts" || x == "jsx") && p.is_file() {
std::fs::create_dir_all(&work).map_err(|e| format!("{}: {e}", work.display()))?;
let (js, css) = raea_runtime_bundle::inproc::app::bundle(p, &raea_io_home::home())?;
let (js, css) = raea_runtime_bundle::inproc::app::bundle(p, &raea_io_home::home(), raea_runtime_bundle::inproc::app::WINDOW)?;
let script = work.join(format!("{}.js", p.file_stem().unwrap_or_default().to_string_lossy()));
std::fs::write(&script, js).map_err(|e| format!("{}: {e}", script.display()))?;
handed.push(script.display().to_string());
// the app's folder (relative media and fonts) and the CSS it imported (its @font-face rules), T3d
let sheet = script.with_extension("css");
std::fs::write(&sheet, css).map_err(|e| format!("{}: {e}", sheet.display()))?;
let dir = p.canonicalize().ok().map(raea_io_home::plain).and_then(|c| c.parent().map(Path::to_path_buf)).unwrap_or_default();
let dir = dunce::canonicalize(&p).ok().map(raea_io_home::plain).and_then(|c| c.parent().map(Path::to_path_buf)).unwrap_or_default();
extra.extend(["--base".to_string(), dir.display().to_string(), "--css".to_string(), sheet.display().to_string()]);
} else {
handed.push(a.clone());
+1 -1
View File
@@ -141,7 +141,7 @@ pub fn find(name: &str, built: &[PathBuf]) -> Result<PathBuf, String> {
s.push(std::env::consts::EXE_SUFFIX);
PathBuf::from(s)
};
let beside = std::env::current_exe().ok().map(|e| e.canonicalize().unwrap_or(e)).and_then(|e| e.parent().map(|d| d.join(name)));
let beside = std::env::current_exe().ok().map(|e| dunce::canonicalize(&e).unwrap_or(e)).and_then(|e| e.parent().map(|d| d.join(name)));
let on_path = std::env::var_os("PATH").map(|p| std::env::split_paths(&p).map(|d| d.join(name)).collect::<Vec<_>>()).unwrap_or_default();
beside.into_iter().chain(on_path).chain(built.iter().cloned()).map(exe).find(|p| p.is_file()).ok_or(format!("no {name}: put it beside raea or on PATH (in a checkout, build it)"))
}
+2 -2
View File
@@ -22,9 +22,9 @@ pub struct Built {
/// `app` bundled into `dir` (made if missing): app.js and app.css (Tailwind's, for the classes the app's folder uses, after
/// any CSS the app imports)
pub fn build(app: &Path, dir: &Path) -> Result<Built, String> {
let app = raea_io_home::plain(app.canonicalize().map_err(|e| format!("{}: {e}", app.display()))?);
let app = raea_io_home::plain(dunce::canonicalize(&app).map_err(|e| format!("{}: {e}", app.display()))?);
std::fs::create_dir_all(dir).map_err(|e| format!("{}: {e}", dir.display()))?;
let (js, imported) = raea_runtime_bundle::inproc::app::bundle(&app, &raea_io_home::home())?;
let (js, imported) = raea_runtime_bundle::inproc::app::bundle(&app, &raea_io_home::home(), raea_runtime_bundle::inproc::app::WINDOW)?;
let folder = app.parent().unwrap_or(Path::new("."));
let tw = raea_runtime_bundle::styles::tailwind(folder)?;
let built = Built { js: dir.join("app.js"), css: dir.join("app.css") };
+5
View File
@@ -7,6 +7,7 @@ publish = false
description = "The `raea` verbs that run raea's model tools: sao, tokensynth, setup-audio, sounds, splat, song and gen"
[dependencies]
dunce = "1"
raea-io-assets = { path = "../../io/assets" }
# generation flows: made.app, fal, Replicate, OpenRouter, Modal, ComfyUI (`raea gen`)
raea-io-gen = { path = "../../io/gen" }
@@ -16,3 +17,7 @@ serde_json = "1"
# the verbs' flags read as a render reads its own
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-runtime-export = { path = "../../runtime/export" }
# `raea motion`: Kimodo on MLX, Apple silicon's
[target.'cfg(target_os = "macos")'.dependencies]
raea-sys-kimodo = { path = "../../systems/kimodo" }
+24 -12
View File
@@ -1,7 +1,9 @@
//! The hooks `raea skills install` adds an agent (docs/agents.feature A5d, A5e; docs/skills.feature SK10), the same two
//! for every harness, each written where and how that harness reads hooks: before a shell command, `raea hook AGENT`
//! steers media opened in the Mac's viewer to `raea show`; after a file is saved, it runs the quick check on a
//! composition. An event that already has a `raea hook` entry is left as it is.
//! composition. Claude Code's run after every tool and as a turn ends too, to hand the session what the person sent from
//! the raea app (apps/check/src/inbox.rs). An event that already has a `raea hook` entry keeps it, its matcher widened
//! to this raea's when an older raea wrote a narrower one.
use crate::agent_mcp::user_home;
use serde_json::{Value, json};
use std::path::{Path, PathBuf};
@@ -15,14 +17,14 @@ struct Hook {
secs: u64,
}
/// Each harness's two hooks, by its own event and tool names.
fn hooks(agent: &str) -> R<[Hook; 2]> {
/// Each harness's hooks, by its own event and tool names.
fn hooks(agent: &str) -> R<Vec<Hook>> {
let h = |event, matcher, secs| Hook { event, matcher, secs };
Ok(match agent {
"claude" => [h("PreToolUse", "Bash", 30), h("PostToolUse", "Write|Edit|MultiEdit", 60)],
"codex" => [h("PreToolUse", "^(Bash|shell|shell_command|exec_command)$", 30), h("PostToolUse", "^(apply_patch|Edit|Write)$", 60)],
"gemini" => [h("BeforeTool", "run_shell_command", 30), h("AfterTool", "write_file|replace", 60)],
"kimi" => [h("PreToolUse", "Bash|Shell", 30), h("PostToolUse", "Write|Edit|WriteFile|StrReplaceFile", 60)],
"claude" => vec![h("PreToolUse", "Bash", 30), h("PostToolUse", "*", 60), h("Stop", "", 10)],
"codex" => vec![h("PreToolUse", "^(Bash|shell|shell_command|exec_command)$", 30), h("PostToolUse", "^(apply_patch|Edit|Write)$", 60)],
"gemini" => vec![h("BeforeTool", "run_shell_command", 30), h("AfterTool", "write_file|replace", 60)],
"kimi" => vec![h("PreToolUse", "Bash|Shell", 30), h("PostToolUse", "Write|Edit|WriteFile|StrReplaceFile", 60)],
a => return Err(format!("no agent {a:?}: claude, codex, kimi or gemini")),
})
}
@@ -54,7 +56,14 @@ fn add_json(path: &Path, agent: &str, h: &Hook) -> R<bool> {
let hooks = doc.as_object_mut().ok_or(format!("{at} isn't a JSON object"))?.entry("hooks").or_insert_with(|| json!({}));
let list = hooks.as_object_mut().ok_or(format!("{at}: hooks isn't an object"))?.entry(h.event).or_insert_with(|| json!([]));
let list = list.as_array_mut().ok_or(format!("{at}: hooks.{} isn't a list", h.event))?;
if list.iter().any(|m| m["hooks"].as_array().into_iter().flatten().any(|x| x["command"].as_str().unwrap_or("").starts_with("raea hook"))) {
let ours = |m: &Value| m["hooks"].as_array().into_iter().flatten().any(|x| x["command"].as_str().unwrap_or("").starts_with("raea hook"));
if let Some(m) = list.iter_mut().find(|m| ours(m)) {
// an older raea's narrower matcher (Claude's after-save hook, now after every tool) is widened, the rest kept
if h.matcher == "*" && m["matcher"].as_str() != Some("*") {
m["matcher"] = h.matcher.into();
write(path, &(serde_json::to_string_pretty(&doc).unwrap_or_default() + "\n"))?;
return Ok(true);
}
return Ok(false);
}
// Gemini CLI counts milliseconds and names each hook
@@ -115,21 +124,24 @@ mod tests {
let c = d.join("claude/settings.json");
std::fs::create_dir_all(c.parent().unwrap()).unwrap();
std::fs::write(&c, r#"{"model":"x","hooks":{"PostToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"other"}]},{"matcher":"Write","hooks":[{"type":"command","command":"raea hook claude"}]}]}}"#).unwrap();
let [pre, post] = hooks("claude").unwrap();
let [pre, post, stop] = <[Hook; 3]>::try_from(hooks("claude").unwrap()).ok().unwrap();
assert!(add_json(&c, "claude", &pre).unwrap() && !add_json(&c, "claude", &pre).unwrap());
assert!(!add_json(&c, "claude", &post).unwrap(), "an older raea's after-save hook stands");
assert!(add_json(&c, "claude", &post).unwrap() && !add_json(&c, "claude", &post).unwrap(), "an older raea's after-save hook is widened to every tool, once");
assert!(add_json(&c, "claude", &stop).unwrap() && !add_json(&c, "claude", &stop).unwrap());
let v: Value = serde_json::from_str(&std::fs::read_to_string(&c).unwrap()).unwrap();
assert_eq!((v["model"].as_str(), v["hooks"]["PostToolUse"].as_array().unwrap().len()), (Some("x"), 2));
assert_eq!((v["hooks"]["PostToolUse"][0]["matcher"].as_str(), v["hooks"]["PostToolUse"][1]["matcher"].as_str()), (Some("Bash"), Some("*")));
assert_eq!(v["hooks"]["PreToolUse"][0]["hooks"][0]["command"], "raea hook claude");
assert_eq!(v["hooks"]["Stop"][0]["hooks"][0]["command"], "raea hook claude");
let g = d.join("gemini/settings.json");
let [before, _] = hooks("gemini").unwrap();
let [before, _] = <[Hook; 2]>::try_from(hooks("gemini").unwrap()).ok().unwrap();
assert!(add_json(&g, "gemini", &before).unwrap());
let v: Value = serde_json::from_str(&std::fs::read_to_string(&g).unwrap()).unwrap();
assert_eq!(v["hooks"]["BeforeTool"][0], json!({"matcher": "run_shell_command", "hooks": [{"name": "raea", "type": "command", "command": "raea hook gemini", "timeout": 30000}]}));
let k = d.join("kimi/config.toml");
std::fs::create_dir_all(k.parent().unwrap()).unwrap();
std::fs::write(&k, "default_model = \"k\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash\"\ncommand = \"mine\"\n").unwrap();
let [pre, post] = hooks("kimi").unwrap();
let [pre, post] = <[Hook; 2]>::try_from(hooks("kimi").unwrap()).ok().unwrap();
assert!(add_toml(&k, &pre).unwrap() && !add_toml(&k, &pre).unwrap() && add_toml(&k, &post).unwrap() && !add_toml(&k, &post).unwrap());
let t = std::fs::read_to_string(&k).unwrap();
assert!(t.starts_with("default_model = \"k\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash\"\ncommand = \"mine\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash|Shell\"\ncommand = \"raea hook kimi\"\ntimeout = 30\n"), "{t}");
+1 -1
View File
@@ -14,7 +14,7 @@ type R<T> = Result<T, String>;
/// The person's home folder (HOME, or USERPROFILE on Windows).
pub fn user_home() -> R<PathBuf> {
std::env::var_os("HOME").or_else(|| std::env::var_os("USERPROFILE")).map(PathBuf::from).ok_or_else(|| "no home folder (HOME)".into())
raea_io_home::user_home().ok_or_else(|| "no home folder (HOME)".into())
}
/// The JSON file holding `mcpServers` for agents configured that way (Kimi Code, Gemini CLI, Claude Code's own file).
+2
View File
@@ -4,6 +4,8 @@
//! made.app, fal, Replicate, OpenRouter, Modal and ComfyUI, with sao as the local model: apps/tools/src/generate.rs).
pub mod generate;
/// `raea motion`: body motion made on this Mac by Kimodo on MLX (raea-sys-kimodo)
pub mod motion;
pub mod song;
pub mod sound;
pub mod splat;
+117
View File
@@ -0,0 +1,117 @@
//! `raea motion "LINE" [--keys KEYS.json] ...`: body motion made on this Mac by Kimodo (raea-sys-kimodo, on MLX): a
//! SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a
//! root path: what sdk/body/tools/between.ts writes). The clip is the file sdk/body/tools/fromkimodo.ts reads, the
//! same one the cloud runner wrote (docs/character.feature CH15b, CH15c).
use std::path::PathBuf;
use raea_runtime_bundle::flag;
type R<T> = Result<T, String>;
pub const USAGE: &str = "raea motion \"LINE\" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--steps 100] [-o CLIP.json]";
pub const ABOUT: &str = "body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads; the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters); a line's words are read once and kept. Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT";
fn number(args: &[String], name: &str, default: f64) -> R<f64> {
match flag(args, name) {
None => Ok(default),
Some(v) => v.parse::<f64>().ok().filter(|n| n.is_finite() && *n >= 0.0).ok_or(format!("{name} takes a number, got `{v}`")),
}
}
fn line(args: &[String]) -> String {
const WITH_VALUE: [&str; 6] = ["--keys", "--seconds", "--frames", "--seed", "--steps", "-o"];
let mut out = Vec::new();
let mut i = 1;
while i < args.len() {
if WITH_VALUE.contains(&args[i].as_str()) {
i += 2;
continue;
}
if !args[i].starts_with("--") {
out.push(args[i].as_str());
}
i += 1;
}
out.join(" ")
}
/// what a call asks for, read from its words and flags
struct Ask {
words: String,
keys: Option<String>,
constraints: Option<serde_json::Value>,
frames: usize,
seed: u64,
steps: usize,
out: Option<String>,
}
pub fn motion(args: &[String]) -> R<String> {
let words = line(args);
let keys = flag(args, "--keys");
if words.trim().is_empty() && keys.is_none() {
return Err(format!("{USAGE}\n ({ABOUT})"));
}
let frames = match flag(args, "--frames") {
Some(_) => number(args, "--frames", 150.0)? as usize,
None => (number(args, "--seconds", 5.0)? * 30.0).round() as usize,
};
if !(2..=600).contains(&frames) {
return Err(format!("a clip is 2 to 600 frames (20 s at 30 a second), asked {frames}"));
}
let constraints = match &keys {
Some(p) => Some(serde_json::from_str::<serde_json::Value>(&std::fs::read_to_string(p).map_err(|e| format!("{p}: {e}"))?).map_err(|e| format!("{p}: {e}"))?),
None => None,
};
let (seed, steps) = (number(args, "--seed", 1.0)? as u64, (number(args, "--steps", 100.0)? as usize).max(2));
make(Ask { words, keys, constraints, frames, seed, steps, out: flag(args, "-o") })
}
#[cfg(not(target_os = "macos"))]
fn make(ask: Ask) -> R<String> {
Err(format!("raea motion runs Kimodo on MLX, on Apple silicon's GPU: {:?} can be made on a Mac", ask.words))
}
#[cfg(target_os = "macos")]
fn make(ask: Ask) -> R<String> {
// float32 as checked against PyTorch: MLX's TF32 matmuls off, before the first one
if std::env::var_os("MLX_ENABLE_TF32").is_none() {
unsafe { std::env::set_var("MLX_ENABLE_TF32", "0") };
}
let t0 = std::time::Instant::now();
// a line every 512 MB of each file fetched
let mut shown = std::collections::HashMap::<String, u64>::new();
let mut progress = |file: &str, n: u64| {
if shown.insert(file.to_string(), n >> 29) != Some(n >> 29) {
eprintln!("raea motion: fetching {file}: {} MB", n >> 20);
}
};
let mut k = raea_sys_kimodo::Kimodo::fetch(&mut progress).map_err(|e| format!("raea motion: {e}"))?;
let (clean, emb) = k.encode(&ask.words).map_err(|e| format!("raea motion: {e}"))?;
let load_s = t0.elapsed().as_secs_f64();
let made_from = raea_sys_kimodo::Ask { line: &ask.words, frames: ask.frames, seed: ask.seed, steps: ask.steps, constraints: ask.constraints.as_ref(), cfg: (2.0, 2.0) };
let t1 = std::time::Instant::now();
let made = k.make(&made_from, emb.as_deref(), None).map_err(|e| format!("raea motion: {e}"))?;
let gen_s = t1.elapsed().as_secs_f64();
let clip = raea_sys_kimodo::decode::clip_json(&made.motion, &k.skeleton, ask.seed, ask.steps, &clean, ask.constraints.is_some());
// without -o, the line's words name the file
let out = PathBuf::from(ask.out.unwrap_or_else(|| {
let slug = clean.split(|c: char| !c.is_ascii_alphanumeric()).filter(|w| !w.is_empty()).map(str::to_lowercase).collect::<Vec<_>>().join("-");
format!("{}.clip.json", if slug.is_empty() { "keys".to_string() } else { slug.chars().take(60).collect() })
}));
std::fs::write(&out, serde_json::to_string(&clip).unwrap_or_default()).map_err(|e| format!("{}: {e}", out.display()))?;
let r = &made.motion.root;
let (a, b) = (r[0], r[r.len() - 1]);
let travel = ((b[0] - a[0]).powi(2) + (b[2] - a[2]).powi(2)).sqrt();
Ok(format!(
"APPLIED motion {:?}{}, {} frames ({:.1} s), seed {}, {} steps -> {} (made on this Mac in {gen_s:.1} s after {load_s:.1} s loading and reading the line; the hips end {travel:.2} m from where they start)",
clean,
if ask.keys.is_some() { " with keys" } else { "" },
ask.frames,
ask.frames as f64 / 30.0,
ask.seed,
ask.steps,
out.display()
))
}
+1 -1
View File
@@ -187,7 +187,7 @@ pub(crate) fn sounds_get(args: &[String]) -> R<String> {
let base = PathBuf::from(flag(args, "--dir").unwrap_or_else(|| ".".into()));
let out = flag(args, "-o").map(PathBuf::from).unwrap_or_else(|| base.join("media/sounds").join(format!("{pid}-{iid}")));
std::fs::create_dir_all(&out).map_err(|e| format!("{}: {e}", out.display()))?;
let cache = PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(".cache/raea-sounds").join(pid).join(iid);
let cache = raea_io_home::user_home().unwrap_or_default().join(".cache/raea-sounds").join(pid).join(iid);
let template = pack["url"].as_str().unwrap_or_default();
let mut bytes = 0u64;
for (file, name, _) in &chosen {
+1 -1
View File
@@ -71,7 +71,7 @@ pub fn splat(args: &[String]) -> R<String> {
fn train(args: &[String]) -> R<String> {
let (input, params) = parse(args)?;
let input = input.canonicalize().map_err(|e| format!("{}: {e}", input.display()))?;
let input = dunce::canonicalize(&input).map_err(|e| format!("{}: {e}", input.display()))?;
let out = PathBuf::from(flag(args, "-o").or_else(|| flag(args, "--o")).ok_or(format!("-o OUT.ply is required\n{USAGE}"))?);
if out.extension().and_then(|e| e.to_str()) != Some("ply") {
return Err(format!("-o names a .ply, got {}", out.display()));
+2
View File
@@ -7,8 +7,10 @@ publish = false
description = "`raea workspace`, `raea project` and `raea controller`: a workspace's folders, projects and controllers, each change a commit"
[dependencies]
dunce = "1"
# the controller schema (core/brief controller.rs): a controller file is checked and normalized against it
raea-core-brief = { path = "../../core/brief" }
raea-io-home = { path = "../../io/home" }
serde_json = "1"
# a project's compositions, components and controllers read from their source (docs/projects.feature PJ8)
raea-app-registry = { path = "registry" }
+2
View File
@@ -7,8 +7,10 @@ publish = false
description = "A raea project's compositions, components and controllers, read from their source without running it, and lint for what isn't connected (docs/projects.feature PJ8)"
[dependencies]
dunce = "1"
# the version engine/bundle parses TSX with
oxc = { version = "=0.152.0", features = ["ast_visit"] }
raea-io-home = { path = "../../../io/home" }
serde_json = "1"
# what the scan finds, as raea's one Finding (docs/direction.feature DR3)
raea-core-facts = { path = "../../../core/facts" }
+3 -3
View File
@@ -157,7 +157,7 @@ pub(crate) fn resolve(from: &Path, spec: &str) -> Option<PathBuf> {
}
tries.extend([base.join("index.tsx"), base.join("index.ts")]);
let found = tries.into_iter().find(|p| p.is_file())?;
Some(std::fs::canonicalize(&found).unwrap_or(found))
Some(dunce::canonicalize(&found).unwrap_or(found))
}
/// An import of a file (not a package): relative, absolute, or the workspace's shared/ (@shared/...).
@@ -183,7 +183,7 @@ fn manifest(path: &Path) -> Option<Value> {
/// The folder's registry. `overridden`: the controller ids the project's overrides name, each checked against the
/// controllers there (the folder's and its workspace's controllers/).
pub fn scan(dir: &Path, overridden: &[String]) -> Registry {
let dir = std::fs::canonicalize(dir).unwrap_or_else(|_| dir.to_path_buf());
let dir = dunce::canonicalize(dir).unwrap_or_else(|_| dir.to_path_buf());
let project = up(&dir, ".raea/project").is_some();
let mut found = Vec::new();
sources(&dir, "", 0, &mut found);
@@ -192,7 +192,7 @@ pub fn scan(dir: &Path, overridden: &[String]) -> Registry {
.map(|(path, rel)| {
let src = std::fs::read_to_string(&path).unwrap_or_default();
let facts = read::read(&src, rel.ends_with(".tsx"));
File { path: std::fs::canonicalize(&path).unwrap_or(path), rel, facts }
File { path: dunce::canonicalize(&path).unwrap_or(path), rel, facts }
})
.collect();
+6 -3
View File
@@ -56,7 +56,7 @@ impl Lint {
/// A path with the home folder as ~, as a person reads it.
fn tilde(p: &Path) -> String {
match std::env::var_os("HOME").map(PathBuf::from) {
match raea_io_home::user_home() {
Some(h) if p.starts_with(&h) => format!("~/{}", p.strip_prefix(&h).unwrap_or(p).display()),
_ => p.display().to_string(),
}
@@ -74,7 +74,10 @@ pub(super) fn lint(reg: &Registry, files: &[File], used_by: &BTreeMap<String, BT
let comp_files: BTreeSet<&str> = reg.compositions.iter().map(|c| c.file.as_str()).collect();
let controller_files: BTreeSet<&str> = reg.controllers.iter().map(|c| c.file.as_str()).collect();
// the workspace's shared/, which a project reaches as @shared/
let shared = super::up(&reg.dir, ".raea/workspace").map(|w| w.join("shared")).map(|s| s.canonicalize().unwrap_or(s));
let shared = super::up(&reg.dir, ".raea/workspace").map(|w| {
let s = w.join("shared");
dunce::canonicalize(&s).unwrap_or(s)
});
for f in files {
if let Some(why) = &f.facts.broken {
@@ -102,7 +105,7 @@ pub(super) fn lint(reg: &Registry, files: &[File], used_by: &BTreeMap<String, BT
"outside",
format!("imports {} from outside the project", tilde(&to)),
&match in_shared {
Some(r) => format!("import it by the workspace's name for it: \"@shared/{}\"", r.with_extension("").display()),
Some(r) => format!("import it by the workspace's name for it: \"@shared/{}\"", r.with_extension("").to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")),
None => "move it to the workspace's shared/ and import it as @shared/<kind>/<name>, or copy it into the project (raea component add, for raea's sets)".into(),
},
))
+1 -1
View File
@@ -35,7 +35,7 @@ mod tempdir {
static N: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
let d = std::env::temp_dir().join(format!("raea-registry-{}-{}", std::process::id(), N.fetch_add(1, std::sync::atomic::Ordering::Relaxed)));
std::fs::create_dir_all(&d).unwrap();
Dir(std::fs::canonicalize(&d).unwrap())
Dir(dunce::canonicalize(&d).unwrap())
}
}
impl Drop for Dir {
+7 -2
View File
@@ -49,6 +49,11 @@ fn old_briefs(dir: &Path, depth: usize, out: &mut Vec<Finding>) {
/// A committed git-config file's keys this version writes, and its include from the repo's config.
fn format(repo: &Path, file: &Path, keys: &[(&str, String)], out: &mut Vec<Finding>) {
// first, so its fix runs before the others: with it there, every git command in the repo fails (#169)
if crate::repair::has_verbatim_include(repo) {
let says = format!("{}: its git config includes a \\\\?\\ path Git for Windows can't open (written by raea 0.1.5 or 0.1.6 on Windows), so every git command in it fails; --fix replaces it", repo.display());
out.push(Finding { says, fix: Fix::Include(repo.to_path_buf(), file.to_path_buf()) });
}
for (k, v) in keys {
if get(file, k).is_none() {
out.push(Finding { says: format!("{}: no {k} (an older format); --fix sets it to {v}", file.display()), fix: Fix::Set(file.to_path_buf(), k.to_string(), v.clone()) });
@@ -56,7 +61,7 @@ fn format(repo: &Path, file: &Path, keys: &[(&str, String)], out: &mut Vec<Findi
}
// only a folder that is its own repo includes its file (a workspace, a split project); an inline project shares
// the workspace's repo, whose config must not take one project's keys
let own = git(repo, &["rev-parse", "--show-toplevel"]).ok().and_then(|t| Path::new(&t).canonicalize().ok()) == repo.canonicalize().ok();
let own = git(repo, &["rev-parse", "--show-toplevel"]).ok().and_then(|t| dunce::canonicalize(Path::new(&t)).ok()) == dunce::canonicalize(repo).ok();
let first = keys.first().map(|(k, _)| *k).unwrap_or_default();
let read = git(repo, &["config", first]).ok().filter(|v| !v.is_empty());
if own && read.is_none() && get(file, first).is_some() {
@@ -107,7 +112,7 @@ pub fn registry_dir(from: &Path) -> Option<PathBuf> {
if let Some(p) = up(from, ".raea/project") {
return Some(p);
}
let from = from.canonicalize().unwrap_or_else(|_| from.to_path_buf());
let from = dunce::canonicalize(from).unwrap_or_else(|_| from.to_path_buf());
(up(&from, ".raea/workspace").as_deref() != Some(from.as_path())).then_some(from)
}
+1
View File
@@ -8,6 +8,7 @@ use serde_json::json;
mod controllers;
pub mod doctor;
mod literal;
mod repair;
pub mod next;
pub mod registry;
mod storage;
+58
View File
@@ -0,0 +1,58 @@
//! Workspaces raea 0.1.5 and 0.1.6 broke on Windows (#169): their include.path is a relative climb glued to a `\\?\`
//! path (`../../../../\\?\C:/\/Users/...`), which Git for Windows can't open, so every git command in the repo failed
//! with "Invalid argument", `git rev-parse` too. A repair can't ask git, then: it reads the repo's config file itself
//! and drops those lines, and the include is added again the right way (workspace::include, run by `raea workspace
//! init` inside it, `raea workspace adopt` and `raea doctor --fix`).
use std::path::{Path, PathBuf};
/// The repo's own config file, found without git: `.git/config`, or the config in the folder a `.git` file names (a
/// submodule's, under the workspace's .git/modules).
fn config_file(repo: &Path) -> Option<PathBuf> {
let dot = repo.join(".git");
if dot.is_dir() {
return Some(dot.join("config"));
}
let text = std::fs::read_to_string(&dot).ok()?;
let dir = PathBuf::from(text.lines().find_map(|l| l.strip_prefix("gitdir:"))?.trim());
Some(if dir.is_absolute() { dir } else { repo.join(dir) }.join("config"))
}
/// The config's text without the `path = ...\\?\...` lines of its [include] sections, and whether there were any.
/// [includeIf] sections and every other line are kept as they are.
pub(crate) fn without_verbatim(text: &str) -> (String, bool) {
let mut section = String::new();
let mut dropped = false;
let eol = if text.contains("\r\n") { "\r\n" } else { "\n" };
let kept: Vec<&str> = text
.lines()
.filter(|l| {
let t = l.trim();
if t.starts_with('[') {
section = t.trim_start_matches('[').split(']').next().unwrap_or_default().trim().to_ascii_lowercase();
return true;
}
let key = t.split('=').next().unwrap_or_default().trim();
let bad = section == "include" && key.eq_ignore_ascii_case("path") && t.contains("?\\");
dropped |= bad;
!bad
})
.collect();
(kept.join(eol) + eol, dropped)
}
/// Whether the repo's config holds an include git can't open on Windows (what `raea doctor` reports).
pub fn has_verbatim_include(repo: &Path) -> bool {
config_file(repo).and_then(|c| std::fs::read_to_string(c).ok()).is_some_and(|t| without_verbatim(&t).1)
}
/// Drops those includes from the repo's config. Ok(true) when there were some.
pub(crate) fn drop_verbatim_includes(repo: &Path) -> Result<bool, String> {
let Some(cfg) = config_file(repo) else { return Ok(false) };
let Ok(text) = std::fs::read_to_string(&cfg) else { return Ok(false) };
let (fixed, dropped) = without_verbatim(&text);
if dropped {
std::fs::write(&cfg, fixed).map_err(|e| format!("{}: {e}", cfg.display()))?;
}
Ok(dropped)
}
+74 -1
View File
@@ -22,7 +22,7 @@ fn a_spec_module_is_tidy_typescript() {
#[test]
fn up_finds_the_nearest_marker() {
let root = std::env::temp_dir().canonicalize().unwrap().join(format!("raea-ws-up-{}", std::process::id()));
let root = dunce::canonicalize(std::env::temp_dir()).unwrap().join(format!("raea-ws-up-{}", std::process::id()));
let deep = root.join("projects/launch/media");
std::fs::create_dir_all(&deep).unwrap();
std::fs::create_dir_all(root.join(".raea")).unwrap();
@@ -139,6 +139,43 @@ fn the_root_with_none_set() {
assert_eq!(default_root(&synced), synced.join("raea"));
}
#[test]
fn a_workspace_reads_back_through_git() {
// Windows: canonicalize() gives \\?\C:\..., a path Git for Windows can neither read nor lock, and one that shares no
// prefix with the C:/... git prints, so the include climbed to the root (../../../../\\?\C:/...) and every git
// command in the workspace failed; ids were never written and nothing read back (0.1.5, 0.1.6)
let ws = scratch("plain");
let made = crate::workspace::workspace(&["adopt".into(), ws.display().to_string(), "--name".into(), "Plain".into()]);
assert!(made.is_ok(), "{made:?}");
let git = |dir: &Path, a: &[&str]| {
let o = std::process::Command::new("git").arg("-C").arg(dir).args(a).output().unwrap();
(o.status.success(), String::from_utf8_lossy(&o.stdout).trim().to_string(), String::from_utf8_lossy(&o.stderr).trim().to_string())
};
let (ok, inc, err) = git(&ws, &["config", "--get-all", "include.path"]);
assert!(ok && inc == "../.raea/workspace", "include.path {inc:?} {err}");
let (ok, id, err) = git(&ws, &["config", "workspace.id"]);
assert!(ok && id.starts_with("ws_"), "workspace.id {id:?} {err}");
let found = up(&ws.join("projects"), ".raea/workspace").expect("up finds the workspace");
assert!(!found.to_string_lossy().starts_with(r"\\?\"), "{}", found.display());
crate::workspace::new_project_in(&found, "Desk", None).unwrap();
let (ok, pid, err) = git(&ws.join("projects/desk"), &["config", "-f", ".raea/project", "project.id"]);
assert!(ok && pid.starts_with("pj_"), "project.id {pid:?} {err}");
let _ = std::fs::remove_dir_all(&ws);
}
#[test]
fn an_include_path_is_relative_with_slashes() {
use crate::workspace::relative;
assert_eq!(relative(Path::new("/w/.git"), Path::new("/w/.raea/workspace")), "../.raea/workspace");
assert_eq!(relative(Path::new("/w/.git/modules/projects/p"), Path::new("/w/projects/p/.raea/project")), "../../../../projects/p/.raea/project");
#[cfg(windows)]
{
// git's C:/... and a plain C:\... are one root; another drive is named whole, not climbed to
assert_eq!(relative(Path::new("C:/w/.git"), Path::new(r"C:\w\.raea\workspace")), "../.raea/workspace");
assert_eq!(relative(Path::new(r"C:\w\.git"), Path::new(r"D:\o\.raea\workspace")), "D:/o/.raea/workspace");
}
}
#[test]
fn a_new_workspace_and_project_have_the_layout() {
// docs/layout.feature LY1: a folder per kind in the project and in the workspace's shared/, no media/ brand/ parts/
@@ -166,3 +203,39 @@ fn a_new_workspace_and_project_have_the_layout() {
assert!(tracked.contains("projects/desk-test/components/.gitkeep") && tracked.contains("shared/assets/.gitkeep"), "{tracked}");
let _ = std::fs::remove_dir_all(&ws);
}
#[test]
fn a_verbatim_include_is_dropped_and_nothing_else() {
// .git/config as raea 0.1.6 left it on Windows (#169, read off the test PC), with an [includeIf] and a good include
let text = "[core]\n\trepositoryformatversion = 0\n[include]\n\tpath = ../../../../../../../../\\\\\\\\?\\\\C:/\\\\/Users/you/Documents/raea/acme/.raea/workspace\n[includeIf \"gitdir:~/x/\"]\n\tpath = ../keep?\\\\x\n[include]\n\tpath = ../.raea/workspace\n";
let (fixed, dropped) = crate::repair::without_verbatim(text);
assert!(dropped);
assert_eq!(fixed, "[core]\n\trepositoryformatversion = 0\n[include]\n[includeIf \"gitdir:~/x/\"]\n\tpath = ../keep?\\\\x\n[include]\n\tpath = ../.raea/workspace\n");
assert_eq!(crate::repair::without_verbatim(&fixed).0, fixed);
assert!(!crate::repair::without_verbatim("[include]\r\n\tpath = ../.raea/workspace\r\n").1);
}
#[test]
fn a_workspace_0_1_6_broke_is_repaired() {
// updated from 0.1.6: its include names a \\?\ path; doctor says so, and adopt (as init inside it) puts it right
let ws = scratch("repair");
crate::workspace::workspace(&["adopt".into(), ws.display().to_string(), "--name".into(), "Repair".into()]).unwrap();
let cfg = ws.join(".git/config");
let bad = "\tpath = ../../../../\\\\\\\\?\\\\C:/\\\\/Users/you/Documents/raea/repair/.raea/workspace\n";
let text = std::fs::read_to_string(&cfg).unwrap().replace("\tpath = ../.raea/workspace\n", bad);
std::fs::write(&cfg, text).unwrap();
// on Windows this is #169 itself: Git for Windows refuses the include, so every git command in the repo fails
let status = || std::process::Command::new("git").arg("-C").arg(&ws).args(["status", "--short"]).output().unwrap();
if cfg!(windows) {
assert!(!status().status.success(), "git ran in a repo whose include names a \\\\?\\ path");
}
assert!(crate::repair::has_verbatim_include(&ws));
let said: Vec<String> = crate::doctor::findings(&ws, &[], "test").into_iter().filter(|f| f.fixable()).map(|f| f.says).collect();
assert!(said.iter().any(|s| s.contains("Git for Windows can't open")), "{said:?}");
crate::workspace::workspace(&["adopt".into(), ws.display().to_string()]).unwrap();
assert!(!crate::repair::has_verbatim_include(&ws));
let o = std::process::Command::new("git").arg("-C").arg(&ws).args(["config", "--get-all", "include.path"]).output().unwrap();
assert_eq!(String::from_utf8_lossy(&o.stdout).trim(), "../.raea/workspace");
assert!(status().status.success(), "git status after the repair: {}", String::from_utf8_lossy(&status().stderr));
let _ = std::fs::remove_dir_all(&ws);
}
+18 -5
View File
@@ -92,7 +92,9 @@ pub(crate) fn new_id(prefix: &str) -> String {
/// Where workspaces live on this machine: `git config --global raea.root`, else default_root.
pub fn root() -> PathBuf {
let set = config(None, &["--global", "raea.root"]).ok().filter(|s| !s.is_empty());
let home = std::env::var_os("HOME").map(PathBuf::from).unwrap_or_default();
// HOME, else USERPROFILE: Windows sets no HOME for an app opened from the Start menu, which made the root
// Documents/raea under whatever folder raea ran in. git's global config is found the same way.
let home = raea_io_home::user_home().unwrap_or_default();
match set {
Some(s) if s.starts_with("~/") => home.join(&s[2..]),
Some(s) => PathBuf::from(s),
@@ -116,8 +118,14 @@ pub fn default_root(home: &Path) -> PathBuf {
/// The include in a repo's own config that makes `git config` read a committed file. Idempotent; the path is relative
/// to the config file, which for a submodule lives under the workspace's .git/modules.
pub(crate) fn include(repo: &Path, file: &Path) -> R<()> {
// both ends the same way, plain (dunce): on Windows git prints C:/... and canonicalize() alone gave \\?\C:\..., which
// share no root, so the include climbed to the drive and named the file by its \\?\ path, and every git command in
// the workspace failed ("Invalid argument") from its first commit (0.1.5, 0.1.6). Such an include goes first: with
// it there, the rev-parse below fails too.
crate::repair::drop_verbatim_includes(repo)?;
let cfg = PathBuf::from(git(repo, &["rev-parse", "--path-format=absolute", "--git-path", "config"])?);
let file = file.canonicalize().map_err(|e| format!("{}: {e}", file.display()))?;
let cfg = dunce::canonicalize(&cfg).unwrap_or(cfg);
let file = dunce::canonicalize(file).map_err(|e| format!("{}: {e}", file.display()))?;
let rel = relative(cfg.parent().unwrap_or(Path::new("/")), &file);
let have = config(Some(&cfg), &["--get-all", "include.path"]).unwrap_or_default();
if have.lines().any(|l| l.trim() == rel) {
@@ -126,9 +134,14 @@ pub(crate) fn include(repo: &Path, file: &Path) -> R<()> {
config(Some(&cfg), &["--add", "include.path", &rel]).map(drop)
}
fn relative(from: &Path, to: &Path) -> String {
/// `to` from the folder `from`, '/' between its parts as git reads an include.path; `to` itself (with '/') when the two
/// share no root, as two drives don't.
pub(crate) fn relative(from: &Path, to: &Path) -> String {
let (a, b): (Vec<_>, Vec<_>) = (from.components().collect(), to.components().collect());
let same = a.iter().zip(&b).take_while(|(x, y)| x == y).count();
if same == 0 {
return to.to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/");
}
let mut out: Vec<String> = std::iter::repeat_n("..".to_string(), a.len() - same).collect();
out.extend(b[same..].iter().map(|c| c.as_os_str().to_string_lossy().into_owned()));
out.join("/")
@@ -213,7 +226,7 @@ fn init(name: Option<&str>, layout: Option<&str>) -> R<String> {
/// An existing folder made a workspace in place: git when it isn't a repo, .raea/workspace, and each folder in it
/// holding a brief.ts registered as an inline project. Nothing is moved or deleted.
fn adopt(dir: &Path, name: Option<&str>, layout: Option<&str>) -> R<String> {
let dir = dir.canonicalize().map_err(|e| format!("{}: {e}", dir.display()))?;
let dir = dunce::canonicalize(dir).map_err(|e| format!("{}: {e}", dir.display()))?;
let name = name.map(String::from).unwrap_or_else(|| dir.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default());
make_workspace(&dir, &name, layout_of(layout)?)?;
let mut found = vec![];
@@ -244,7 +257,7 @@ pub(crate) fn make_workspace(dir: &Path, name: &str, layout: &str) -> R<()> {
let parent = dir.parent().unwrap_or(Path::new("/"));
if !dir.join(".git").exists() && parent.exists() {
let top = git(parent, &["rev-parse", "--show-toplevel"]).ok().map(PathBuf::from);
if top.is_some_and(|t| t.canonicalize().ok() == parent.canonicalize().ok()) {
if top.is_some_and(|t| dunce::canonicalize(t).ok() == dunce::canonicalize(parent).ok()) {
return Err(format!("{} would be a folder of the git repo {}: set where workspaces go, `git config --global raea.root ~/Documents/raea`", dir.display(), parent.display()));
}
}
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# #159: --aov and RAEA_PASS on a multisampled 3D camera write every frame. Both read the camera's prepasses as
# single-sampled textures, so they turn its multisampling off; the camera row's post-processing turned it back on: in
# a render, on the first frame whose post changed (ramp.tsx's bloom ramps); in a game, on every frame its rows set
# (game.tsx). Frame 2 was then refused ("Texture binding 0 expects multisampled = false, but given a view with
# samples = 4"), with frames 0 and 1 written. Here frames 0 to 5 of each are rendered: --aov must write each frame's
# depth and motion at the frame's size (320 x 180 floats: 4 and 8 bytes a pixel), the depth not all zero (something
# drawn), and RAEA_PASS=depth all six pictures. Exits 1 on a failure.
# bench/aov-msaa/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
cd "$(dirname "$0")/../.." || exit 2
BIN=${RAEA_BIN:-$PWD/target/release/raea}
AT=0,1,2,3,4,5
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0 RAEA_AUDIO_MUTE=1
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-aov-msaa.XXXXXX")
trap 'rm -rf "$OUT"' EXIT
refused() { grep -m1 REFUSED "$1" || tail -3 "$1"; }
for c in ramp game; do
"$BIN" render "bench/aov-msaa/$c.tsx" --at "$AT" --aov -o "$OUT/$c" > "$OUT/$c.log" 2>&1 || { echo "FAIL: $c --aov: the render failed"; refused "$OUT/$c.log"; exit 1; }
for i in 0 1 2 3 4 5; do
n=$(printf '%05d' "$i")
[ "$(wc -c < "$OUT/$c/depth/frame-$n.f32" 2>/dev/null | tr -d ' ')" = 230400 ] || { echo "FAIL: $c --aov: frame $i's depth is missing or not 320 x 180"; exit 1; }
[ "$(wc -c < "$OUT/$c/motion/frame-$n.f32" 2>/dev/null | tr -d ' ')" = 460800 ] || { echo "FAIL: $c --aov: frame $i's motion is missing or not 320 x 180"; exit 1; }
[ "$(LC_ALL=C tr -d '\0' < "$OUT/$c/depth/frame-$n.f32" | head -c 1 | wc -c | tr -d ' ')" = 1 ] || { echo "FAIL: $c --aov: frame $i's depth is all zero"; exit 1; }
done
echo "PASS: $c --aov: frames 0 to 5, each with its depth and motion"
done
RAEA_PASS=depth RAEA_READBACK=rgba "$BIN" render bench/aov-msaa/ramp.tsx --at "$AT" -o "$OUT/pass" > "$OUT/pass.log" 2>&1 || { echo "FAIL: ramp RAEA_PASS=depth: the render failed"; refused "$OUT/pass.log"; exit 1; }
[ "$(ls "$OUT/pass"/frame-*.png 2>/dev/null | wc -l | tr -d ' ')" = 6 ] || { echo "FAIL: ramp RAEA_PASS=depth: not six frames"; exit 1; }
echo "PASS: ramp RAEA_PASS=depth: frames 0 to 5"
+31
View File
@@ -0,0 +1,31 @@
// #159: a game's 3D (its rows set on the live engine each frame, so raea-sys-post's msaa_for_3d sees them): a
// multisampled camera, a still bloom and a box that moves, rendered with --aov (check.sh).
import { AbsoluteFill, registerRoot, Composition, useGameState } from "raea";
import { Bloom, Canvas3D, ToneMapping, manifold } from "raea/3d";
import { Camera3d } from "raea/camera";
import { AmbientLight, DirectionalLight } from "raea/light";
import { Mesh3d } from "raea/mesh";
import { StandardMaterial } from "raea/pbr";
import { Transform } from "raea/transform";
const GROUND = manifold.box(20, 1, 20).move(0, -0.5, 0);
const BOX = manifold.box(1.5, 1.5, 1.5);
function Game() {
const t = useGameState({ t: 0 }, (s) => ({ t: s.t + 1 })).t;
return (
<AbsoluteFill style={{ background: "#202830" }}>
<Canvas3D>
<Camera3d transform={Transform.fromXyz(6, 3, 8).lookingAt([0, 0.8, 0], [0, 1, 0])} projection={{ Perspective: { fov: 0.8, near: 0.1, far: 100 } }} />
<DirectionalLight name="sun" transform={Transform.fromXyz(10, 20, 5).lookingAt([0, 0, 0], [0, 1, 0])} illuminance={20000} shadow_maps_enabled />
<AmbientLight brightness={200} />
<Mesh3d name="ground" shape={GROUND}><StandardMaterial base_color="#6a7a50" perceptual_roughness={0.9} /></Mesh3d>
<Mesh3d name="box" shape={BOX} transform={Transform.fromXyz(-1.5 + t * 0.2, 0.75, 0)}><StandardMaterial base_color="#d03020" emissive="#ffe0a0" emissive_intensity={4} /></Mesh3d>
<ToneMapping mode="agx" />
<Bloom intensity={0.3} threshold={0.8} />
</Canvas3D>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="game" component={Game} width={320} height={180} fps={30} durationInFrames={10} />);
+31
View File
@@ -0,0 +1,31 @@
// #159: a multisampled 3D camera (no AO or <AntiAliasing>) whose post-processing changes on every frame (a bloom ramp),
// rendered with --aov and with RAEA_PASS (check.sh). Its frames read the camera's rows through raea-sys-post's sync.
import { AbsoluteFill, interpolate, registerRoot, Composition, useCurrentFrame } from "raea";
import { Bloom, Canvas3D, ToneMapping, manifold } from "raea/3d";
import { Camera3d } from "raea/camera";
import { AmbientLight, DirectionalLight } from "raea/light";
import { Mesh3d } from "raea/mesh";
import { StandardMaterial } from "raea/pbr";
import { Transform } from "raea/transform";
const GROUND = manifold.box(20, 1, 20).move(0, -0.5, 0);
const BOX = manifold.box(1.5, 1.5, 1.5);
function Ramp() {
const f = useCurrentFrame();
return (
<AbsoluteFill style={{ background: "#202830" }}>
<Canvas3D>
<Camera3d transform={Transform.fromXyz(6, 3, 8).lookingAt([0, 0.8, 0], [0, 1, 0])} projection={{ Perspective: { fov: 0.8, near: 0.1, far: 100 } }} />
<DirectionalLight name="sun" transform={Transform.fromXyz(10, 20, 5).lookingAt([0, 0, 0], [0, 1, 0])} illuminance={20000} shadow_maps_enabled />
<AmbientLight brightness={200} />
<Mesh3d name="ground" shape={GROUND}><StandardMaterial base_color="#6a7a50" perceptual_roughness={0.9} /></Mesh3d>
<Mesh3d name="box" shape={BOX} transform={Transform.fromXyz(-1.5 + f * 0.2, 0.75, 0)}><StandardMaterial base_color="#d03020" emissive="#ffe0a0" emissive_intensity={4} /></Mesh3d>
<ToneMapping mode="agx" />
<Bloom intensity={interpolate(f, [0, 9], [0.1, 0.6])} threshold={0.8} />
</Canvas3D>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="ramp" component={Ramp} width={320} height={180} fps={30} durationInFrames={10} />);
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
# #162: every still of a batch (--at A,B,C in one run) shows its own frame's time, as it does alone and as a scene
# stepped through every frame before it does. Since #77 a still of a scene no plugin carries state for isn't stepped to,
# and the plugins' clock then never moved: every still sampled globals.time 0, and a batch's later frames drew its
# first frame's <Material> uniforms (they land as keyed rows). time.tsx's face shows globals.time on its left half and
# a uniform the frame gives its time on its right, so the halves match only when Time is the frame's. Its "time"
# composition is drawn at 90, 30, 60 in one run (the clock forwards and back) and at 90 alone, and must step no frame
# to reach them; "stepped" (the same face with an animation player, so its stills are stepped to, as 0.1.0 drew every
# still) at the same three. Each frame's halves must match within 1 level, each "time" frame must match the "stepped"
# one and 90 alone the batch's 90 (within 1 level), and 90 must be brighter than 60 and 60 than 30. Exits 1 on a failure.
# bench/at-time/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
cd "$(dirname "$0")/../.." || exit 2
BIN=${RAEA_BIN:-$PWD/target/release/raea}
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-at-time.XXXXXX")
trap 'rm -rf "$OUT"' EXIT
draw() { # NAME COMPOSITION AT: the frames in $OUT/NAME, the plugin clock's trace in $OUT/NAME.log
RAEA_PLUGIN_TRACE=1 "$BIN" render bench/at-time/time.tsx --composition "$2" --at "$3" -o "$OUT/$1" > "$OUT/$1.log" 2>&1 && [ -f "$OUT/$1/frame-00000.png" ] || { echo "FAIL $1: the render failed"; grep -v "^plugin clock" "$OUT/$1.log" | tail -4 | sed 's/^/ /'; exit 1; }
}
draw batch time 90,30,60
draw lone time 90
draw stepped stepped 90,30,60
status=0
fail() { echo "FAIL $*"; status=1; }
steps() { grep -c "^plugin clock: .* step$" "$OUT/$1.log"; }
(( $(steps batch) == 0 && $(steps lone) == 0 )) || fail "the time stills stepped $(steps batch) and $(steps lone) frames, wanted none (it has nothing a plugin carries)"
(( $(steps stepped) > 0 )) || fail "the stepped stills stepped no frame, so they show nothing of the stepped clock"
half() { magick "$1" -crop "24x48+$2+8" +repage -format "%[fx:int(255*mean.r+0.5)]" info:; } # FILE X: a half's grey
apart() { magick "$1" "$2" -compose difference -composite -format "%[fx:int(255*maxima+0.5)]" info:; }
k=0
for at in 90 30 60; do
f=$(printf 'frame-%05d.png' $k)
for run in batch stepped; do
t=$(half "$OUT/$run/$f" 4) u=$(half "$OUT/$run/$f" 36)
(( t - u <= 1 && u - t <= 1 )) && echo "ok $run frame $at: globals.time's half $t, the uniform's $u" || fail "$run frame $at: globals.time's half is $t and the uniform's $u: Time isn't the frame's"
done
d=$(apart "$OUT/batch/$f" "$OUT/stepped/$f")
(( d <= 1 )) || fail "frame $at differs from the stepped scene's by up to $d levels"
eval "grey_$at=$(half "$OUT/batch/$f" 4)"
k=$((k + 1))
done
d=$(apart "$OUT/lone/frame-00000.png" "$OUT/batch/frame-00000.png")
(( d <= 1 )) && echo "ok frame 90 alone matches the batch's frame 90" || fail "frame 90 alone differs from the batch's frame 90 by up to $d levels"
(( grey_90 > grey_60 && grey_60 > grey_30 )) || fail "the batch's frames 30, 60 and 90 are $grey_30, $grey_60 and $grey_90: frozen, not moving on"
[ $status = 0 ] && echo "PASS every still of a batch shows its own frame's time, as alone and as stepped to"
exit $status
+35
View File
@@ -0,0 +1,35 @@
// #162's composition, which bench/at-time/check.sh draws: one face, its left half grey by Bevy's globals.time and its
// right half by a <Material> uniform the frame gives its time in seconds (each at a quarter of it), so the halves match
// only when Time is the frame drawn's. "time" holds nothing a plugin carries, so a still draws only its own frame
// (#77); "stepped" is the same face with an animation player on it (it plays nothing), which Bevy carries from frame
// to frame, so a still is stepped to through every frame before it.
import { Composition, registerRoot, useCurrentFrame } from "raea";
import { Transform } from "raea/transform";
import { Camera3d } from "raea/camera";
import { Cuboid, Mesh3d } from "raea/mesh";
import { BevyComponent } from "raea/3d";
import { Material } from "@raea/render/bevy3d";
function Shot({ stepped }: { stepped: boolean }) {
const f = useCurrentFrame();
return (
<>
<Mesh3d transform={Transform.fromXyz(0, 0, 0)}>
<Cuboid half_size={[2, 2, 0.01]} />
<Material fragment="time.wesl" uniforms={{ seconds: f / 30 }} />
{stepped ? <BevyComponent type="bevy_animation::AnimationPlayer" value={{ active_animations: {} }} /> : null}
</Mesh3d>
<Camera3d transform={Transform.fromXyz(0, 0, 3).lookingAt([0, 0, 0])} />
</>
);
}
const Pure = () => <Shot stepped={false} />;
const Stepped = () => <Shot stepped />;
registerRoot(() => (
<>
<Composition id="time" component={Pure} width={64} height={64} fps={30} durationInFrames={120} />
<Composition id="stepped" component={Stepped} width={64} height={64} fps={30} durationInFrames={120} />
</>
));
+13
View File
@@ -0,0 +1,13 @@
// The left half grey by Bevy's globals.time, the right by the uniform the frame gives: each a quarter of its seconds.
import bevy_pbr::render::{
mesh_view_bindings::globals,
forward_io::VertexOutput,
};
@group(constants::MATERIAL_BIND_GROUP) @binding(0) var<uniform> seconds: f32;
@fragment
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
let t = select(seconds, globals.time, in.uv.x < 0.5) / 4.0;
return vec4<f32>(t, t, t, 1.0);
}
+3
View File
@@ -30,3 +30,6 @@ ignored = ["argh", "accesskit", "rand", "chacha20", "bytemuck", "indexmap", "non
[features]
default = ["default_font"]
default_font = []
[build-dependencies]
raea-io-home = { path = "../../io/home" }
+1 -1
View File
@@ -9,7 +9,7 @@ fn main() {
let here = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let src = std::env::var("BEVY_SRC")
.map(PathBuf::from)
.unwrap_or_else(|_| PathBuf::from(std::env::var("HOME").unwrap()).join(".cache/raea-vendor/bevy-0.20.0"));
.unwrap_or_else(|_| raea_io_home::user_home().unwrap().join(".cache/raea-vendor/bevy-0.20.0"));
let out = PathBuf::from(std::env::var("OUT_DIR").unwrap());
println!("cargo:rerun-if-changed=examples.list");
println!("cargo:rerun-if-env-changed=BEVY_SRC");
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "The Blitz-Bevy bridge's bench (run.sh): its examples, each a Bevy program that checks one of the bridge's claims (B3 H1-H11)"
[dev-dependencies]
dunce = "1"
raea-io-home = { path = "../../io/home" }
raea-runtime-react = { path = "../../runtime/react" }
raea-runtime-page = { path = "../../runtime/page" }
+1 -1
View File
@@ -29,7 +29,7 @@ fn main() {
std::process::exit(2);
};
let out = args.next();
let js = PathBuf::from(js).canonicalize().expect("the bundle");
let js = dunce::canonicalize(&PathBuf::from(js)).expect("the bundle");
let mut app = App::new();
app.add_plugins(
DefaultPlugins
+1 -1
View File
@@ -21,7 +21,7 @@ fn main() {
eprintln!("usage: entity_ref ENTITY.js");
std::process::exit(2);
};
let js = PathBuf::from(js).canonicalize().expect("the bundle");
let js = dunce::canonicalize(&PathBuf::from(js)).expect("the bundle");
let (w, h) = (320, 240);
let mut app = App::new();
app.add_plugins(
+1 -1
View File
@@ -35,7 +35,7 @@ fn main() {
eprintln!("usage: host_query HOSTQUERY.js");
std::process::exit(2);
};
let js = PathBuf::from(js).canonicalize().expect("the bundle");
let js = dunce::canonicalize(&PathBuf::from(js)).expect("the bundle");
let mut app = App::new();
app.add_plugins(
DefaultPlugins
+1 -1
View File
@@ -38,7 +38,7 @@ fn main() {
std::process::exit(2);
};
let n = |i: usize, d: u32| args.get(i).and_then(|a| a.parse().ok()).unwrap_or(d);
let a = Args { js: PathBuf::from(js).canonicalize().expect("the bundle"), out: out.clone(), size: (n(2, 640), n(3, 360)), frame: n(4, 30) as i64, fps: n(5, 30) as f64, scene_only };
let a = Args { js: dunce::canonicalize(&PathBuf::from(js)).expect("the bundle"), out: out.clone(), size: (n(2, 640), n(3, 360)), frame: n(4, 30) as i64, fps: n(5, 30) as f64, scene_only };
if window {
std::process::exit(in_window(a));
}
+1 -1
View File
@@ -33,7 +33,7 @@ fn main() {
eprintln!("usage: shared_state SHARED.js");
std::process::exit(2);
};
let js = PathBuf::from(js).canonicalize().expect("the bundle");
let js = dunce::canonicalize(&PathBuf::from(js)).expect("the bundle");
let mut app = App::new();
app.add_plugins(
DefaultPlugins
+1 -1
View File
@@ -30,7 +30,7 @@ fn main() {
std::process::exit(2);
};
let out = args.next();
let js = PathBuf::from(js).canonicalize().expect("the bundle");
let js = dunce::canonicalize(&PathBuf::from(js)).expect("the bundle");
let mut app = App::new();
app.add_plugins(
DefaultPlugins
+127
View File
@@ -0,0 +1,127 @@
#!/bin/bash
# IX14 (docs/index.feature): the Index's fast pass, measured on a fixed public set. Prints pictures a second (as the
# indexer counts them and from the command's start to its last row searchable), the seconds until the first pictures
# are searchable, peak memory, warm search time, and precision@5 for a fixed list of words.
#
# bench/index/run.sh [RAEA_BINARY] [N] (default: raea on PATH, 10000 pictures)
#
# The set: the first N of Open Images V4's 41,620 validation pictures by id (CC BY 2.0, served at 1024 px on their long
# side from the dataset's public bucket), downloaded once into RAEA_BENCH_CACHE (default ~/.cache/raea-bench/index,
# about 300 KB a picture). Precision@5 asks "a photo of a <label>" for each label in LABELS with at least 10 pictures in
# the set, and counts a hit right when Open Images' human-verified labels (CC BY 4.0) give the picture that label.
# The labels aren't exhaustive (a dog nobody labelled counts as a miss), so the figure is a floor, for comparing runs.
# Each run indexes into a new home; nothing touches ~/.raea/library/fast.
set -uo pipefail
RAEA=${1:-raea}
N=${2:-10000}
C=${RAEA_BENCH_CACHE:-$HOME/.cache/raea-bench/index}
OI=https://storage.googleapis.com/openimages
LABELS="Dog Cat Car Bird Flower Tree Building Boat Horse Bicycle Airplane Food Guitar Train Bus Pizza Clock Chair Book
Sunglasses Skyscraper Beer Cake Butterfly Fish Motorcycle Truck Tower Castle Wine Coffee Hat Drum Piano Cattle Sheep
Elephant Lighthouse Fountain Tent Umbrella Laptop Table Bed Window Sculpture"
command -v jq >/dev/null || { echo "bench/index: needs jq" >&2; exit 2; }
now() { perl -MTime::HiRes=time -e 'printf "%.3f", time'; }
mkdir -p "$C/pictures" || exit 2
cd "$C" || exit 2
for f in 2018_04/validation/validation-images-with-rotation.csv v5/validation-annotations-human-imagelabels-boxable.csv v5/class-descriptions-boxable.csv; do
[ -s "${f##*/}" ] || curl -sfL -o "${f##*/}" "$OI/$f" || { echo "bench/index: couldn't fetch $OI/$f" >&2; exit 2; }
done
tail -n +2 validation-images-with-rotation.csv | cut -d, -f1 | LC_ALL=C sort | head -n "$N" > ids.txt
[ "$(wc -l < ids.txt)" -eq "$N" ] || { echo "bench/index: the set has fewer than $N pictures" >&2; exit 2; }
# the pictures not here yet, 16 at a time
missing=$(while read -r id; do [ -s "pictures/$id.jpg" ] || echo "$id"; done < ids.txt)
if [ -n "$missing" ]; then
echo "bench/index: downloading $(wc -l <<< "$missing" | tr -d ' ') pictures into $C/pictures"
rm -f pictures/*.part
xargs -P 16 -I{} sh -c 'curl -sf -o "pictures/{}.part" "https://s3.amazonaws.com/open-images-dataset/validation/{}.jpg" && mv "pictures/{}.part" "pictures/{}.jpg" && echo {}' <<< "$missing" \
| awk 'NR % 500 == 0 { print " " NR " downloaded"; fflush() }'
fi
lost=$(while read -r id; do [ -s "pictures/$id.jpg" ] || echo "$id"; done < ids.txt | wc -l | tr -d ' ')
[ "$lost" -le $((N / 100)) ] || { echo "bench/index: $lost of $N pictures couldn't be downloaded" >&2; exit 2; }
# the run's own folder of the set (links, so the cache's folder can hold more than N)
W=$(mktemp -d "${TMPDIR:-/tmp}/ixbench.XXXX")
trap 'rm -rf "${W:?}"' EXIT
mkdir "$W/set"
sed 's/$/.jpg/' ids.txt | (cd pictures && xargs -J % ln % "$W/set/" 2>/dev/null)
have=$(ls "$W/set" | wc -l | tr -d ' ')
# the fast pass, from a cold start: the command's own time, its peak memory, and its progress lines
t0=$(now)
/usr/bin/time -l "$RAEA" index add "$W/set" --json --home "$W/home" > "$W/add.jsonl" 2> "$W/add.err"
code=$?
t1=$(now)
[ $code -eq 0 ] || { echo "bench/index: raea index add exited $code" >&2; tail -5 "$W/add.err" >&2; exit 1; }
last=$(grep '"stage":"done"' "$W/add.jsonl" | tail -1)
[ -n "$last" ] || { echo "bench/index: the fast pass never said done" >&2; tail -3 "$W/add.jsonl" >&2; exit 1; }
done_n=$(jq -r .done <<< "$last"); failed=$(jq -r .failed <<< "$last"); rate=$(jq -r .per_sec <<< "$last"); secs=$(jq -r .seconds <<< "$last")
first=$(jq -r 'select(.done > 0) | .seconds' "$W/add.jsonl" | head -1)
peak=$(awk '/maximum resident set size/ {print $1}' "$W/add.err")
wall=$(perl -e "printf '%.1f', $t1 - $t0")
# precision@5 and warm search time, through serve (the text tower loaded once, as the app keeps it)
tr -d '\r' < class-descriptions-boxable.csv > "$W/classes.csv"
awk -F, 'NR > 1 && $4 == 1 {print $1, $3}' validation-annotations-human-imagelabels-boxable.csv | tr -d '\r' | LC_ALL=C sort -u > "$W/pos.txt"
LC_ALL=C sort ids.txt > "$W/ids.sorted"
asks="$W/asks.jsonl"; : > "$asks"; : > "$W/asked.txt"
echo '{"id":"warm","op":"warm"}' >> "$asks"
for l in $LABELS; do
m=$(awk -F, -v n="$l" '$2 == n {print $1}' "$W/classes.csv")
[ -n "$m" ] || { echo "bench/index: no class $l" >&2; continue; }
n=$(awk -v m="$m" '$2 == m {print $1}' "$W/pos.txt" | LC_ALL=C join - "$W/ids.sorted" | wc -l | tr -d ' ')
[ "$n" -ge 10 ] || continue
q="a photo of a $(tr '[:upper:]' '[:lower:]' <<< "$l")"
jq -nc --arg id "$l" --arg q "$q" '{id: $id, op: "search", q: $q, k: 5}' >> "$asks"
echo "$l $m $n" >> "$W/asked.txt"
done
"$RAEA" index serve --home "$W/home" < "$asks" > "$W/answers.jsonl" 2> "$W/serve.err"
right=0; asked=0; : > "$W/ms.txt"
while read -r l m n; do
a=$(jq -c --arg id "$l" 'select(.id == $id)' "$W/answers.jsonl")
[ -n "$a" ] || { echo "bench/index: no answer for $l" >&2; continue; }
hits=$(jq -r '.hits[].name | sub("\\.jpg$"; "")' <<< "$a")
r=$(for h in $hits; do grep -qx "$h $m" "$W/pos.txt" && echo 1; done | wc -l | tr -d ' ')
right=$((right + r)); asked=$((asked + 1))
jq -r '.ms.words + .ms.search' <<< "$a" >> "$W/ms.txt"
[ -n "${IXBENCH_VERBOSE:-}" ] && echo " $l ($n in the set): $r of 5"
done < "$W/asked.txt"
p5=$(perl -e "printf '%.3f', $right / (5 * ($asked || 1))")
ms=$(sort -n "$W/ms.txt" | awk '{a[NR] = $1} END {printf "%.1f", a[int((NR + 1) / 2)]}')
# videos: two Blender open films (Elephants Dream, CC BY 2.5; Tears of Steel, CC BY 3.0; 720p H.264) cut once into
# 30 s clips without re-encoding, as a library of short clips is; the fast pass reads each clip's poster and a frame
# every 4 s (IX2). IXBENCH_NO_VIDEO=1 skips them
vids=0; vmin=0; vwall=0
if [ -z "${IXBENCH_NO_VIDEO:-}" ]; then
command -v ffmpeg >/dev/null || { echo "bench/index: the videos need ffmpeg (or IXBENCH_NO_VIDEO=1)" >&2; exit 2; }
mkdir -p clips
if [ -z "$(ls clips 2>/dev/null)" ]; then
for f in ED/elephantsdream-720-h264-st-aac.mov demo/movies/ToS/tears_of_steel_720p.mov; do
src="$W/${f##*/}"
echo "bench/index: fetching https://download.blender.org/$f"
curl -sfL -o "$src" "https://download.blender.org/$f" || { echo "bench/index: couldn't fetch $f" >&2; exit 2; }
ffmpeg -v error -i "$src" -map 0:v:0 -map 0:a:0? -c copy -f segment -segment_time 30 -reset_timestamps 1 "clips/${f##*/}-%03d.mov" || exit 2
rm -f "$src"
done
fi
vids=$(ls clips | wc -l | tr -d ' ')
vmin=$(for c in clips/*.mov; do ffprobe -v error -show_entries format=duration -of csv=p=0 "$c"; done | awk '{s += $1} END {printf "%.1f", s / 60}')
mkdir "$W/clips" && ln clips/*.mov "$W/clips/"
t0=$(now)
"$RAEA" index add "$W/clips" --json --home "$W/vhome" > "$W/vadd.jsonl" 2> "$W/vadd.err" || { echo "bench/index: raea index add (videos) failed" >&2; tail -5 "$W/vadd.err" >&2; exit 1; }
t1=$(now)
vdone=$(grep '"stage":"done"' "$W/vadd.jsonl" | tail -1 | jq -r .done)
[ "$vdone" = "$vids" ] || echo "bench/index: only ${vdone:-0} of $vids clips searchable" >&2
vwall=$(perl -e "printf '%.1f', $t1 - $t0")
fi
echo "bench/index: $have pictures (Open Images V4 validation, first $N by id), $RAEA ($("$RAEA" --version 2>/dev/null | head -1))"
echo " fast pass $done_n searchable, $failed failed: $(printf '%.0f' "$rate") pictures a second as the indexer counts ($(printf '%.1f' "$secs") s)"
echo " from cold start $wall s for the command, $(perl -e "printf '%.0f', $done_n / $wall") pictures a second; the first searchable at $(printf '%.2f' "${first:-0}") s"
echo " peak memory $(perl -e "printf '%.0f', ${peak:-0} / 1048576") MB"
echo " search $ms ms warm (median of $asked; words embedded and every row scored)"
echo " precision@5 $p5 over $asked labels (a floor: Open Images' labels aren't exhaustive)"
[ "$vids" -gt 0 ] && echo " videos $vids clips ($vmin min) in $vwall s from cold start: $(perl -e "printf '%.1f', $vmin / $vwall") video minutes a second, $(perl -e "printf '%.1f', $vids / $vwall") clips a second"
jq -nc --argjson n "$have" --argjson done "$done_n" --argjson rate "$rate" --argjson wall "$wall" --argjson first "${first:-0}" \
--argjson peak "${peak:-0}" --argjson ms "$ms" --argjson p5 "$p5" --argjson asked "$asked" \
--argjson vids "$vids" --argjson vmin "$vmin" --argjson vwall "$vwall" \
'{pictures: $n, searchable: $done, per_sec: $rate, wall_s: $wall, first_s: $first, peak_bytes: $peak, search_ms: $ms, p5: $p5, labels: $asked, clips: $vids, clip_minutes: $vmin, clips_wall_s: $vwall}'
+7
View File
@@ -0,0 +1,7 @@
{
"0": ["Pointer:480:60"],
"6": ["Pointer:480:260"],
"10": ["Pointer:480:260:down"],
"12": ["Pointer:480:260"],
"21": ["Pointer:480:60"]
}
+4 -1
View File
@@ -8,7 +8,8 @@
# React on the page with 3D in the world, picking and input replay are all here: the games (pong and platformer on
# the page, arena3d's 3D drawn live), bevy-ts' live cases (keys, the pointer, a gamepad, the window and the World's
# components through useQuery), the bridge's Engine reads (engine3d: a cube the World moves, React's marker reading it)
# and pick3d (on* on 3D parts: hover, press, leave)
# and pick3d (on* on 3D parts: hover, press, leave); an <R3F>'s own pointer events and <OrbitControls> (r3f live/pointer);
# an app screen's button clicked through the 3D, its own timer on the frame's clock (appscreen: blitz-bevy H12)
sdk/react/bench/games/pong/edit.tsx keys:ArrowUp,ArrowDown,,ArrowUp 0.25 0.75 1.25 1.75
sdk/react/bench/games/platformer/edit.tsx keys:ArrowRight,ArrowRight+ArrowUp,ArrowRight, 0.25 0.75 1.25 1.75
sdk/react/bench/games/arena3d/edit.tsx keys:ArrowRight,ArrowUp,ArrowLeft+ArrowUp,ArrowDown, 0.25 0.75 1.25 1.75
@@ -21,3 +22,5 @@ sdk/raea/bench/bevy-ts/cases/live-window.tsx script:sdk/raea/bench/bevy-ts/cases
sdk/raea/bench/bevy-ts/cases/text3d-readback.tsx script:sdk/raea/bench/bevy-ts/cases/live-world.json 0.3 0.6
bench/bridge/engine3d.tsx - 0.3 0.9 1.25
sdk/raea/bench/bevy/pick3d/edit.tsx script:bench/render-play/pick3d.json 0.1 0.2 0.3 0.4 0.6 0.9
sdk/r3f/test/live/pointer.tsx script:sdk/r3f/test/live/pointer.json 0.2 0.4 0.6 0.9
sdk/raea/bench/bevy/appscreen/edit.tsx script:bench/render-play/appscreen.json 0.2 0.4 0.6 0.9
Can't render this file because it contains an unexpected character in line 5 and column 29.
+1
View File
@@ -7,6 +7,7 @@ publish = false
description = "A project as one world of facts in raea/ecs's form: its layers, text, parts, shots, clips and cues as entities with components, for any kind of piece"
[dependencies]
dunce = "1"
# a rule's taste form and controller field (rule.rs)
raea-core-brief = { path = "../brief" }
serde = { version = "1", features = ["derive"] }
+8 -5
View File
@@ -44,15 +44,17 @@ pub struct Entry {
pub despite: Vec<Despite>,
}
/// The nearest folder at or above `from` that holds `marker` (.raea/workspace, .raea/project).
/// The nearest folder at or above `from` that holds `marker` (.raea/workspace, .raea/project). Plain on Windows
/// (C:\..., through dunce): canonicalize() alone gives \\?\C:\..., a path Git for Windows can neither read nor lock, so
/// every id raea kept in git config read back empty and was never written (0.1.5, 0.1.6).
pub fn up(from: &Path, marker: &str) -> Option<PathBuf> {
let from = from.canonicalize().ok()?;
let from = dunce::canonicalize(from).ok()?;
from.ancestors().find(|d| d.join(marker).is_file()).map(Path::to_path_buf)
}
/// A path made absolute through its nearest folder that exists (an output may not be written yet).
fn real(p: &Path) -> PathBuf {
if let Ok(c) = p.canonicalize() {
if let Ok(c) = dunce::canonicalize(p) {
return c;
}
match (p.parent().filter(|d| !d.as_os_str().is_empty()), p.file_name()) {
@@ -61,10 +63,11 @@ fn real(p: &Path) -> PathBuf {
}
}
/// A path as the record names it: relative to the project when it's in it.
/// A path as the record names it: relative to the project when it's in it, with '/' between its parts on Windows too (a
/// project's record moves between machines, and `raea next` quotes it in commands).
pub fn rel(project: &Path, p: &Path) -> String {
let full = real(p);
full.strip_prefix(project).map(|r| r.display().to_string()).unwrap_or_else(|_| full.display().to_string())
full.strip_prefix(project).map(|r| r.to_string_lossy().replace(std::path::MAIN_SEPARATOR, "/")).unwrap_or_else(|_| full.display().to_string())
}
/// The project's commit, with "+" when `of` (a path from the project; "." for all of it) differs from it.
+2
View File
@@ -52,6 +52,8 @@ pub fn base_ident(it: &Item) -> &str {
"mesh" => it.shape.as_deref().unwrap_or_default(),
"model" | "panel" | "plate" | "splat" | "meshseq" => it.props.get("src").and_then(Value::as_str).unwrap_or(""),
"text" => it.props.get("text").and_then(Value::as_str).unwrap_or(""),
// a camera drawing into an image (R3F23a): by the image, so two passes into one image a frame are #0 and #1
"rendercam" => it.props.get("target").and_then(Value::as_str).unwrap_or(""),
_ => "",
}
}
+925
View File
@@ -0,0 +1,925 @@
Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated heads, creatures
Set by the user 2026-11-15, after deciding that people's bodies standardize on SOMA (docs/hands.feature, the
rule of that date): one session syncs the body, the motion system, the head work and the creature work, which
three sessions had been building apart. In the user's words, the job is to standardize the body on SOMA, Kimodo,
the head work and how creatures are managed and rigged in the character SDK; to make a whole system for
locomotion, motion matching, staging and AI controllers for NPCs if Kimodo is the standard; and, once that is
settled, a generative or procedural clothing system, perhaps with the mannequin as the base input and an image
model on top, layered.
The user, 11-16: the character SDK ships as raea 0.1.7, and 0.1.6 is a patch for the app. What of it is on main
before then ships in 0.1.6's binary unannounced, as 0.1.5's did.
This file is the map. The detail stays where it is: docs/hands.feature (arms and hands, the SOMA rule),
docs/creatures.feature (four legs), docs/drawn-characters.feature (a drawing as a character),
docs/character.md (the five layers and eleven principles of the rebuilt SDK, which still hold except principle
8's skeleton), docs/skeleton.feature (the game_engine rig: replaced by CH1). A scenario here that another file
already plans names it and does not repeat it.
The system on one page, as it stands 11-15 (each part names the scenarios that hold its detail):
Body. Every person is SOMA (NVlabs SOMA-X, Apache-2.0): one skeleton of 78 joints and 32 twist helpers the
engine sets, one body folder for a person or a creature (skeleton.json, body.glb, parts; CH2), builds from
SOMA's shape model. The bodies on the old game_engine rig only play until they are retired (CH1, CH1a).
Motion. At run time a body only plays clips, chosen by motion matching from a library on SOMA's skeleton, on the
user's own machine, so a render and live play give the same frames (CH10, CH14a). Clips come from captures first
(ACCAD and Quaternius, moved onto SOMA once) and from Kimodo where no capture exists, made when a project is
built, in the cloud: between two poses with no text today (CH15a: "turn and sit", "rise and walk off"), from a
line of text once its encoder's licence is granted (CH11). A generated clip is judged by the checks that judge
captures before it is kept (CH13). Locomotion is that matcher following a path, its stops landing on their marks.
Staging and NPCs. A performance is a list of acts: go, wait, look, face, sit, take (and put, throw, hand over and
use, which are takes with another spec) and do (a line of text). A script, a behaviour tree and a language model
all return those acts to `direct`, which asks a character's controller only when its acts run out, and the
matcher carries them out (CH16a). An act no clip plays is stood through and written down as a clip to make, and
the build turns that list into Kimodo clips (CH17a, CH15). Hands, eyes and contacts are laid over the matched
pose by the Rust takes and the look solver, each saying how far it moved the pose (CH18a).
Heads. The face session's head (GNM Head, Apache-2.0) is a Character part skinned to SOMA's neck, head and eye
joints with about fifty named expressions, ending on the collar ring of a body built without its head; hair is
cards skinned to Head with a stray distance per vertex; hats and glasses are rigid parts on Head (CH20a, CH21a).
Creatures. The raccoon session's flow (docs/creatures.feature): a creature is its own skeleton set down by measure
first, its model generated on a grey mannequin of that skeleton and weighted there, moved by a gait solver that
owns contact, carriage and the order of the legs, with anymove's generated clips for timing where it has them
(CH30 to CH32). The same body folder and the same clip format as a person; Kimodo is for people only.
Clothes. Pictures of the dressed mannequin measured onto SOMA's skin (CH40 to CH46) were built and rejected by
the user on the body. Garments are now sewing patterns cut to SOMA's measurements and draped by a cloth of our
own on the GPU (CH47a, CH48a), with a model trained on that data proposed (CH48). CH47 and CH48 are the user's
to decide.
Who holds what: this plan's session the body, motion, staging and clothes, and the syncing; the face session
heads and hair; the raccoon session creatures. A change to a joint name, a unit, an axis or a file's layout is
made here first (CH0).
Rule: The standard, and who builds to it
Scenario: CH0. One plan, four parts, one place they meet
# The parts and the sessions that hold them on 11-15: the body, motion and clothing (this plan's session);
# heads and hair (the face session: a fitted head model with expressions, from close-up photographs); the
# creature solver and its test animal (the raccoon session); anymove on that animal (this plan's session,
# validated by the raccoon session). Agreements between sessions are written here as scenarios, so a
# session that starts cold reads them.
Then every part delivers a folder a `<Character>` loads, in the format of CH2
And a change to a joint name, a unit, an axis or a file's layout is made here first, then built
Scenario: CH1. People are on SOMA's skeleton
# NVlabs/SOMA-X, Apache-2.0. 78 named joints (Root, Hips, Spine1-2, Chest, Neck1-2, Head, Jaw, two eyes,
# shoulders, arms, hands with five fingers, legs, toes) and 32 twist joints the engine sets (four along
# each upper arm, forearm, thigh and shin). SOMA's files are in centimetres; raea's are in metres, Y up,
# facing +Z. Replaces docs/skeleton.feature's game_engine rig and docs/character.md's principle 8.
Then no new work on people names a game_engine joint
And the readers of the old names (sdk/character, sdk/body, systems/body, systems/grab, their tools and
tests) are moved to SOMA's names as one refactor, not through an alias layer (as SK0b did before)
And the people built on the old rig are retired once a SOMA person renders in each scene that used one
@done
Scenario: CH1a. The old SDK names SOMA's joints
# 11-15. sdk/character's bones.ts `B` (the one place the SDK takes joint names from) gives SOMA's names:
# Hips, Spine1, Spine2, Chest, Neck1, Head, LeftShoulder, LeftArm, LeftForeArm, LeftHand, LeftLeg,
# LeftShin, LeftFoot, LeftToeBase, and a finger's phalanges 1 to 3 as SOMA's 2 to 4 (its 1 is the bone in
# the palm; the thumb's are 1 to 3). A body made on the old rig (turbo, teal, the PSX people) still loads:
# `joint` finds a SOMA name on it by its old one, the name helpers (side, mirror, finger) read both, and
# a BVH map keyed by old names still maps. That fallback is the only place the old names stay, and it goes
# with the last old body (CH1's last line). systems/body's `Skeleton::joint` reads a SOMA name on an old
# body the same way. A body named as CMU or Mixamo name theirs (LeftUpLeg, with LeftLeg the shin, which is
# SOMA's thigh) is refused with a message rather than read wrong; the gitignored local "kid" example is
# one. The conformance tests' stick body is on SOMA's names; 27 of the character test's 29 pass, the 2
# that fail failing the same way on the code before the change (a buckle on a planted knee, a dropped box).
Then the SDK names SOMA's joints, and the bodies on the old rig still play until they are retired
Scenario: CH2. A body folder is the same for a person and a creature
Given a folder with skeleton.json (name, rig, height, joints by name with parent and rest place, landmarks,
skin samples per joint), body.glb (skinned to those joints: one skin, or several closed pieces each
weighted to its own joints, as the raccoon's trunk and legs are), and optional head.glb, clothes and clips
Then `rig` says which skeleton the joints are: "soma" for people, the creature's own name for an animal
And helper joints (twist joints, a belly, ears, eye joints) are listed as helpers: the engine or a part's
own layer sets them, and no pose, clip or call has to name them
@done
Scenario: CH2a. Bodies, heads and creatures are read as one form and checked
# 11-15. sdk/body/src/folder.ts (private repo 47ddc16) reads a folder's skeleton.json, or a creature's
# <name>.rig.json (docs/creatures.feature CR1's form) as the same skeleton: `rig` the creature's name, each
# bone's tail its `ends` entry, the height its highest joint or mark, the eyes between its eye marks, and
# skin samples taken from its skinned mesh (samples.ts) since a rig carries none. Helpers not listed are
# found by name (SOMA's 32 twist joints, its eyes and jaw; a creature's ears, lids, belly and jaw).
# `bun sdk/body/src/folder.ts BODY [HEAD]` lists a folder's problems against CH2, CH20 and CH21. Run on
# the work as it stands: SOMA's headless body with the generated head, its four hair styles, glasses, cap
# and beanie has none (the head's collar ring lies exactly on the body's 80 ring vertices; hair and hats
# ride Head alone; each hair mesh carries a stray distance per vertex). The raccoon has none: its rig reads
# as the same skeleton, its 58 joints all skinned, 1,392 skin samples with the lowest on the ground.
# Left to the owners, as notes rather than faults: the head carries 20 expressions where CH20 asks about
# fifty; head.json names its body by an absolute path on one machine; the raccoon's body is raccoon.glb,
# not body.glb; SOMA's skeleton.json doesn't list its helpers (found by name).
Then a person's folder and a creature's are read by one reader, and a folder that breaks the form says how
Rule: Motion: one clip format, two ways to get clips, one way to play them
# The position this plan takes, confirmed by the user 11-15 ("clips at run time"): motion at run time is always chosen from clips on
# disk by motion matching, on the user's own machine, the same frame for a render and for live play. A model
# that generates motion (Kimodo for people, anymove for creatures) is a way to MAKE clips, run when a project
# is authored or built, in the cloud or on an NVIDIA card: Kimodo does not run on a Mac. So a game or a film
# never waits on a model, and a project keeps working with no network. The alternative, a model called
# while a scene plays, is not planned.
Scenario: CH10. One clip format, on the body's own skeleton
# The clip file the SDK already reads is the base (sdk/body/src/clip.ts `ClipFile`: the skeleton's name,
# the joints' names, and per clip its frame rate, the root's place as 32-bit floats and each joint's turn
# relative to its parent as 16-bit parts). It gains the rig's name, and per clip the contacts, tags and
# source below.
Then a clip is each joint's turn and the root's place per frame, at its own frame rate, with its contacts
(a list by joint name, each planted or not and where, so four legs or six fit as two do; hands and a
seat the same way), its situation tags, and where it came from (a capture and its licence; a model, its
prompt, seed and constraints; a procedure)
And a capture, a generated motion and a baked procedure are the same file, so the library, the matcher and
the checks read one thing
Scenario: CH11. Kimodo is a generation flow that writes clips
# Kimodo: code Apache-2.0, weights under NVIDIA's Open Model License (commercial use allowed, outputs not
# claimed). It needs an NVIDIA card and a gated text encoder, so it runs as a cloud step (docs/gen.feature)
# or on a user's own card. Its inputs, from the examples it ships: one line of text; several lines with
# durations; full-body keyframes; hand or foot targets; a path for the root; waypoints. Its output is 30
# joints' turns and places at 30 frames a second (which Kimodo widens to SOMA's 77 by name).
# Measured 11-15, with no text (constraints only; an empty prompt zeroes the text features, so a stand-in
# encoder of zeros is exact), Kimodo-SOMA-RP-v1 on its own SOMA examples, 100 denoising steps, on a Modal
# L40S or A10G: 4.3 s of GPU a 5 s clip, 7.2 s for 10 s, the model loading in 40 s; about 12 cents for the
# whole test with the image build. Misses at the constrained frames, raw and after Kimodo's own
# post-processing: full-body keyframes 3.2 cm mean (8.2 worst) and 0.5 (6.0); feet 1.0-1.5 and 0; hands
# 2.8-3.3 and 2.4-3.0 (6 worst); a root path 12 cm mean (26 worst) raw and 3.1 (4.0, its margin) after;
# foot slide on planted frames 0.06-0.26 cm a frame. So post-processing is always on. Text is not
# measured: the encoder's base (meta-llama/Meta-Llama-3-8B-Instruct) is gated behind a form that asks for
# the account holder's name, birth date, country and affiliation, which only Shane can fill in.
# Runner: ~/.cache/raea-kimodo/ours/kimodo_constraints.py (and kimodo_modal.py for text).
Given a line of text and any of: a start pose, an end pose, keyframes, a root path, hand or foot targets
Then `raea gen` returns a clip in CH10's format, with its provenance, checked by CH13 before it is kept
And the cost of a clip and the time it took are logged with it
Scenario: CH12. The library: captures first, generated where there is none
# docs/character.md's layer 2 and its 29 situations stand. Principle 1 stands too: a capture is the
# ceiling, so a situation that has a good capture keeps it (retargeted to SOMA once, offline).
Then each situation lists its clips, and a situation with no capture (the ones character.md asks for: turn
and sit, sit back, rise and walk off, pick from the floor, carry, set down) is filled by Kimodo
And all people share one library, since they share one skeleton; a body of other proportions plays it at
the same Froude number
Scenario: CH13. A generated clip earns its place
Then a clip enters the library only after the detectors that judge captures have judged it: joint limits,
self overlap, foot slide against its own contacts, pops, and its style vector beside the situation's
captures
And what fails is kept out and counted, so the pass rate of each source is a number
@done
Scenario: CH14a. The rebuilt body SDK, its library and its matcher run on SOMA
# 11-15. sdk/body (the rebuilt SDK of docs/character.md) names SOMA's joints: its roles keep the keys of
# its tables, its limits are re-measured over the library on SOMA (8,848 frames), and the elbow's fold
# axis is read from the captures, SOMA's rest elbow being nearly straight. The library's 60 clips (ACCAD,
# Quaternius) were moved from the old rig joint for joint (sdk/body/tools/resoma.ts: a joint's world turn
# after the turn that lays SOMA's rest bone on the source's, hands by their knuckles, the wrist's turn
# about the forearm given to the forearm, contacts carried). On it the matcher follows a path (stand,
# walk, turn, stand, walk back, stop): 449 frames over 10 clips with 20 switches, planted feet sliding
# 17 mm at worst (8 mm on the old rig's own suite), no joint past a limit, drawn on SOMA's body with the
# twist joints set (raea/character `withTwists`). 23 of the SDK's 27 tests pass; the four that don't are
# the hand layer (the cup grasp, hands in the lap, finger IK), which needs SOMA's fingers and a shell.
# Not moved yet: the old SDK (sdk/character: its matcher, items, ragdoll), the arms and hands in Rust
# (systems/grab's takes name the old joints), and the turbo suite's cases as checks.
Then a body on SOMA walks where a path says from the library's captures
Scenario: CH14. Locomotion is motion matching over that library
# Built on the old rig: sdk/body/src/loco (the chooser, the feature database, the matcher, inertialized
# switches, feet held by their contacts, the head steadied). This scenario is that code on SOMA.
# 11-15: the turbo suite's script (tools/motion-check.ts) is in no history, so its eight cases are rebuilt
# from docs/locomotion.md as sdk/body/tools/suite.ts, scoring what it scored with bars taken from the
# captures where it can (jolts against the captures' 99th percentile, a pop as hips' acceleration over
# their 99.9th, head roll against the captures' own at that gait; slide by feet.ts footSlide, the old
# suite's measure). First run on SOMA, 0 of 8 strictly: walking is good (slide 0.2 to 0.9 cm, arrive
# within 18 cm, follow within 25), the failures are hip pops at switches in jogs and runs (31 of 36 pops
# sit at a switch; the run curve also jolts 23 degrees against 22), slide in the jog curve, the turn of
# 180 and errands (4 to 9 cm), and the head rolling 18 to 20 degrees on curves against 13 to 16 in the
# captures. Moving the body at a switch onto the new clip's planted foot (align) is not the pops' cause:
# off, it takes away a few and the walk curve slides 15 cm. The cause: a switch blended the pose's turns
# and the hips' height but not the hips' speed over the floor, so a run handing to a run turn at another
# pace jumped it in a frame. Carried into the decaying offset (perform's carry, on unless no foot is down
# in both clips, where carrying it slid a run turn's foot 22 cm): pops 36 to 21, at switches 31 to 12,
# every other number unchanged.
Then a body goes where a path says, by the situations the chooser allows, with every switch inertialized
and every planted foot held
And the turbo suite's cases pass on a SOMA person at least as well as they do today
@done
Scenario: CH14b. The suite's eight cases pass on SOMA, and paths drawn at random are run beside them
# 11-15, sdk/body (the private repository, 58fed86 and 4b1781f): 8 of 8, from 0. What each failure was:
# Hip pops: tuning the matcher only moved the same few jumps from one path to another (the adjustment
# toward the path comes on as a foot lifts, a turn goes about another ankle, a switch changes pace), so
# the hips' path is evened afterwards to the captures' own largest change of speed in a frame, before the
# feet are held (perform.ts evenHips, hipLimit): no pop in any case, the path moved by millimetres.
# The run's curve: a straight run could not turn, so a curve of 7 m was two turn captures handed back and
# forth every 17 frames. A curve gentler than 0.2 radians a metre is now a straight clip steered about its
# planted ankle, and the matcher is asked for the path with that bend taken out.
# A run's corner: the guide went through a corner of 90 degrees at 3.6 m/s and the body ran half a metre
# past it. The guide now comes into a corner at the pace the turn captures take one (guide.ts cornerSpeed:
# 45 degrees at 3 m/s, 90 at 1.9), and a run slowing for it may come down through run to walk.
# The head on curves: a walk came to rest in the sway capture, filed as a way of standing, its head 19
# degrees over. Sway is its own situation.
# Slides: a foot in the air rode down with the hips when they came down for the other leg, and a stop's
# closing step came in 1 cm over the floor for 20 cm. It is lifted over where the lowered hips leave it,
# and its lift eased over as many frames as a hold (let down in three, the shin jolted 16 degrees).
# The suite itself: jolt bars per gait (the run captures' own foot strikes failed a bar set mostly by
# walks, in 8 to 10 per cent of their frames), slide measured on the performance's own floor.
# Beside the eight, `SWEEP=40 bun sdk/body/tools/suite.ts` draws 40 paths at random (one to three legs, a
# walk, a jog or a run, some with a wait): 45 of 48 pass, from 33 before the slide's cause was found. Left:
# three paths 34 to 39 cm off their line at a sharp turn (the bar is 30).
# Tried and taken back: the adjustment on a spring (20 to 30 cm wider at a run's corner), contacts taken
# from the playing captures, a sole's speed read with the adjustment's carrying taken off (both held feet
# the blend was still moving: slides of metres), a standing body held to the start captures (one path
# ended 4 m past its mark).
Then `bun sdk/body/tools/suite.ts` prints 8 of 8 on SOMA
And with SWEEP=40 at least 45 of the 48 paths pass
@done
Scenario: CH15a. Two situations the captures lack, made by Kimodo from two of their poses
# 11-15. sdk/body/tools/between.ts writes Kimodo's full-body keyframes from two library frames (the first at
# the origin facing +z, the second where and how the body must end); src/kimodo.ts crosses a pose both ways
# by its turns (a joint's world turn from bind is Kimodo's turn from the T-pose after the body's `tpose`;
# a library pose goes out and back with no measurable change). Kimodo runs with no text (the stand-in
# encoder, CH11). tools/fromkimodo.ts brings each motion onto the body, puts it back on the captures'
# elbow and knee hinges with the hands and feet where Kimodo put them (src/fix.ts `ontoRig`: Kimodo's elbows
# fold about an axis 25 degrees off the captures', which hold to within 3 to 7), and judges it against the
# captures it joins, measured on the same body by the same checks: no joint further past a limit and the
# body no deeper into itself. Of several seeds the best that passes is kept, with where it came from.
# "turn and sit" (stand, then seated on a chair 1.2 m ahead, turned round): 4 of 5 passed.
# "rise and walk off" (from the seat to a walking stride 1.6 m on): 2 of 5 passed, the others' hands
# 5 to 9 cm into the thigh as they push up (the walking captures it joins: 4.4 cm). 4 s of GPU a clip,
# about a cent. Both are in the library under src/library.ts's situations of those names, and play one
# after the other on SOMA's body (sheet3d compositions/soma_between.tsx, feed item i-acp-mwi1xhlw-59).
# Found on the way: contacts and capsules on a SOMA body were never read (the SOMA index was carried over
# from the old rig); a SOMA limb's skin is weighted to its twist joints, now counted as the limb's.
Then a situation without a capture gets a clip made from the captures' own poses, judged before it is kept
Scenario: CH15. Between two poses
Given where a body is and how it stands, and where it must be and how, with no clip that does it
Then at build a clip is asked of Kimodo with both poses as keyframes and the path between, checked (CH13),
and stored in the project, so the next build asks for nothing
And while a scene plays live and there is no such clip, the matcher's nearest is played and the gap is
written down as a clip to make, never papered over
@done
Scenario: CH15b. A line of text made into a clip between two standing poses
# 11-15, the first run of Kimodo's text path (the account's access to the gated Llama 3 model was granted that
# morning). Two standing poses from the captures as keyframes, in place, 4 s, and the line "A person waves at
# the camera with their right hand", three seeds: in each the right wrist is above its shoulder for 48 to 59 of
# 120 frames, reaching the head's height, while the left never leaves the hip, and the hips stay within 3 cm.
# All three pass the bar of the 19 captures that end standing (sdk/body/tools/fromkimodo.ts with a "do:"
# name); the kept one is written to the project's made clips (made.json, read by stage.ts `madeClips`). On
# Modal: 1.6 s a clip on the GPU after 130 s loading the model, and 26 minutes queued behind the workspace's
# other GPU jobs. Kimodo's code has nothing tied to NVIDIA (no custom kernels; its text encoder takes Apple's
# `mps` device), so the earlier line that it does not run on a Mac is untested, not true.
Then a stage `do` line gets a clip made from its words, checked, and kept in the project
Scenario: CH15c. Kimodo on the user's own machine, in MLX
# The user, 11-15: "lets plan that if kimodo works well we port it mlx weights or go find some". Gated on
# an eval first: about ten lines (wave, point, shrug, clap, nod, bow, look at a watch, cross the arms,
# scratch the head, stretch), each with a check of its own (which hand rises, where the head turns) and a look
# by the user. If they hold, Kimodo moves to MLX, the general backend on Apple silicon already in raea
# (raea-sys-mlx), in two halves. The text encoder (LLM2Vec: Llama 3 8B made bidirectional, with its
# trained adapters): MLX copies of Llama 3 8B Instruct exist (mlx-community, 4-bit about 4.5 GB), so the
# work is LLM2Vec's bidirectional mask and adapters merged onto them, checked against PyTorch's features
# for the same lines; a line's features are kept once made, so the encoder runs once a line. The motion
# model (a small diffusion transformer): its weights converted and run in MLX, checked against the PyTorch
# motion for the same line, constraints, seed and noise. Before anything ships to users: the licences of
# converted weights (NVIDIA's Open Model License for Kimodo, Meta's Llama 3 licence for the encoder).
# 11-16. Done in Rust, no Python: raea-sys-kimodo runs Kimodo-SOMA-RP-v1's denoiser and LLM2Vec on MLX from
# the checkpoints' own files (nothing converted: mlx-community's 8-bit Llama 3 8B Instruct, McGill-NLP's two
# adapters run beside it unmerged), and `raea motion "LINE" [--keys KEYS.json]` writes the clip fromkimodo.ts
# reads. Against PyTorch: the denoiser within 2e-3; a whole 100-step generation from the same noise and text
# within 0.002 cm on every joint; constraints become the same conditions. The stated tolerance is the 8-bit
# encoder's: cosine 0.99993 to float32, which moves the joints 0.01 to 0.74 cm on average and 1.44 cm at
# worst over eight lines (4-bit moved them 8 cm and is not used). A seed's noise is not torch's, so a seed is
# not the cloud's motion for that seed; measured by what it does, the local wave falls in the cloud's three
# (a hand above the shoulder 54 to 67 of 120 frames against 48 to 59, the hips within 3 cm). Cost: the
# motion model 1.1 GB and the encoder 8.8 GB once, then 5 s to load and read a new line (a line's numbers
# are kept, so a line is read once) and about 8 s a 4 s clip on an M5 Pro, against the cloud's 130 s
# loading. The eval (sdk/body tools/doeval.ts, each line's check measured on the joints; clips by
# tools/makedo.ts, three seeds a line between standing keys): every clip passes the bar of the captures that
# end standing; the seed kept is the one whose upper body moves most (a do line fails by standing through
# it: one seed of three stood still through "scratch the head"), and the kept ten all do what they say
# (seed 1 alone 7 of 10, seed 2 8, seed 3 7). Film: sheet3d out/do-eval-v1.mp4, posted for the user's look
# (i-show-mwj21c0d-1). The user's look, 11-16: "All ten read right". Open: the user's word on shipping the
# downloads (i-show-mwj24i8o-2: Kimodo under NVIDIA's
# Open Model License; Meta Llama 3 under its Community License, fetched from mlx-community's ungated 8-bit
# copy; the adapters MIT); Kimodo's own post-processing (its C++ foot-skate clean-up) is not ported.
Given the eval's lines pass
Then a do line's clip is made on a Mac with no GPU in the cloud, matching the cloud's within a stated
tolerance
And its cost is a one-off download and seconds a line
Scenario: CH16. Staging: a performance is a list of steps
# Built on the old rig: matching.ts `perform(lib, {at, facing, steps})` with walk, face, wait; course.ts;
# the take (docs/hands.feature). This is the one vocabulary for all of them.
Then a step is one of: go (a route, a gait, a style), face, wait, take, put, throw, hand over, sit, rise,
use (a thing's own path), look at, and do (a line of text: a gesture or an act with no step of its own)
And `do` is made into a clip by CH11 when the project is built, and from then on is a clip like any other
And the whole performance is a function of its steps: any frame can be asked for, and a render and live
play agree
Scenario: CH17. NPC controllers speak in the same steps
Then a controller is a function from what a character knows (where things and others are, what it holds,
what it wants) to its next steps, asked a few times a second, never per frame
And a scripted controller, a behaviour tree and a language model all return CH16's steps, so the motion
under them is the same and a controller can be swapped without touching motion
And a controller may ask for a step the library cannot play; the character does the nearest it can, and the
ask is logged for CH15
@done
Scenario: CH17a. An act no clip plays is done as near as can be and written down as a clip to make
# 11-15. sdk/body's stage gained `do` (a line of text). With a clip made for the line (`direct`'s `made`,
# keyed by the line in lower case with single spaces) it plays as the sitting captures do, carried on from
# where the body stands; without one the character stands for the act's seconds and the line goes on its
# `asks`; `toMake` gathers a cast's asks, once each, most asked first: the build step's list for Kimodo
# (CH11, CH15). A language model's act outside the vocabulary ({"wave": "ben"}, a bare "shrug") becomes a do
# line instead of being dropped, so what a controller wanted and could not get is counted; a known act with
# wrong values ({"wait": -1}) is still dropped. Tested with two characters asking for one line spelled two
# ways (listed once, asked twice) and with the library's sitting down standing in for a made clip (played,
# no frame jump past 6 cm); the body SDK's suite is 37 of 39, the 2 failing being the hand layer's cup grasp
# as before (private repo ee61dd1). The made clips themselves wait on Kimodo's text encoder: the user has
# sent Meta's licence form; the account still reads 403 while it is reviewed.
Then a controller can ask for anything, the character does the nearest it can, and the ask becomes a clip to
make
@done
Scenario: CH16a. Acts, and controllers that return them, carried out by the matcher on SOMA
# 11-15. sdk/body's stage module: an act is go (to a point or through several, at a gait), wait, or look
# (at a point, a named character, or nothing). `direct` plays a cast for some seconds: each character's
# controller is asked when its acts run out (and at the start), told where it and every other character
# is and the time; go and wait become the matcher's steps, look is laid on the pose by the look solver.
# Controllers so far: `script` (a fixed list), `keepNear` (stay within a reach of another character,
# looking at it), and `actsFrom`, which reads acts from outside data (a language model's JSON) and keeps
# only those in the vocabulary. Shown with two SOMA bodies: one follows a script, the other's controller
# was asked 16 times in 26 seconds and kept him near her. The same cast and seconds give the same frames.
# Added the same day: face (a step toward a point or a character) and sit (the library's captures of
# sitting down, sitting and rising, played from where the body stands and eased at each join; the scene
# is told where to put the seat). Found while adding sit: the matcher set the body back inside its
# guide's reach at once, and a stop that overshot on SOMA moved the hips 19 cm in one frame; the return
# is now limited a frame, and the worst hip step in the scene is a walking pace's (4.8 cm). 31 of the
# body SDK's 35 tests pass, the four left being the hand layer.
# Then take: the act reserves a stretch of standing and says which frame it starts at; the scene applies
# the engine's take (raea/character `take`: reach, grab, carry, put down or throw, a hand-over, a thing's
# own path) over the staged pose, so put, throw, hand over and use are the same act with another spec.
# Shown: a controller walks a character to a table and, once she stands there, has her move a cup along
# it; she walks off after. Faults seen: she stops 25 cm past her mark, into the table's edge (the stop's
# overshoot again); and the other character stood with raised arms, which was two turning captures
# whose actor holds his hands up throughout: dropped from locomotion.
# The stop's overshoot was then measured and dealt with in the matcher: over six paths a walk came to
# rest 20 to 37 cm past its mark along its way (26 on average), whatever the path. Nothing may drag a
# standing body back, so the walk is played again (up to four times) with each stop's mark set back by
# what the last playing overran, and the playing whose worst stop is nearest its mark is kept: 6 cm on
# average, 14 at worst, the planted feet's slide unchanged (7 mm). She now stands at her mark by the
# table. The cost: a staged character is performed several times over, seconds for a scene.
# Not in the vocabulary yet: do (a line of text made into a clip, which waits on CH11). A controller's unmet ask is not logged
# yet (CH15).
Then a script and a controller give acts in one vocabulary and the matcher carries them out
@done
Scenario: CH18a. The takes run on a SOMA body
# 11-15. The Rust arms and hands (docs/hands.feature) find a joint by its role on either rig, so reach,
# grab, carry and throw run on SOMA with no second copy. The audit's six takes on SOMA's skin: holds
# within 2 to 8 mm and no body skin in a carried thing, as on the old rig; the fingers are not tuned to
# SOMA's hand (hand skin 22 mm into a box, no pads on a cup, 41 to 47 mm into the table as a hand leaves).
# The joint limits have a SOMA table (the body SDK's, measured over the library on SOMA). The fingers'
# rest curl is close to the old rig's (the thumb's first bone lies 31 degrees off the hand against 69),
# so the misses were not a matter of rest pose. Found: the finger curl placed a knuckle from its parent
# joint, which on the old rig is the wrist and on SOMA is a bone in the palm, so each finger was worked
# out 8 cm from where it is. Placed from the hand's joint: finger pads on a cup go from none to 6, hand
# skin in a box from 22 to 17 mm (the old rig's own numbers unchanged). Six takes are drawn on SOMA's
# body (a box thrown, a cup moved, a mug drunk from, a cup passed between hands, a box at 14 kg). Left:
# the middle finger and thumb tip 15 to 17 mm into a box, and hands 41 to 47 mm into the table as they
# leave.
Then a take runs on SOMA, its fingers still to be fitted to SOMA's hand
Scenario: CH18. What a clip cannot know is added on top, and measured
# docs/hands.feature (reach, grab, carry, throw, look), feet and seat contacts (character.md layer 4).
Then hands, eyes and contacts are laid over the matched pose by IK, each reporting how far it moved the pose
And a large correction is reported as a missing clip (principle 2), which CH15 can then make
Rule: Heads
Scenario: CH20. The generated head joins the body at the collar
# Agreed between the body and face sessions 11-15, reported to the user by the face session. The face
# side fits a head model (Apache-2.0) to close-up photographs: identity, expressions, eyes, skin texture.
Given head.glb skinned to SOMA's Neck1, Neck2 and Head, with SOMA's eye joints, and its expressions as
about fifty named morph targets, and head.json (its collar ring, eye centres, morph names, neck colour,
and the size it was fitted at, so the body's build scales the head to the body)
Then the body's own head is cut away from the collar up when the body is built, and the neck is one mesh
And the body's motion drives the neck and head; the face layer adds expression and the eyes on top; the
eyes take a look target in the world and cover what the head has not turned
And the face's skin colour is carried onto the body's skin at the seam
And `<Character>` passes the face's weights to the head's morph targets by name (its `morphs` prop does this
for a body's own morphs today) and takes a look target
@done
Scenario: CH20a. The first generated head rides SOMA's body
# 11-15. The body is built without its head (cut level through mid-neck at 1.515 m; its open edge written
# as a ring of its own 80 vertices with their normals and weights); the face session's head ends on that
# ring with those weights, so the neck is closed with no weld at run time. A Character part may name the
# body's joints it has (`joints`), since the engine refuses a part that lacks a joint it is handed. The
# head rides the matcher's walk, its expressions driven by name, glasses on as a one-joint part. Left: the
# body is one flat colour against the head's baked skin (a step shows at the seam), the eyes' look target,
# and the head's ears, which the face session is rebuilding.
Then a generated head is drawn on SOMA's body as a part, joined at the collar
@done
Scenario: CH20b. The body's skin is graded to the head at the collar
# 11-15. Measured first (sheet3d compositions/seam_check.tsx: the headless body at rest with the head as a
# part, lit evenly, seen close from the front, both sides and the back, the collar on the middle row): the
# body, built in the head's neck colour, stood 8 levels of 255 lighter than the head's skin across the
# collar at the front, 1 to 3 at the sides and back, and the line showed. `raea clothes wear ... --head
# HEAD_DIR` (engine/cli/src/grade.ts) now writes the join into the body it dresses: the skin takes the
# head's neck colour, and each vertex under the collar takes the colour the head's own skin has above it
# (head.json's ring colours, evened over five round the ring: one texel a vertex drew streaks), easing into
# the neck colour 8 cm down, as vertex colours on body.glb. The step at the front is under 1 level, 1 to 4
# round the rest. Left: the head's own strip above the collar repeats one texel a column (its ring takes
# its nearest rim vertex's place in the picture), the neck's outline stops flaring for 2 cm above the
# collar, and the body's skin has none of the head's fine detail.
Given a headless body and the head joined to its collar
Then the body dressed with that head named has its skin in the head's neck colour, graded to the head's
own skin at the collar, and no step of colour shows across the join
@done
Scenario: CH20c. The eyes take a look target
# 11-15. `<Character gaze={[x, y, z]}>` (sdk/character/src/character/eyes.ts): each eye joint is turned to
# the point on top of the pose, in its head's frame, so the eyes cover what the head has not turned; no
# further than an eye goes (35 degrees to a side, 25 down, 17 up: the head's upper lid has no morph that
# lifts it, and at 25 up the iris went under it). A part that has the eye joints has its upper lids ride
# the eyes down (its blink morphs raised to 0.45 at the lowest): without that the white showed over the
# iris. Seen on the first head, straight, to each side, up and down (sheet3d compositions/gaze_check.tsx).
# Not yet: lids that lift, and a stage act's `look` sending the eyes as well as the head.
Given a body whose head has eye joints, and a point in the scene
Then the eyes turn to it within their range, whatever the neck and head are doing
And the upper lids come down with them
Scenario: CH21. Hair
# Agreed with the face session 11-15. sdk/body/src/cloth.ts already moves hair and clothes that follow
# skin. Hair cards are the face session's working choice, pending its tests; strand hair stays a reference
# for offline renders. Open: whether spring chains under Head (helper joints) drive the cards instead.
Then hair is a card mesh delivered with the head, attached to SOMA's Head, each vertex carrying how far it
may stray (0 at the scalp), moved by the same follower as clothes
And hats and glasses are rigid pieces on Head, delivered with the head
@done
Scenario: CH21a. Hair cards ride the head, and a whole person stands on the standard
# 11-15. The face session's hair (cards grown from its strand grooms, one mesh skinned to Head, a stray
# distance per vertex in a custom attribute, four styles) is drawn as a Character part beside the head
# and the glasses. With it a whole person is on the standard for the first time: SOMA's body, the
# generated head joined at the neck, hair and glasses, generated clothes in two layers, walking by motion
# matching. Not yet: the hair moving (the follower does not read the stray attribute from a part), and
# raea's own hair shading on it (that shader wants tangents the cards do not carry, so it is drawn with
# its own material). Both since: CH21b.
Then a person is a body folder and parts, each made by its own flow
@done
Scenario: CH21b. Generated hair moves on the follower
# 11-15. `bun sdk/body/tools/hair.ts SKELETON.json HAIR.glb POSES.json OUT.bind.rseq SKIN.glb...` reads a
# head's hair cards as cloth (each vertex free by its stray attribute), carries them through a
# performance on the cloth follower, kept outside the skin as drawn (the head, the body, what it wears),
# and writes the frames in the hair's own bind pose; a Character part draws them with
# `cloth: { src, frame }`, so the hair keeps its cut-out and raea's hair shader (the cards carry tangents
# now). Measured on the first head's loose hair (33,191 particles, three quarters free) over SOMA's 449
# frame locomotion clip, as free particles more than 3 mm inside the skin, the worst of every tenth
# frame: 3,874 carried by the head alone, 223 on the follower; the hair leaves its skinned place by 13 mm
# on average. Three causes found on the way. The hair is generated for the head alone and hung straight
# through the upper back (4,982 particles in the skin at rest): it is laid over the body at rest first.
# Brought out one particle at a time, each lock was kinked at every vertex and drew as zigzags over the
# shoulders: what the fit moves is evened along each lock. And the follower starts as the skin has it,
# in the shoulders of the first pose: the first pose is held for 20 frames first. Left: a few locks
# stretch down an arm (a particle strays 15 cm at most, its limit 6), the bake runs at 0.36 s a frame, and
# the frames are baked for one performance, not followed live in play.
Given a head's hair cards, a body with what it wears, and a performance
Then the hair is carried by the follower through it, outside the head, the body and the clothes
And it is drawn as a part of the character with raea's hair shader
Rule: Creatures
# The creature flow is the raccoon session's, end to end, in docs/creatures.feature (its sandbox is the
# trashpanda project; done when it works on the raccoon and a second, more complex creature). These three
# scenarios say only where it meets the rest. Kimodo is no part of it: its models are for human skeletons
# only (SOMA, a humanoid robot, SMPL-X).
Scenario: CH30. A creature is its own skeleton, set down first
# A creature's joints are placed by measure before its model is made, and its folder is CH2's with its
# own rig name. Its model may be built, or generated the way the raccoon's now is: a grey mannequin of
# the skeleton, an image model drawing the animal on it with the pose and view kept, that image made 3D,
# and the mesh laid back on the skeleton and weighted there.
Then a creature's rig is read from its joints (CR1), and its helper joints are named as helpers
Scenario: CH31. A creature moves by its solver, and by clips where it has them
# The solver (gait by speed, planted feet, one rigging for every move: CR2 to CR9) needs no clips. Clips
# for a creature come from anymove (patch-gg/anymove, Apache-2.0): a generated two-camera video of the
# rigged creature, read by a joint reader trained on that creature, fitted to its rig. Like Kimodo it is a
# cloud step that writes clips, and it films a creature on a flat floor only.
Then a creature's clip is CH10's format on its own joints, checked as CH13 checks a person's
And where a creature has clips for a situation the matcher plays them, and the solver holds its feet; where
it has none, the solver makes the move
Scenario: CH32. anymove tried on the raccoon
# 11-15, run end to end; not yet a pass. The raccoon's skin (no fur shells) and 36 bones on its own joints
# were set up as an anymove creature in Blender on a Mac (its renderer made to use Metal there); the pose
# dataset (2,200) and the joint reader were made on a cloud card in 35 minutes (held-out error 6.9 px
# front, 4.8 side, anymove's wolf being 6.9 and 3.8); two five-second walk clips from the video model
# both kept the split screen and the limb colours; each was read and fitted in 5.5 minutes and exported
# as a GLB. By anymove's own measure, how well the paws' heights agree between the two views, the clips
# score 0.23 and 0.56: under 0.5 is a reroll, 0.8 is a keep, so none of 2 passes and one is worth a look
# (anymove reports about 7 clips for a usable move). Cost so far about 2.10 dollars: 0.52 for the clips,
# the rest cloud time estimated from minutes. Measured against the raccoon traced from real footage (the
# raccoon session's check, nine measures): the first two clips were smooth with good foot timing but
# were a generic four-legged walk, the head and tail level with the back and the legs in diagonal pairs.
# Two more clips, the prompt naming a low head, an arched back, a hanging tail and a pacing walk (0.77
# dollars more with their captures): the carriage came into a raccoon's range (top of the head 0.74 of
# the back's height, nose 0.32, withers 0.82) and the better clip has 7 of 9 measures in range; still
# off in all four are the order of the legs (a fore foot 0.36 of a stride after its side's hind, a
# raccoon's being 0.14) and the tail's tip (0.27 against 0.18). The views' agreement stayed under the
# keep line (0.42 and 0.53), the far hind paw the weak one in all four clips. So far: a prompt sets
# carriage, not the order of the legs; clips give timing and smoothness; CH31's split (clips for motion,
# the solver for contact and carriage) stands. The solver's own order was wrong too, found the same day: it
# read each leg's offset with the wrong sign, so a fore foot came down 0.26 of a stride BEFORE its hind.
# Fixed in the creature solver (private sdk/body, d89244e, with a footfall test that fails on the old sign),
# a fore foot lands 0.10 after its hind and the hinds 0.50 apart, as a raccoon's do; the same change keeps
# every planted foot inside its leg's reach (setting off after standing had left one 59 mm short on the
# raccoon, 81 on a dragon). So on the order of the legs the solver now beats anymove's clips. To come: the generated raccoon's skin and refitted joints
# in place of the built one, and why the fore paws carry no agreement score.
Then the raccoon has a walk from anymove, and the numbers say whether it beats the solver's walk
Rule: Clothes: first drawn on the mannequin by an image model (rejected), now sewing patterns (proposed)
# Superseded the same day: the user saw these garments on the body and rejected them ("on the body it looks
# terrible"; the views "are not consistent at all"). CH47a and CH48a below are the direction now; CH40-CH46
# stay as the record of what the picture method could and could not do.
# The user's direction, 11-15: generative or procedural; perhaps the mannequin as the base input, an image
# model on top of it, and layers from there. Tried that day on SOMA's body, and it works; what follows is
# the standard those tests point to. The idea in one line: a garment is not a mesh of its own, it is data
# on the body's own vertices (which are covered, how far the cloth stands off, its colour, how freely it
# may swing), so it carries the body's skinning, twist joints included, and fits every SOMA person without
# being refitted; only cloth that hangs free of the body (a skirt, a coat's tails, a hood) is its own mesh.
@done
Scenario: CH40a. A picture of the dressed mannequin lies on the mannequin pixel for pixel, one view at a time
# 11-15, with an image model that edits a given picture (flux_2_pro through `raea gen image --image`, 5
# cents a picture). The mannequin: SOMA's body at rest, flat dark grey on mid grey, no perspective, 2 m
# of height in a square frame, from the front, the back and each side (tools/soma_mannequin.py in the
# test project writes the pictures and their cameras). Measured by laying each result over its mannequin:
# one view, asked to change only the surface where clothing covers it: every limb, the head, the hands
# and the feet stay where they were, front, back and both sides alike, and the clothes sit outside the
# body's outline. Four views on one sheet in one call: the model lays the sheet out again (two fronts,
# one side), so nothing can be laid back. A view given a second picture as the outfit to copy: it draws
# a front again, smaller. A layer added to a dressed view ("add exactly one garment and keep everything
# else": a jacket over the t-shirt): pose and place hold and the rest is kept. Between views drawn apart
# the cut and the kind of garment agree from the words alone; the colour drifts (the jeans' wash).
Then each view of a garment is drawn on its own mannequin, a layer at a time, and views agree by their words
@done
Scenario: CH40b. Those pictures become an outfit on SOMA's own vertices, worn through a walk
# 11-15, first cut (tools/soma_clothes.py in the test project). Each vertex of the body's skin is looked
# up in the views that face it and see it (a ray to the camera meets nothing of the body): where the
# picture shows cloth and not the mannequin's grey it is clothed and takes the cloth's colour; the mask
# is tidied on the mesh (a bare vertex ringed by cloth is cloth, a small island is not); the clothed
# skin, pushed 4 mm out, is the outfit, with the body's own weights. A t-shirt, jeans and shoes made
# this way are worn by SOMA's body through the matcher's walk as a Character part (6,519 of 19,830
# vertices). What the first cut lacks: the cloth is skin-tight (no silhouette is measured yet), the tops
# of the shoulders and the soles are seen by no view, the colour is per vertex (soft), hems are jagged
# along the body's own edges, toes show through shoes, and the views' colours are not matched.
Then a drawn outfit is worn by a SOMA body in motion with no rigging step
@done
Scenario: CH41a. The cloth's stand-off read at the outlines
# 11-15. Where a view sees a clothed vertex on the body's outline (its normal across the view), the
# picture is walked outward along the normal until the cloth ends and the backdrop begins: that distance
# is how far the cloth stands off there. Read at 3,585 outline vertices of the t-shirt, jeans and shoes
# (2 mm at the tenth of them, 4 at the middle, 16 at three quarters, 35 at nine tenths), spread over each
# garment through the mesh, never under 4 mm nor over 8 cm. The jeans now hang as trousers and the shirt
# stands off the trunk. Wrong still: the shoes are lumpy (the toes' own shape reads as outline), the tops
# of the shoulders are bare, and a reading is one distance per vertex, so a fold is not a fold.
Then a garment's looseness comes from its picture
Scenario: CH41. A garment's shape is measured, not assumed
Given each layer's views and the views of the layer under it
Then how far the cloth stands off the skin is read where the two outlines differ in each view (a sleeve's
width against the arm's, a trouser leg's against the leg's), and spread round each limb between the
views that see it, so a loose fit is loose
And a view from above and one from below are drawn too, so shoulders and soles are covered
And a garment's edge (a hem, a cuff, a collar) is cut where the picture puts it, not along the body's faces
@done
Scenario: CH42a. A garment file on SOMA's template vertices, worn with the skin under it left out
# 11-15 (tools/soma_clothes.py in the test project: `measure` and `wear`). A garment is a JSON file: its
# name and layer, the template vertices it covers (by SOMA's own numbering of its 18,056, found from
# the body's vertices by their rest places), each one's stand-off, colour and how far it may stray, and
# the pictures it came from. `wear` builds each garment's mesh from the file on a body (the covered skin
# pushed out by the stand-off, the body's own weights) and writes the body with the skin that is wholly
# under cloth left out (13,368 of 26,116 faces under a t-shirt, jeans, shoes and a jacket). Not yet: a
# texture in the body's UVs (colour is per vertex), and a second SOMA shape to prove the fit carries.
Then a garment is a file of numbers on SOMA's vertices, and a dressed body draws no skin under its clothes
@done
Scenario: CH43a. A second layer over the first
# 11-15. A bomber jacket drawn over the t-shirt view by view ("add exactly one garment and keep
# everything else"). It is the vertices where its picture differs from the picture of the layer under
# it, and it stands off at least that layer's distance plus 3 mm (measured: 20 mm at the tenth of its
# vertices, 42 at the middle, 73 at nine tenths), so the layers do not cross. Learnt: an added layer on
# the back view came out as the garment's front (a zip and an open front) until the words said what is
# seen from behind; and a dark garment over the dark mannequin needs a small difference to count.
Then a jacket is worn over a shirt, each its own garment file
@done
Scenario: CH42b. The same garment files on a body of another build
# 11-15. The body's build takes SOMA's own shape model (SOMA_neutral.npz: a component by so many of its
# standard deviations); a second body moved along three components (up to 11 cm at a vertex, slimmer and
# longer in the neck) wears the t-shirt, jeans, shoes and jacket measured on the template body, from the
# same files, with nothing refitted, through the same matched walk beside the first. A shaped body's
# vertices are matched to the template's numbers through its template-shaped twin (same export, same
# order). Not done: the joints stay where the template has them (SOMA's own layer moves them with the
# shape), so only small changes of build are right; and this is HG17's start, not its end.
Then a garment made once dresses SOMA bodies of different builds
@done
Scenario: CH42c. A garment's colour is a picture in the body's own UVs
# 11-15. `wear` bakes each garment's colour as a 2048 px picture in the body's first UV set (spread to
# fill it): every texel of a covered triangle is a point of the body, looked up in the view that faces
# its triangle most among the views that see all three corners. The jeans now show their fly, pockets
# and wash and the jacket its zip and ribbing, where a colour per vertex gave a blur. Also: a small bare
# patch walled in by cloth is counted as cloth, which closed the t-shirt's shoulder tops (the jacket's
# still gape: their gap runs into the collar). Seen now that the detail is there: the views' colours
# differ (the back of the jeans is paler than the front), so a seam shows where one view hands over to
# the next; matching them garment by garment is not done.
# Looked into after: the skin still seen at the shoulders is not a hole in the jacket. Both garment files
# cover the shoulder tops; what shows is the slope between neck and shoulder, which the t-shirt's
# neckline leaves bare (read too wide: that skin faces up, and the level views see it at a glance).
# An upward-facing vertex among mostly covered skin is now counted as covered, which did not reach it.
# Tried and taken back: matching the views' colours by the front's main colours (pale denim on the back
# was taken for the shirt's white), and counting any changed pixel of a layer as its cloth (the jacket
# then covered the hands).
Then a garment carries its own picture, and its detail is the drawing's
Scenario: CH42. A garment is kept as data on SOMA's topology
Then a garment file holds, per body vertex it covers: that it is covered, its stand-off, and how far it
may stray (for the cloth follower); and a texture in the body's own UVs, baked from the views with the
views' colours matched to the front's garment by garment
And the same file dresses every SOMA person (the shape model moves the vertices, the garment rides them)
And a body's skin under a garment is not drawn, so nothing pokes through
Scenario: CH43. Layers
# The raccoon session's finding holds here too: an image edit keeps the outline it is given, so a layer
# can be added and never taken away. Outfits are built up from the bare body.
Then an outfit is an ordered list of garments, each drawn over the ones under it, each one's stand-off at
least the one under it plus its own thickness, so layers never cross
And a garment drawn alone on the bare mannequin can be worn under or over others by re-measuring its
stand-off against what is under it
@done
Scenario: CH44a. A skirt hangs from the waist and moves through a walk
# 11-15, first cut (sdk/body/tools/skirt.ts). The skirt is made for the body by measure: a tube of 56 by
# 22 particles from an ellipse round the waist's skin samples down to a hem, wider as it falls, its top
# two rings pinned to the hips and each ring below free to stray further. The cloth follower already
# built carries it through the matched walk with the legs as capsules sized from the body's own skin
# samples, and it is drawn as a mesh sequence over the walking body. Measured: edges stretched 19 per
# cent at the 99th percentile. Two faults mended the same day: the seat came through the back (each ring
# is now at least as wide as the body at its height down to the crotch, and the pelvis has a collider),
# and it rode up and shortened by the end of the walk (less room to stray: 27 cm at most, was 39). Wrong
# still: the thighs show through the front at the longest stride (sizing the rings to the thighs and
# more room to stray were tried and taken back: the cloth bunched), and it sits on the hips, not the waist. Not yet: grown from a garment's edge or drawn from a picture's
# outline (it is a plain tube), a hood or a coat's tails, and its colour from a garment file.
Then cloth hangs free of the body and moves with it
Scenario: CH44. Cloth that hangs free
Then a skirt, a coat's tails, a hood, a scarf are meshes of their own, grown from the garment's edge on the
body down to the outline the views show, weighted from the body at the edge and free below it
And they move by the cloth follower already built (sdk/body/src/cloth.ts: each vertex strays from its
skinned place by its own distance, with no collision shapes)
@done
Scenario: CH45a. One command from words to a garment
# 11-15 (tools/wardrobe.sh NAME "what it is" [UNDER] in the test project). It writes each view's prompt
# (what is seen from that side, what to keep), asks for the four pictures at once, says what they cost,
# and measures the garment; with UNDER it adds a layer over a garment already made. Run once on a new
# outfit (a red hoodie, black joggers, black shoes): 20 cents and 36 seconds to the garment file, then
# worn through the walk. Learnt: black cloth reads as the mannequin unless the mannequin's grey is told
# apart from black; the hood was drawn up though asked down. It is a script in the test project, not
# yet a `raea` verb, and it makes no garment by hand or by procedure.
Then a line of words becomes a garment file with its cost said
@done
Scenario: CH45b. `raea clothes`: garments from words, by procedure, and worn
# 11-15. A shell verb (engine/cli/src/clothes.ts reads the words, wardrobe.ts does the work on the native raea;
# the Blender scripts are tools/clothes, shipped with a release). The first use fetches SOMA-X's two body files
# at a fixed commit, checked by SHA-256, into raea's models folder (soma/, with the Apache-2.0 licence), and makes
# SOMA's body folder and the mannequin's four views there once (18 s on this Mac). `make NAME "words" [--over
# A,B]` draws the four views at once (flux_2_pro, one picture a view) and measures them onto SOMA's template
# vertices: assets/clothes/NAME.json, its pictures kept in assets/clothes/NAME/views as its source. Over a
# garment made by procedure, or several at once, the mannequin is first drawn wearing them, and the layers beneath
# are taken as one for the stand-off. `cover NAME --parts chest,torso,waist,upperArm:0.45 --colour #e8e4da` makes
# one by procedure in the same file with no picture: the skin of the parts named (a limb as far along as its
# share), with a one-ring hem allowance so garments on neighbouring parts overlap. `wear OUT_DIR A B C [--body
# DIR]` writes a body folder (each garment's glb and picture, the body without the skin wholly under cloth, its
# skeleton, joint stand-in and collar) and prints the composition's lines. `remeasure NAME` measures a garment
# again from its kept pictures, for nothing. Run on an outfit: a t-shirt and shorts by procedure, a flannel
# overshirt drawn over them for 20 cents in 35 seconds, all three worn on the headless body with the generated
# head through the matched walk (sheet3d compositions/soma_wardrobe.tsx). Mended in the measuring on the way: each
# garment's open edge is evened (it ran in a stair along the body's triangles; the body's own UV seams are left
# where they are); a garment stands off each part no further than that part allows (a loose sleeve drawn hanging
# below the arm had made a balloon of it); the top of a shoulder, and the slope by an open collar, is cloth when
# there is cloth in front of it and behind it; a texel that the chosen view shows as backdrop or bare mannequin
# takes the garment's measured colour (grey cuffs). Wrong still: the overshirt hangs to the hips in every
# picture but wraps the hips when worn (a skin-offset garment can't hang free: CH44), the views disagree on
# sleeve length (the back drew it to the elbow), and a sliver by the collar is still open. The verb makes one
# garment a call; an outfit is several calls, innermost first.
Then a garment is made by one command from words or by procedure, and an outfit is worn by one more
@done
Scenario: CH45c. `raea clothes make` sews; the picture-measured garments are gone
# 11-15 night. `raea clothes make NAME ["WORDS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB]` makes a
# sewn garment (CH47a's patterns, CH48c's model) in the project: assets/clothes/NAME.json (kind "sewn") and
# assets/clothes/NAME/ (the glb, the design, the flat pattern, four pictures). The design is the garment
# model's from the words, or GarmentCode's plain base with --plain or no words; each --set changes one of its
# 122 settings by path, checked against its options or range (a wrong one says what is allowed);
# `raea clothes settings` lists them. The first use sets up raea's models folder (garments/): GarmentCode
# cloned at a fixed commit and checked by it, a Python 3.11 environment made by uv from a pinned list, SOMA's
# body as a distance grid. `wear` takes sewn garments beside ones laid on the skin: each sewn glb is copied
# and the skin under it left out (tools/garments/hide_under.py). Measured before building: the model alone
# is not enough ("a short-sleeved t-shirt" came out an open flared tunic with ruffled cuffs, "straight
# trousers" knee-length culottes, colours by chance), so the settings are the control and the words a first
# guess. A tee and trousers by settings, 18 and 28 seconds, $0, worn with the generated head and walked
# (sheet3d compositions/soma_sewn.tsx): they read as clothes, with a cut, a hem and folds. Taken out: `make`
# by four drawn pictures measured onto the skin, `remeasure`, the mannequin's views (wardrobe.ts's drawing,
# tools/clothes/garment.py's measure, mannequin.py); a garment measured that way is refused by `wear` with
# what to do instead. `cover` stays for what is skin-tight. Wrong still: an outer garment is draped on the
# bare body (the trousers' waistband shows through the tee's hem); trousers at length 0.9 drag on the
# floor; a sewn garment is skinned in motion, not simulated (CH44); the words model is not fetched by a
# release yet (only this machine's models folder has one).
Then a garment is sewn by one command from words or from settings, for nothing, and worn by one more
And no garment is measured from pictures any more
Scenario: CH45. From words to a wardrobe
Then `raea` takes a description of an outfit, draws its layers and views, builds the garments, and writes
them beside the body, saying what each picture cost; the pictures are kept with the garment as its source
And a garment can also be made by hand or by procedure in the same file format, with no picture at all
@done
Scenario: CH46a. A dressed body measured through a walk
# 11-15, first cut (tools/clothes_check.py in the test project; skins the body and each garment as the
# engine does, twist joints included, every 15th frame of a performance). Per garment: how deep its cloth
# goes under the skin, how deep under the layer beneath, and how far its edges stretch from rest, with
# the joints that carry the stretched edges. On the two-layer outfit through the matched walk: the
# t-shirt, jeans and shoes 17 mm under the skin at worst, 1.7 per cent of edges over 1.5 of their rest
# length (at the armpits, the crotch and the feet); the jacket 40 mm under the skin and 29 mm under the
# shirt at worst, 6 per cent of edges over 1.5 (the chest, the forearms, the armpits). The depth is read
# against the nearest vertex of the surface beneath, which at an armpit or the crotch can be another
# limb's, so those two numbers overstate; the stretch is exact. Nothing is fixed by it yet: a garment's
# mesh bridges arm and trunk where the body's does, and the rest pose's spread arms close in a walk.
Then a garment's faults in motion are numbers, by joint
Scenario: CH46. Checked like motion is
Then a dressed body is run through the library's captures and measured: skin showing through cloth, cloth
through cloth, and edges stretched past a limit, per garment
@done
Scenario: CH47a. Garments from sewing patterns, cut to SOMA's measurements and draped by a cloth of our own
# 11-15, after the user saw `raea clothes make` on the body ("on the body it looks terrible"; "the 4 panels
# are not consistent at all") and asked whether clothes are thought of wrong. They were: a garment painted
# onto a shell of the skin can't show a cut, a hem or a fold, and four pictures drawn apart never agree.
# Clothes are flat pieces cut to a pattern and sewn, their shape from the cut, gravity and the body.
# GarmentCode (ETH Zurich, pygarment, MIT) writes patterns as programs of modular components (bodices,
# sleeves, collars with a hood, a turtle neck or a lapel, cuffs, waistbands, trousers, seven skirts)
# joined by seams, sized from 26 body measurements. Its simulator is NOT used: it is a fork of an old
# NVIDIA Warp under a non-commercial licence (mainline Warp is Apache-2.0 since 1.6.2), and its sample
# SMPL bodies are research-only; SOMA replaces them. Blender's own cloth with sewing springs failed four
# ways (crumpled, slid off the shoulders). What worked, in the test project's scratch tools: SOMA measured
# in GarmentCode's terms (bust 81, waist 73, hips 93 cm: slimmer than its average body); a design is
# settings by path (sleeve.length=0.95 collar.component.style=Hood2Panels), which is what a sentence has
# to become; the cut written as flat pieces, their place round the body and the seams as vertex pairs;
# then a position-based cloth (every edge held to its length in the flat cut, each seam's pairs pulled to
# one point, the cloth pushed out of the skin by the nearest point, gravity let in once the seams close)
# on the CPU. A T-shirt (6,042 vertices) closes its seams by frame 30 (0.5 mm at the middle) and hangs
# from the shoulders with 20 per cent stretch at the 95th percentile, in 2 minutes; trousers (15,368) in
# 4.4, a hoodie with its hood and cuffs over them (12,541) in 3.4, no cloth inside the skin in any. Each is
# weighted from SOMA's skin by nearest face and worn as a Character part through the matched walk, with
# the skin wholly under it left out of the body (sheet3d compositions/soma_patterns.tsx). The flat cut is
# each garment's UVs, so a fabric is one tiling picture with no seams between views. Faults: the hood is
# drafted up and holds the hoodie high (above the waist); wide trouser legs, skinned from the nearest skin
# and not simulated as they walk, stretch a sheet between the legs at a full stride (CH44's follower is
# the fix); GarmentCode places pieces for its own body, so SOMA needs them lifted 7 cm while they are
# sewn; no open-front shirt or pocket component exists yet.
Then a garment is a pattern cut to the body and draped, and it walks with the body
Scenario: CH47. Clothes are sewing patterns (proposed: the user decides)
# Proposed 11-15 from CH47a. It would replace CH40-CH42's picture measuring as the way a garment's shape
# is made; the image model would draw only fabric (one tiling swatch) and prints placed on a piece.
Then a garment is a pattern program's settings, cut to the body's measurements, draped once per body
shape at build, and kept as a skinned mesh with its flat cut as its UVs
And words become settings (a language model picks components and values), never pictures of the body
And layers drape in order, each over the one beneath, and creatures get their own pattern blocks
Scenario: CH48. A garment model that dresses SOMA in anything (proposed)
# The user's answer to CH47, 11-15: "clothing or what you wear could realistically be anything. I wonder
# what we could do if we trained a small model like kimodo did or idol did, build off some existing
# weights we ship and create something that builds more intelligently". Patterns make only what is cut
# and sewn; armour, shoes, hats, a backpack or a costume are not patterns. Kimodo is good because it
# learned in one fixed frame (SOMA's skeleton), so what it makes plays on our body unchanged: the garment
# model would make garments in SOMA's rest pose and frame, so fit, skinning and layers come free. The data
# comes from CH47a's tools run as an engine (GarmentCode's design sampler across SOMA's shapes, draped by
# our cloth on the GPU, rendered from the mannequin's cameras, each example labelled exactly: its design,
# its pattern, its 3D on the body, its pictures), plus hard-surface things drawn and made 3D by Idol and
# cut from the body. GarmentCodeData itself is not used (draped on SMPL bodies, its licence unconfirmed).
# The base weights would be Idol's (Apache-2.0, shipped): one picture of the mannequin dressed in anything
# in, the garment alone out, in 3D on SOMA. Idol ships no training code, so its fine-tune is ours to write.
Then a garment is made by a model from words or a picture, on SOMA's body, as a layer
And the training data is ours, made by our own tools on SOMA, with where each example came from
And its cost is said before any training is paid for
@done
Scenario: CH48a. The garment data engine: random designs cut to SOMA, draped on the GPU, pictured, labelled
# 11-15, CH48's data half (tools/garments/engine.sh OUT N SEED). GarmentCode's sampler draws a design and
# its own checks refuse about 60 per cent; each kept one is cut to SOMA and draped by CH47a's cloth on the
# GPU (MLX): the body as a 7 mm signed distance grid signed by winding number (the nearest face's normal
# put patches of "inside" in the air above the shoulders), every link solved at once, compiled. The
# T-shirt that took 125 s on the CPU takes 7 s with the same seams (0.83 mm median) and stretch. Three
# things threw garments off, each found from snapshots of the drape: the cloth was too soft under gravity
# (+18 per cent stretch at the 95th percentile with 10 solver passes a substep: armholes opened over the
# shoulders; 60 passes give +5); SOMA's bust had been read at the chest's most forward level (81 cm), not
# the fullest girth under the arms (89.9), so fitted tops were cut too small; and GarmentCode's own drapes
# pin labelled edges to planes (a waistband's top at the waist, a neckline inside the neck's sides, a
# strapless top's edge at the armpit), without which gathered waistbands (up to 1.9 times the waist) and
# strapless tops fall. Ours are one-sided planes kept on, as elastic, boning or the neck holds them, a
# low-rise band pinned between waist and hips by its rise. Then 24 designs from 61 draws all hang right,
# 4 to 33 s each (about 7,000 a day on this Mac, $0). Rendered properly, the cloth first looked pebbled:
# the bake left it flat-shaded, so its glb had three vertices for every triangle (198,881 for 66,305) and
# shaded as facets everywhere it was drawn; smooth, it is one surface. The fabric is also stiffer than
# CH47a's (bending 0.3, squash 0.6 against 0.05 and 0.25), which buckled at the mesh's own scale; folds
# stay and stretch is +6 per cent at the 95th percentile. An example is its design's settings (the labels), a
# caption, the pattern, the flat pieces with seams and edge labels, the draped mesh, a skinned glb, four
# pictures on the mannequin and the drape's numbers. Faults: GarmentCode's space is mostly dresses and
# skirts (no open-front shirts, jackets, pockets, shoes or hats); one body shape so far; no collision
# between the layers of one design; the captions are written from the settings, not seen.
Then one command makes N random garments, each worn on SOMA and labelled with its design
And a garment that slides off is caught by the drape's own check, not by eye
Scenario: CH48b. The training data at scale, with periods, genres and things that are not sewn (proposed)
# The user's choice, 11-15: scale the data and train now, before writing the missing pattern pieces. And,
# in his words: "use examples of time periods, futurism, armor/suits/helmets/hats/etc". The engine's lean
# mode (LEAN=1) keeps what training needs, about 0.4 MB a design: the design, its caption, the drape's
# numbers and the draped mesh; pictures and glbs are made again from those for the examples that need
# them. A caption from the settings alone ("fitted sleeveless top, trousers") can't name a period or a
# genre, so captions also come from a picture of the garment on the mannequin, written by an image-reading
# model asked what the garment is and what it evokes (Edwardian, 1970s, workwear, futurist, uniform), with
# its price per caption said first. What can't be sewn comes from CH49.
Then the training set holds sewn garments captioned by their settings and by what they look like
And worn hard pieces from CH49, each with its words, its picture and its 3D on SOMA
Scenario: CH48c. Words to a sewn garment through SigLIP 2, trained with no captions (first form of CH48)
# 11-15. The base weights are SigLIP 2 (siglip2-base-p16-256, already in raea's models, Apache-2.0), whose
# pictures and words share one space. Each lean design is pictured on the mannequin from four sides
# (bake_batch.py PICTURES=1, 0.3 s a design) and embedded on the CPU (garment_embed.py; Core ML's GPU computes
# SigLIP 2 wrong on this Mac); a small network (two layers of 512, garment_model.py) learns the design's 122
# settings as 196 slots (garment_params.py: numbers by their place in range, choices one-hot, the options
# being every value seen, since GarmentCode's own defaults fall outside its ranges) from the picture
# embeddings, centred on the pictures' mean, with noise added; asked in words, it is given the text
# embedding centred on a bank of garment lines' mean (the two kinds sit apart by a near-constant offset).
# So no caption is needed to train, and a line nobody wrote a caption for still lands near its pictures.
# First run, 86 designs: held-out pictures give the top's kind 0.66 (most common 0.44) and the bottom's
# 0.59 (0.31); the numbers are no better than their mean yet. Twelve lines of words with a check each
# ("trousers", "a pencil skirt", "a top with a hood", "a strapless top" ...): 11 of 12, as many as taking
# the nearest training picture's design, where a random design passes one or two; nonsense ("a bowl of
# soup") falls back to a fitted top and trousers. words.sh makes each line a design, cuts it to SOMA and
# drapes it, about 20 s and $0: seven of seven were valid patterns and hung right, six read as asked.
# Faults: the long-sleeved shirt's sleeve was long but its cuff, a tube about 18 cm round reaching from wrist
# to elbow, is narrower than SOMA's forearm and slid off to hang open (one pair 8 cm apart); the drape's
# check looked only at the 95th percentile of seam gaps and passed it. A drape now fails with any seam open
# over 2 cm ("closed"), which 23 of the first 139 lean drapes do, mostly at sleeve-to-cuff corners, and the
# model trains only on drapes that pass. Drawing a gathered edge in to its partner's length (a gathering
# thread) was tried and changed none of the eight worst. Also: a turtleneck's collar collapses in the drape,
# unasked parts come along (trousers with a turtleneck), and "a long dress" is not known as a top joined to
# a skirt.
Then a line of words becomes a sewing pattern cut to SOMA and draped, with no caption written to train it
And its eval says how it compares with the nearest picture and with chance, on held-out designs and lines
Scenario: CH49. Worn hard pieces: helmets, hats, armour, visors (proposed)
# Patterns make only what is cut and sewn. A helmet, a hat, a breastplate or a visor is made the way the
# user first proposed for clothes and the creature flow makes animals: a picture of SOMA's mannequin
# (one view, its camera written down) is dressed by an image model, keeping the pose and the view; Idol
# (Apache-2.0, run on this Mac) makes the dressed figure 3D; it is laid on SOMA by its camera and size; the
# body is cut away (everything within a few millimetres of the skin, by the body's distance grid); what is
# left is split by the bone it lies nearest, and each piece rides that bone rigidly, as the head's cap and
# glasses ride Head (CH21). It differs from the rejected picture-measured clothes: those painted cloth onto
# the skin from four separate pictures that never agreed; here one picture is made 3D whole, and only rigid
# things are kept, so nothing has to fold.
# 11-15, built as tools/garments/wear.sh (README "Worn hard pieces"): a knight's plate armour (full: the
# dressed surface kept whole, set 4 mm off the skin) and four keyed pieces across periods and genres, a
# futuristic motorcycle helmet, a Victorian top hat, a Roman legionary's helmet and sci-fi armour, about 5
# cents and 5 minutes each. Keyed: the mannequin is drawn magenta and the colour decides what is body, not the
# distance (a helmet's crown sits within the cut of the skull and was being cut through); a separate piece
# that hugs the skin all over (the soles, which the drawing never shows) is dropped; each piece rides one bone
# whole, the one nearest its centre, never a neck bone, and a midline bone when it crosses the middle (so the
# breastplate rides the chest, not the arm under its shoulder plates, and a belt with thigh plates the hips).
# Open: the back is Idol's guess from one front three-quarter view (the sci-fi armour's back comes out dark),
# so a back view drawn to match is next; the surface is lumpy at Idol's 4 mm; a full suit's hands and feet
# copy SOMA's bare shape.
Then words make a helmet, a hat or armour that SOMA wears and moves with
And each piece is its own part on the bone it covers, so pieces mix with sewn garments as layers
+216
View File
@@ -0,0 +1,216 @@
Feature: Creatures: a four-legged body in the character SDK
Set by the user 2026-11-14, with the trashpanda project (a stylized raccoon that walks, sneaks, crawls, stands and
walks on two legs, climbs a tree, dangles from a wire, vaults, kicks off a wall, holds things, and goes limp): "if
you feel that a four legged creature has merit in the character sdk then also make your PRs alongside the other
work to include them and what you find".
It has merit. The character SDK is one skeleton (MakeHuman's game_engine: 22 body joints and 30 finger joints) and
one way of moving it (captures retargeted joint by joint, a motion matcher that picks frames, IK only to hold a
contact). None of that reaches an animal: there is no capture library for a raccoon, a dog or a cat on our rigs,
and retargeting a person's clip to four legs is not a thing. An earlier game's dog and cat were posed by a solver
written inside that project, and called stiff. So an animal needs the other half of what docs/hands.feature
began: motion made from what the body is doing, with no capture of it. This file is that for the whole body.
What was found, building the raccoon:
- Skeleton first holds for a built model as it does for a drawn one. The joints are set down by measure; the body
is then laid round them as solids, so every limb is where its bone is and the weights have something true to
start from.
- Where a limb joins the trunk decides whether the skin tears, more than the weights do. With the knee and elbow
touching the belly at rest, a voxel union fuses skin across them, and no weighting saves an edge whose ends ride
on joints that move 10 cm apart: 0.4% of edges torn at a walk. Moving the knees and elbows clear, so a leg joins
the trunk only at its hip or shoulder, took the walk to 0.05% with the same weights. Smoothing weights harder
made it worse (0.2% to 0.4%): it spreads a far-moving joint's pull into the trunk.
- What ended the tearing at the hip and shoulder was to stop joining them: each leg its own closed piece of
skin set into the trunk, the join hidden by the fur. A furred animal does not need one watertight skin.
- Bone heat gives the belly to the elbows and knees (they sit just inside it, the spine far above). The trunk's
skin has to be given to the spine outright: each point to the two spine joints it lies between.
- Feet kept in the world, not in the gait's cycle, are what stop sliding: a planted foot is a point that does not
move until its leg's turn comes. Measured slide is 0 mm in every move, turning and stopping included. A cycle
played under a moving body (that earlier solver) slides whenever speed or heading changes.
- One rigging (the hips' and shoulders' frames, four limb ends, the head's turn, the tail) is enough to pose every
move, and blending riggings rather than poses lets one move ease into the next with the limbs still solved.
- A small animal's legs are short for its stride: at standing height a foreleg reaches 8 to 11 cm ahead of its
shoulder. Strides have to come from the leg's length (a walk's stance travels about one leg length), or the
elbow locks every step.
- Fur as shells (16 copies of the skin pushed out along its normals, each cut by one height map at its own height)
draws on a skinned model in the raster renderer at no visible cost: 232k triangles, 11 ms a frame at 1280x720.
- A limp body made of points must not gain speed from being pushed out of a solid: the point's last place moves
with the push. Without that, a body that flops half over a box leaves at 16 m/s.
Rule: Built
@done
Scenario: CR0. Where it lives
# sdk/body/src/creature, engine-free TypeScript beside the person's body layer, exported as
# `creature` from raea/body. The moves that need a world (CR7 on) are in the trashpanda project until they
# have settled (its game/ folder).
Then the plan:
| crate | file | lines | job |
| sdk | sdk/body/src/creature/q.ts | 40 | the body layer's maths under short names; a bend from places; a turn from axes |
| sdk | sdk/body/src/creature/body.ts | 45 | a rig's measures: sockets, bone lengths, where each foot belongs, reach |
| sdk | sdk/body/src/creature/loco.ts | 185 | the gait by speed and posture; feet planted in the world and stepped |
| sdk | sdk/body/src/creature/pose.ts | 225 | the rigging, the solver, the blend between riggings, the tail on springs |
| sdk | sdk/body/test/creature.test.ts | 60 | slide, gait, every joint posed, feet squared up on a stop |
@done
Scenario: CR1. A creature's rig is read from its joints
# A rig is joints by name with a parent and a place at rest, every joint resting unturned (the engine places
# each by its own transform), and `marks` for the points that end a bone and carry no skin (nose, tail's tip,
# toes). Names: root, spine1..3, chest, neck1, neck2, head, jaw, ear_l/r, lid_l/r, tail1..N; fore legs fl/fr
# _scap, _upper, _lower, _wrist, _hand, digits _d1a/_d1b.._d5a/_d5b; hind legs hl/hr _upper, _lower, _hock, _paw.
Given a rig.json with those joints
When bodyOf reads it
Then it has each leg's socket, bone lengths, reach and where its foot belongs under the body
@done
Scenario: CR2. A planted foot does not move
# Each foot is a point in the world. It stays until its leg's turn in the gait, then swings to where the body
# will need it half a stance after it lands, aimed again every frame of the swing (a turn mid-step still
# lands right). A foot left more than 15 cm (fore) or 19 cm (hind) from its place goes at once.
Given a body walking, trotting, galloping, sneaking, crawling and walking on two legs, turning all the while
Then no planted foot moves between two frames
# measured 2026-11-14: 0.0 mm in all six (sdk/body/test/creature.test.ts; tools/locotest.ts in the project)
@done
Scenario: CR3. The gait is the speed's
# Stride, the share of a stride each foot stands, each leg's place in the stride and the lift are blended by
# speed: a walk (lateral sequence, 0.66 standing) to 0.8 m/s, a trot (diagonal pairs, 0.5) to 2.1, a bounding
# gallop (hind feet together, 0.36) above. Lowered, steps shorten and stand longer; on two legs the hind feet
# alternate.
Then stride grows and standing share falls from walk to trot to gallop
@done
Scenario: CR4. One rigging poses every move
# The solver takes the hips' and shoulders' frames, four limb ends (a place, a turn, how far the wrist or heel
# is rolled over it, how far the fingers are closed, where the elbow or knee points), the head's turn and the
# tail's joints, and gives every joint's place and turn: the back laid link by link between the two frames,
# the shoulder blade sliding with its leg, elbow and knee bent in a plane, the neck sharing the head's turn.
Given the body on the ground, lowered, and up on its hind legs
Then every joint is a number in every frame, and at a walk and a trot every leg reaches its foot
@done
Scenario: CR5. Standing still, it squares up
Given a body that galloped and stopped
Then within three seconds each foot is within 3 cm of where it belongs, brought there one at a time
@done
Scenario: CR6. The tail is late
# Its joints are points pulled toward where a stiff tail would be, stiffest at the root, kept their lengths and
# off the ground; how it is carried (up at a gallop, low sneaking, down behind on two legs) is the posture's.
Then the tail follows the hips' turns after them and never passes through the ground
Rule: Built in the project, to come into the SDK
Scenario: CR7. Moves off the ground share the rigging
# In the project (game/player.ts): in the air (nose along its path, hands reaching for the ground coming down),
# a vault (hands down on the thing's top, hind legs tucked through), a pull-up onto a ledge (hands on top, hind
# feet scrabbling on the face), a kick off a wall, climbing a trunk (diagonal pairs, hands that stay where
# they grip), hanging from a wire by the hands (a pendulum the player pumps, hand over hand along it), and
# gone limp. Each builds a rigging; a move eases into the next over 6 to 34 frames by blending riggings.
# A tour of all of them runs headless with every frame posed (tools/playtest.ts in the project).
# To do here: the world they ask of (ground height, what is ahead, a ledge, a trunk, a wire) as an interface.
Given a level that answers those questions
Then a creature jumps, vaults, pulls up, kicks off, climbs, hangs and lands on it
Scenario: CR8. Gone limp, and up again
# In the project: nine points on springs (hips and shoulders left and right, the head, four feet), each foot
# kept within its leg's reach of its socket; pushed out of solids without gaining speed; when it lies still
# the body gets up by blending from the limp rigging to the standing one.
Then a fall from 2 m tumbles, comes to rest in under 2 s and stands up where it lies
Scenario: CR9. It takes things
# In the project: on four legs a thing is taken in the mouth; up on its hind legs both hands close on it and
# turn it over; thrown from either. To do: docs/hands.feature's holds and finger curl on a creature's hand
# (five digits of two joints), so the fingers lie on the thing rather than at a fixed curl.
Then a thing held is in the mouth or between the hands in every frame, and the fingers touch it
Rule: To do
Scenario: CR10. The skin holds in every move
# Measured by tools/rigcheck.ts in the project: edges past 0.4x or 1.6x their length by more than 8 mm, as a
# share of all edges. With one skin over the whole body (11-15 early) 9 of 13 moves passed, and the gallop
# (0.76%), the crawl (0.48%) and two legs (0.9%) tore at the hip and shoulder, whatever the weights.
# 11-15: each leg is now its own closed piece of skin, set into the trunk under the fur, and follows only its
# own bones; the trunk follows none of a leg's. No skin bridges a leg and the trunk, so none tears there: 10 of
# 13 pass (crawl 0.007%), and the fur hides the join. Left: gallop 0.11% (the back's flexing), two legs 0.22%
# and 0.20% (the neck's fold and the tail's root).
Then no move tears more than 0.1% of the skin's edges
Scenario: CR11. A gallop with a back
# 11-15: every leg now reaches its foot at a gallop (a stance of 0.29 of the stride, the body 14 to 16% lower
# at speed; it was 87 of 1,200 leg-frames short). Still rough: the back's arch following the legs, the hind
# legs' reach past the fore, and a real moment with all four feet off the ground.
Then at a gallop every leg reaches its foot and the back's arch follows the legs
Scenario: CR12. Other animals on the same solver
# 11-15: done on a dragon (four legs, two wings, four neck joints, eight tail joints, horns, scales): the same
# solver, sized by the legs' reach beside a raccoon's (k: every stride, speed and length in the solver is a
# raccoon's times k; 1.74 for the dragon). Feet slide 0 mm in every move; the skin holds in 13 of 13. What it
# needed that a raccoon did not: any number of neck joints sharing the head's turn, optional ears, lids, digits
# and belly, wings (CR17), a body on nearly straight legs carried a little lower so it has slack to step with,
# and how it carries itself as four numbers in its rig (head low, heel down, tail's hang, wings' fold).
# 11-15 later: a dog and a cat made by another project (the monk game's animals, on the same names) walk, trot
# and gallop on it too (sdk/body test/creature.test.ts, private repo 3de8813). They needed two things the
# raccoon and the dragon hid: a fore leg may end in a paw instead of a hand (the body names each leg's planted
# joint), and a body whose legs have less room behind their feet than a raccoon's (straighter legs: measured
# from the rest pose at the height it is carried) steps at a smaller size, so shorter, quicker steps at the
# same speed. Before that, setting off left a hind foot planted up to 31 mm out of its leg's reach while the
# other three swung. The raccoon's steps are unchanged; the dragon's are 9% shorter.
Given a dragon's rig
Then it passes CR2 to CR5 and CR10 on the raccoon's solver with no line of the solver naming it
Scenario: CR15. A creature is a spec, and one flow makes it
# In the project (blender/creatures.py, tools/creature.sh). A creature is data: its joints by measure on the
# names' convention (root, spine1..N, chest, neck1..N, head, jaw, ear_/lid_, tail1..N, fl/fr/hl/hr legs, wl/wr
# wings, belly), the marks that end a bone, how thick its flesh is round each joint, its webs and horns, what
# its skin is, the words it is drawn from, and its carriage. The flow:
# mannequin the skeleton clothed in grey flesh (tubes by the radii, sheets for webs, cones for horns)
# art the image model draws the animal on the mannequin, same pose and view (flux_2_pro, 3 cents)
# idol the drawing made 3D on this Mac (Idol, about 3.5 minutes), carved to one closed mesh
# build the mesh laid on the skeleton by its feet and nose (its long axis found), thinned, painted from
# its own colour; the joints refitted to it (back, a standing neck by the middle of its flesh, legs,
# the tail along its own line, ear and horn tips, wing tips and wrists); weights by bone heat on a
# stand-in, the trunk given to the back by place; each leg and wing cut into its own closed piece
# check the reel posed by the solver and the skin measured (CR10)
Given a spec for a raccoon, the same skeleton as a vinyl toy, and a dragon
Then each command makes each of the three, and all three pass CR10 with no change between them
Scenario: CR16. The coat is the spec's
# fur: the generated surface is the coat's outside; the skin is set in by the fur's length for each part and 16
# shells grow back out to it (CR0's finding). scales, plain: the surface as it is, no shells, the picture opaque.
# A second style is a second spec with other words and another skin: the toy raccoon passed on its first run.
# Not done: a fur length read from the drawing (clipping the coat in the drawing keeps the outline, so the gap
# measures nothing), lids that close over painted eyes, a mouth with an inside.
Then a creature's skin is fur shells or the bare surface by its spec, and a restyle changes no code
Scenario: CR17. Wings
# A wing is a limb (wl/wr: shoulder, elbow, wrist, the tip a mark) and its own piece of skin. Its membrane is
# too thin for the 3D model to keep (Idol gave the arm and fingers and dropped the sheet), so the build makes it:
# a sheet between the refitted joints, each point following the joints at its corners. The solver raises a wing
# about the body's line and folds it in its own plane joint by joint (which way round each joint folds is read
# from the rest pose). Rough: the membrane is one flat colour and does not follow the finger bones; no flight.
Then a winged creature folds its wings as it walks, opens and beats them as it runs, and no web point is unbound
Scenario: CR18. Mouths and eyelids
# 11-15, in the project's build, the same on all three creatures. The mouth: the drawn mouth is paint on a closed
# head, so a turning jaw only stretched the lips. The head is cut along the lips' line (a plane through the
# muzzle's front a third of the way up it, rising a little toward the corners), what is under the cut follows the
# jaw, what is over it the head, and a dark inside (a roof on the head, a floor on the jaw, meeting at the hinge)
# fills what opens. The skin still holds in 13 of 13 moves. No teeth or tongue.
# The lids: each is a small cap of its own, resting under the brow, that turns about an axis lying along the head
# (the rig's lid_axis; a turn about the head's side-to-side axis does nothing for an eye that faces sideways) and
# takes the colour of the skin round the eye. Where the eye is comes from its pixel in the drawing (eye_px in the
# spec). The model was made from the drawing, so seen from the drawing's side it is the drawing: that side is
# searched for (view, size and shift, scored by how much of the model lies inside the drawing's outline, since a
# drawn wing's membrane is not on the model), the pixel is cast along it onto the raw model, and the point it
# meets is the same point on the model once laid on the skeleton. A strongly coloured eye is then moved onto
# the few points nearby whose colour leans toward the pixel's. Casting from the mannequin's camera instead was
# centimetres off (the model is not laid exactly where the mannequin stood).
# Rough: the lid shuts over the eye on the toy raccoon and about on it on the raccoon; on the dragon it lands
# about an eye and a half away (outlines agree 0.77 against 0.84 and 0.92, and its eye is a handful of points).
Then a creature's jaw opens a mouth with an inside, and its lids shut over its eyes
Scenario: CR13. In the engine
# As docs/hands.feature moved the hands to Rust (raea-sys-body), a creature's solver belongs beside it once
# the TypeScript has settled, with <Creature> in raea/character drawing a rig from a rigging.
Then <Creature rig pose /> draws a four-legged body, and character.creature answers a rigging's pose
+561
View File
@@ -0,0 +1,561 @@
Feature: Procedural arms and hands: a character reaches for, takes, holds, carries and throws things
Set by the user 2026-11-14: the character SDK's arms and hands should grab, hold and move things procedurally,
built in Rust for the engine from a mixture of musthafa45/Ik-Object-Holding, NVlabs/SOMA-X and whatever else
helps, with research into what else would broaden the character SDK (bodies, interactions, movement), and a look
at patch.gg.
Where this sits beside docs/character.md: that plan's actions (C5, C6) are played from captures, with IK only to
hold a contact. This is the other half: an action with no capture of it. The same rules hold where they can:
every solver reports how far it moved the pose and how far it missed (principle 2), the whole action is a
function of time (principle 9), and the body's own motion (a clip, a walk) comes in untouched and is only changed
where a hand needs it.
What the sources gave:
- Ik-Object-Holding (MIT, Unity C#, 484 lines of script): hold points found by casting a ray from each side of
the holder back into the thing's collider (ColliderEdgeDetector); hands eased onto them with two-bone IK and
an aim; the thing parented to a hold transform in front of the chest and drawn to it; drop and throw. Its
easing is a per-frame lerp (frame-rate dependent, not frame-pure) and its hands have no fingers and no palm
turn. Ported as: hold points in the thing's own frame with the surface's facing, eases as curves of time.
- SOMA-X (Apache-2.0, NVIDIA): a canonical body and hand rig that other body models map onto. For this work it
gave the swing-twist split with half-angle stabilisation and the twist shares along a segment (0.05, 1/3,
2/3, 0.95 over four twist joints), used here to move a wrist's twist to the forearm. Its other parts are for
later: a wrist-local hand layer with a learned articulation prior (SOMAHand.npz: what hand shapes are
natural), pose inversion (joint turns fitted to points), and body-model interop including Anny. It needs
PyTorch and Warp; nothing of it runs in the engine as it is.
- Around SOMA: Kimodo (Apache-2.0 code; the SEED weights under NVIDIA's Open Model License, said to allow
commercial use; the SMPL-X weights are research-only) makes motion from text and constraints. MotionBricks, a
real-time in-betweener, has preview code in GR00T-WholeBodyControl with no plain licence on the repository
and sample motions under an evaluation-only licence: not usable until that is read. BONES-SEED (motion in
SOMA's format) has its own licence, gated: unread. ProtoMotions (Apache-2.0) trains physically simulated
characters.
- Rust IK crates: bevy_mod_inverse_kinematics (to Bevy 0.16), bevy_fabrik (no multi-chain), bevy_ik (Bevy
0.9). None is on Bevy 0.20, none does a two-bone solve that keeps a clip's twist or reports what it changed,
so the solver here is ours: 170 lines.
- Grasping research (Lightning Grasp and the like) is for robot hands, has no plain licence, and solves
grasp stability, which a character doesn't need. A character's hand needs to look right: the palm on the
surface, the fingers wrapped to the shape. Curling each joint until its bone meets the surface does that.
- patch.gg: a place to publish browser games and mods, with a CLI (pch), an MCP server and an asset library of
50,000 open-licensed models, characters and sounds. It is not an engine and has nothing for IK or hands.
Its installer writes a "use Patch for games" section into ~/.claude/CLAUDE.md for every agent on the machine,
which would put Patch ahead of raea in every session here: not installed. Its asset library conflicts with
the rule that every model in a raea piece is made by us. Worth taking from Patch: its open repositories.
anymove (Apache-2.0) captures motion for any rigged creature from one generated two-view video (about $3 a
usable move, needs an NVIDIA card with 12 GB, 58% of clips pass) and is the one that fits: animals and
creatures, where raea has no captures. crowdbricks (Apache-2.0) batches MotionBricks and inherits its
licence question. Publishing a raea playable on Patch is a distribution question, not a character one.
Rule: Built
@done
Scenario: HG0. Where it lives
# Two crates, split when the first passed 2,000 lines: raea-sys-body is the character's body in Rust (what
# sdk/body is in TypeScript), raea-sys-grab is what the hands do with things.
Then the plan:
| crate | file | lines | job |
| raea-sys-body | src/rig.rs | 240 | the rig, poses, forward kinematics, a hand's frame, a stand-in body |
| raea-sys-body | src/arm.rs | 200 | two-bone IK, the reach that leans, the forearm's twist, twist joints |
| raea-sys-body | src/limits.rs | 260 | joint ranges as anatomical angles, a turn brought inside, violations |
| raea-sys-body | src/fit.rs | 120 | a pose fitted to points seen |
| raea-sys-body | src/prior.rs | 150 | the hand prior: shapes, coefficients, oddness |
| raea-sys-body | src/shape.rs | 130 | solids as signed distances: casts, normals, clearance |
| raea-sys-grab | src/hand.rs | 200 | holds, the wrist that lays a palm on one, the fingers' curl |
| raea-sys-grab | src/trunk.rs | 130 | stoop, look, clearances, where to stand |
| raea-sys-grab | src/interact.rs | 40 | which thing is taken |
| raea-sys-grab | src/take.rs | 460 | the take's timeline, each hand's part, the frame's solve |
| raea-sys-grab | src/grip.rs | 110 | the hand's lie at its grab, the swivel, an arm past its ranges |
| raea-sys-grab | src/json.rs | 150 | character.take |
| raea-sys-body | src/json.rs | 110 | character.fit, character.hand, character.soma, shared readers |
| raea-sys-body | src/soma.rs | 110 | a pose from a SOMA body's joint places |
| sdk | sdk/character/src/soma.ts | 80 | a SOMA animation read from text USD; somaPose |
| raea-sys-grab | tests/grab.rs | 470 | the hands' measures, on the stand-in body |
| raea-sys-grab | tests/body.rs | 150 | limits, the body out of solids, the hand prior |
| raea-sys-grab | tests/use.rs | 230 | passing, sliding, wind-up, a turned body, keeping out of solids |
| sdk | sdk/character/src/take.ts | 190 | take(), fitPose(), handShape(): the calls made, typed |
@done
Scenario: HG1. An arm reaches a target, and says what it cost
# 11-14, built: raea-sys-body arm.rs. On the stand-in body, 600 random targets inside the arm's reach are hit
# within 0.1 mm; a target 20 cm past the arm is missed by 20 cm and flagged; a wrist already on its target
# turns nothing; the pole puts the elbow on its side of the line within a degree; a reach 12 cm past the arm
# lands within 5 mm by leaning the clavicle, chest and spine, each under its cap, and names them.
Given a pose of the game_engine rig and a place for a wrist
When the arm is solved for it
Then the wrist is there when the arm reaches, the elbow bends about the hinge it had, and the pole chooses
where the elbow points
And past the arm's length the trunk leans, by capped shares, and the report names every joint turned
And a wrist's twist is shared with the forearm, the hand staying where it was
@done
Scenario: HG2. Hold points are found on the thing itself
# 11-14, built: shape.rs, hand.rs. A box 36 cm wide gets a hold on each side face, facing out; a cup 8 cm
# wide gets one hand; a turned thing's holds are on its surface from wherever the holder stands; the palm's
# skin lies on the hold within 0.1 mm, facing into it, fingers the way the holder faces.
Given a thing as a ball, a box, a capsule or a cylinder, placed and turned, and where the holder stands
When its holds are asked for
Then a thing wider than a hand's span gets a hold on the holder's left and one on the right, where a ray
from that side meets its surface, each with the way the surface faces
And a narrower thing gets one hand's hold
And the holds are kept in the thing's own frame, so they ride with it
@done
Scenario: HG3. Fingers wrap what they hold
# 11-14, built: hand.rs `curl`. Each joint, knuckle first, opens past rest and bends until its bone meets
# the surface. On a carried box at least three fingers of each hand are on it and none is over 12 mm inside.
# The curl is solved with the hand at its hold, not where the arm has got it to, so it doesn't flicker as
# the hand comes in (it did: 24 degrees a frame).
Given a hand at its hold on a thing
When its fingers close
Then each finger bends until it meets the surface, a finger that meets nothing closes loosely, and a finger
that is inside the thing even opened is reported, not hidden
@done
Scenario: HG4. Reach, grab, lift, carry, put down or throw, as one function of time
# 11-14, built: take.rs `perform`. From the grab to the release both palms stay within 6 mm of their holds
# at 30 frames a second; a cup carried while the body turns 34 degrees and back stays upright the whole
# way and is set down within 0.1 mm of its place; a thrown box flies, lands on the floor and stays; the
# body is back on its own motion 0.4 s after letting go. A frame asked for twice, in any order, is the same
# frame; no joint of the body turns over 6 degrees in a 60th of a second, no finger joint over 20.
Given the body's own motion as a pose at any time, a thing, and its holds
When a frame of the take is asked for
Then the hands leave the body's motion, come onto the holds from off the surface, and close
And the thing is drawn to a carry place off the chest and rides there, turned only with the body's facing
And a put sets it down at a place, a throw lets it go with a velocity and it falls to the floor
And every frame says how far a wrist missed and how far the body was turned from its own motion
@done
Scenario: HG5. A character in a scene takes a thing
# 11-14, built: raea/character's `take(skel, base, spec, t)` (sdk/character/src/take.ts) makes the native call
# character.take (runtime/calls), which is systems/grab's `take_json`; the answer is the pose for <Character>
# and the thing's place. Asked as JSON it is the same frame as asked in Rust (a test). Rendered on teal, the
# Character SDK project's drawn character, 1.70 m (the sheet3d project's compositions/take.tsx, out/take.mp4;
# first on a 1.81 m MakeHuman person, the same code): a box taken off a table with both hands and thrown, a
# cup moved across the table in one hand, upright, the fingers round it, a box lifted from the floor onto
# the table; 735 frames, no errors. Shane hasn't watched it.
Given a <Character> and a thing in a 3D scene
When the scene says the character takes it (which thing, when, then put where or thrown how)
Then the engine works out each frame's pose and the thing's place, in a render and in live play alike
And TypeScript reaches it as one native call (core/calls), typed, with the report per frame
And the body's own motion is whatever the character was playing
@done
Scenario: HG6a. Hands stay out of the scene's solids
# 11-14, built: trunk.rs `clear`, a take's `avoid` list. A wrist's place is moved the least that keeps the
# wrist, the palm and the fingers' reach 2 cm clear of every solid named; the wrist's path arcs up 6 cm and
# leaves a hold backing off its surface. With a table under a cup, no point of the hand is in the table at
# any frame of the take, and keeping clear costs the hold under 6 mm. Seen on turbo: the hand comes over the
# table's edge onto the cup and leaves it without passing through the top.
Given a take with the solids round it named (a table, a shelf)
Then no frame has the hand inside one, and the hold is still kept
@done
Scenario: HG7a. A low thing is taken by bending, the feet planted; and the body is told where to stand
# 11-14, built: trunk.rs `stoop` and `stand_for`. For hands that must go lower than 0.7 of an arm below the
# shoulders, the hips come down and the trunk bends at the hips and along the spine, by as much as the hands have got along their reach, so the body rises again as the thing is
# lifted. Leg IK keeps both ankles where they stood within 5 mm and the feet's turn. A box on the floor is
# held within 2 cm; the hips come down over 30 cm and are back up with the box carried. `stand_for` gives
# the place a forearm's length off the thing's near face, facing it; standing there both hands reach.
# character.take answers it as `stand`. Seen on turbo: a box lifted from the floor onto a table. Not right
# yet: the body itself keeps out of nothing (the head went into the table that stood 38 cm in front). The
# squat was retuned after the first render folded the head to the knees: the hips take three quarters of it
# (to 0.55 m), the trunk bends to 49 degrees, and the head looks at the thing.
Given a thing lower than the arms reach, or out of reach
Then the body bends and squats for a low one with its feet where they stand
And for a far one the take says where to stand and which way to face
@done
Scenario: HG4a. The carry is against the body
# 11-14: a two-handed thing rides 10 cm under the chest joint, 20 cm plus half its size in front, so the
# elbows bend and the lift shows (it was carried at arm's length, hardly lifted).
Then a carried box is held against the belly with the elbows bent
@done
Scenario: HG5a. The rest of both sources, in Rust
# 11-14, built. From Ik-Object-Holding: its Interactor is interact.rs `pick` (the nearest thing in a radius
# that the eyes see past the scene's solids; the original takes the first collider found), and its head aim
# is trunk.rs `look` (neck two fifths, head the rest, 55 degrees at most), on through a take: the eyes go to
# the thing as the hands do. With HG2 and HG4 that is every script of the original that isn't Unity input or
# animator glue. From SOMA-X: fit.rs `fit` is the analytical pass of its pose inversion on marks instead
# of mesh vertices (joints refitted parents first, each aligned to what it carries; the root on its own
# marks), and arm.rs `twist_joints` is its procedural twist-joint evaluator (shares 0.05, 1/3, 2/3, 0.95;
# an upper segment undoing its own joint's twist). 20 random poses, every joint turned up to 50 degrees,
# are recovered from joint heads and bone ends with every joint within 4 mm. raea/character's
# `fitPose(skel, marks)` is the native call character.fit; on turbo a second body posed only from the
# first one's joint positions stands as the first does through a take (fingers aside: positions alone
# don't give a bone's twist). A wrist stops at 70 degrees and the frame says so (`limited`); the fingers
# point the level way the arm comes, so it is rarely asked for more.
# Not converted, and why: SOMA's body and hand layers, identity models and correctives are a different
# mesh and a 78-joint rig driven by PyTorch and Warp, and raea's body is MakeHuman's; its hand
# articulation prior (SOMAHand.npz, 32 components over SOMA's 24 finger joints, bind-relative) needs
# SOMA's finger frames mapped onto game_engine's 15 finger joints before a score means anything (done
# since: HG5b); its Lie-algebra and autograd refinements fit mesh vertices through skinning, which marks don't need.
Then a body can choose what to take, look at it, and be posed from positions seen
@done
Scenario: HG6b. The arms inside the rig's ranges, and the head and chest out of the scene's solids
# 11-14, built. limits.rs is sdk/body's axes.ts and limits.ts in Rust: each joint's turn read as flex, side
# and twist from the rest pose, the same ranges (13 roles, the right side mirrored), a turn brought inside
# them, a pose's violations. Through a take every joint of both arms is inside its range and a frame that
# had to hold one says so (`limited`). trunk.rs `roomy`: when the solved pose puts the head's top, the neck
# or the chest within 9 cm of a solid in a take's `avoid`, the take is solved again with less bend and
# lean and more squat (to 0.82 m of hips), a sixth at a time. With a table 38 cm in front and a box on the
# floor between, none of the three is in the table at any frame and the hold is kept within 5 cm; with no
# table the same take bends over where the table was. Seen on teal: an upright deep squat beside the
# table, the head clear, the eyes on the box. Not done: the knees and the forearms keep out of nothing,
# and the two copies of the limits (TypeScript, Rust) are kept in step by hand.
Then no arm joint is past its range, and bending never puts the head or chest into a solid
@done
Scenario: HG5b. SOMA-X's hand prior on raea's fingers
# 11-14, built. raea-sys-body prior.rs and data/soma_hand_prior.bin (12 KB; data/README.md has its source and licence):
# the left hand's 32-component model of real hand poses, cut to the fifteen finger joints raea has (the
# metacarpals and fingertip ends left out; 99% of the first component is on the kept joints). SOMA's
# turns are from its flat bind hand in the wrist's axes (fingers along +x, palm +z); each raea finger bone
# is pointed where SOMA's would, in the hand's own rest frame, the right hand mirrored. `shape` gives a
# hand from a few numbers: none is the average relaxed hand, the first opens it (+2) and closes it to a
# fist (-2). `coefficients` reads a hand back (a shape's numbers within 0.05, under half a degree left
# over) and `oddness` compares hands: the average 0, the rig's rest hand 2.0, fingers bent back at the
# middle joint 4.3. A take now opens the hand as it comes in (the first number at +1.5) before the
# fingers shut. raea/character's `handShape(skel, side, z)` is the native call character.hand. Seen on
# teal: the sweep goes from a fist to an open hand, on a hand mesh whose skinning is coarse.
# Still not converted: SOMA's body and hand meshes, identity models and correctives (a different mesh
# and a 78-joint rig on PyTorch and Warp), and the vertex-fitting refinements of its pose inversion.
Then a hand can be given a natural shape by number, and any hand can be scored against real ones
@done
Scenario: HG8a. A thing held one way brings its holds
# 11-14, built. A hold can come with the thing (`holds`, in its own frame: where the palm goes, the way the
# surface faces, optionally the way the fingers point and the hand's shape as the hand prior's numbers); any
# other thing has its holds found (HG2). A hold with a shape takes that shape instead of the curl. Where a
# hold doesn't say, the fingers lie along the forearm as it arrives (the arm solved to the hold alone
# first), brought level by halves where that would tip them into a solid; and the elbow's swing is chosen,
# 10 degrees at a time, as the nearest that keeps the shoulder and the elbow inside their ranges. A mug
# held by its side in a loose fist keeps the palm within 15 mm of its hold from the table to the mouth and
# back with no joint at a limit; with the fingers forced to point forward the same take reports the arm at
# its limits and the palm up to 18 cm off, which is the report doing its job.
Then a mug, a grip or a handle is held the way it says, and a hold no arm can make is said, not faked
@done
Scenario: HG9a. Using what is held: a path the hands follow
# 11-14, built. A take's `path`: where the carried thing is at times, off the chest, and how it is tipped;
# eased from the carry place through each key. A drink is one key at the mouth, tipped 29 degrees. The
# thing is exactly at each key at its time, and upright again after. A lift and a put-down now arc 4 cm so
# the thing leaves what it stood on before it travels. Seen on teal: a mug to the mouth and back to its
# place. Not done: passing a thing from hand to hand or to another character, and pushes, pulls and turns
# of things that stay where they are (a door, a drawer).
Then a held thing can be raised, tipped, aimed or swung by giving where it goes
@done
Scenario: HG10a. Weight
# 11-14, built. `weighing(kg)` (a take's `weight`): the carry place 1.5 cm lower a kilogram (to 18 cm) and
# a little closer, the lift an eighth longer a kilogram, the waist leaning back 0.7 degrees a kilogram (to
# 11). 12 kg: carried over 10 cm lower, the lift 0.75 s longer, the chest behind where a light take has
# it, both palms still on. Seen on teal with 14 kg. Not done: a throw's wind-up and follow-through.
Then a heavy thing is held low and close, lifted slower, and leant against
@done
Scenario: HG9b. Passing a thing, moving a thing where it is, and a throw's wind-up
# 11-14, built. Each hand now has its own part in a take (when it leaves the body's motion, when it is on,
# when it lets go), so hands can come and go separately. `passing(at)` (a take's `pass`): a thing held in
# one hand is brought to the middle, the other hand takes it on its far side (`Hold::across`), and it is
# carried on that side; one palm or the other is within 15 mm of its hold at every frame, both at the
# pass, and the thing stays upright. `slide` and `Release::Leave` (a take's `slide`, `leave`): a thing
# that isn't carried goes through places where it is, the hands staying on, and is left there; a drawer's
# front pulled 18 cm keeps the palm within 3 cm of its handle and never leaves its runners. A throw draws
# the thing back 18 cm against the throw over its last 0.4 s and brings it through, and the hands follow
# it out 20 cm before coming back. Seen on teal: the cup passed right to left, a drawer pulled open, the
# box drawn back before it is thrown. The arm let go swings back in half a second, up to 26 degrees a
# frame at 30 a second, which may read as abrupt. Not done: a thing passed to another character.
Then a thing changes hands with somebody always holding it, a drawer is pulled and left, a throw winds up
@done
Scenario: HG6c. Forearms, knees and the carried thing out of the scene's solids
# 11-14, built. An elbow swing that puts the elbow or the middle of the forearm within 3 to 4 cm of a solid
# counts as far past its range, so another swing is chosen. A squat whose knee would be within 7 cm of a
# solid sits back from it, 4 cm at a time. A lifted thing rises by how deep its corners would be in a
# solid. With a table 38 cm in front, a box lifted from the floor onto it: no knee or elbow is in the
# table at any frame, and no corner of the box is over 5 mm into it on the way. The body bends for a
# thing only when it is lower than 0.88 of an arm below the shoulders (0.7 squatted for a drawer handle
# a hanging arm reaches). Not done: the body's own shape (an arm through the torso, a thing through
# the thighs), which sdk/body's shape.ts knows and the Rust does not.
Then the limbs and the thing clear a table as the hands, head and chest do
@done
Scenario: HG7b. Walking up to the thing, and a thing handed to another body
# 11-14, built. A take works wherever the body stands and faces: a body turned 120 degrees and moved 2 m
# keeps its palm within 12 mm of the hold and carries the cup in front of where it faces. raea/character's
# `placedPose` stands a pose somewhere else; `walkUp(clip, fps, seconds, stand, to, yaw)` is the body's own
# motion for arriving: a walk capture played from its start and set down so it ends at a take's `stand`
# walking the way it faces, then eased into a stand over half a second; the take starts when it arrives.
# A hand-over needs nothing new: the giver's take holds the thing out on a path and leaves it at the
# moment the taker's take, on a body placed facing it, has its hand on. Seen on teal: walking up to the
# table and moving the cup; a second teal taking the cup from the first one's hand. Not right: the feet
# slide as the walk settles (the project's one walk capture doesn't stop), and the walk isn't chosen or
# steered (that is sdk/body's locomotion, which needs a library for the body).
Then a body can arrive where a take says to stand and take the thing, and give it to another body
@done
Scenario: HG6d. An elbow out of the body's own trunk
# 11-14, built. trunk.rs `torso`: the trunk as a capsule from the hips to the top of the chest, three
# fifths of the way out to a shoulder. An elbow swing that puts the elbow within 3 cm of it counts as far
# past its range. A cup well to the body's left taken with the right hand: the elbow is outside the trunk
# at every frame. Not done: the forearm and the hand against the thighs and the belly, and the thing
# against the body.
Then reaching across the body doesn't put the elbow through it
@done
Scenario: HG6e. The carried thing and the hands on it out of the body
# 11-14, built. trunk.rs `own_solids`: the trunk and both thighs as capsules where the pose has them. A
# carried thing is moved the way the body faces until none of its corners, nor a point a hand's length
# behind each hold (the wrist), is within 1 cm of them. A deep box asked to be carried inside the belly:
# no corner and no wrist is in the body at any frame, the nearest of them is within 4 cm of it, the holds
# are kept within 1 cm; a carry that was clear is unchanged. Not done: the forearm against the thighs in
# a squat, and the fingers against the body.
Then a thing is carried against the body, never in it
@done
Scenario: HG12a. Motion on SOMA's skeleton plays on a raea body
# 11-15, built, after the user asked what SOMA-X gives that raea lacks. Not its bodies: its skeleton is
# the one NVIDIA's motion models and datasets speak (Kimodo, GEM-X, EgoHand, BONES-SEED), and raea had no
# way from its 78 joints to raea's 52. raea-sys-body soma.rs `from_soma`: each of raea's bones is pointed
# the way SOMA's matching bone points, at raea's own lengths (so proportions and bind poses needn't
# agree), the pose fitted to those places, and each arm's and leg's first bone turned so its elbow or
# knee flexes about its own axis (arm.rs `settle_hinge`). A posed body 1.3 times the size, in centimetres
# and under SOMA's names, is followed with every bone within 2 degrees and no elbow or knee over 25
# degrees sideways. raea/character's `readSomaUsda` reads a SOMA animation saved as text USD and
# `somaPose` is the native call character.soma. Shown: SOMA-X's own example animation (900 frames, 24 a
# second, Apache-2.0) on turbo, through arms crossed, arms overhead, a side bend and a squat. Open:
# positions alone leave a limb's turn about itself to the hinge rule, so forearms and wrists may be
# turned wrongly; frames are taken whole, not blended; and no model's or dataset's licence has been read.
Then a SOMA animation plays on any raea body, bone for bone
@done
Scenario: HG12b. Generated motion plays on a raea body, its head as the model made it
# 11-15. Licences read first. Kimodo: code Apache-2.0; weights under NVIDIA's Open Model License, which
# allows commercial use and claims no ownership of outputs. BONES-SEED: granted only to academic users and
# companies under a revenue limit, with no redistribution, so raea uses none of it. Kimodo's text encoder
# needs a gated Llama model and an NVIDIA card, so nothing was generated here: the four example motions
# its repository ships (slow walk, walk then sneak, run and leap, a zombie walk; 30 joints, 30 frames a
# second) play on turbo through `somaPose`. The head was tipped back, since one bone direction says
# nothing of where a face points: `from_soma` now sets the head's frame from SOMA's head joint and two
# eyes, and a hand points at SOMA's middle finger end. The head's pitch on turbo is the source's (15
# degrees up at 2 s of the slow walk in both). Open: generating new motion (a cloud step), and judging
# it against captures.
Then a motion a model generated on SOMA's skeleton plays on a raea body with its head the source's way
Rule: The bar, set by the user 11-14: a complete tool, not scenarios
Scenario: HG14. Measured on the body's own skin, the takes are seamless and clip nothing
# 11-14, after the third pass was posted: "I doubt you solved it it should be a complete tool with fingers,
# grips, holds no clipping into somehting. hwo far away do you need to move to get something how smooth is
# the rig is we want perfect seemless motion, npc behaivior, not colliding with things not bending down
# weirdly we want something that is complete. as well i notice you use teal which loosk broken stubbed
# fingers, broken face, weird body type and skelton." He was right. The scenarios above were judged on
# wrists and palm centres, on stills, on a drawn character. tools/hands-audit runs six takes on a clean
# body (turbo, 1,588 skin samples, every finger segment) at 60 frames a second and prints the worst of
# each measure. First run: body joints jumping up to 6,000 degrees a second in one frame; finger skin 14
# to 22 mm inside what it holds; the waist 99 mm inside a box drawn back for a throw; fingers 10 to 30 mm
# inside the table; a mug held with no finger pad on it; a floor squat with the hips at a fifth of
# standing height. Since: the elbow's swing, the hand's lie on its hold, the squat's give and the knees'
# set-back are continuous instead of chosen from steps, and body-joint jumps are down to 400 to 750 in
# five of six takes. Then: a bug in the limits (a turn read the long way round, a wrist of 31 degrees held as
# if it were 329) that threw the wrist 100 degrees in a frame; the grip is now the one the hand has at its
# grab, kept in the thing's frame, so the hand doesn't shift on what it holds; the fingers curl on the
# body's own skin samples, and a finger that misses settles at its nearest approach; a thing in one hand
# turns about the vertical with the forearm, up to a quarter turn. Second run: body-joint jumps 311 to 955
# (from 3,500 to 6,000), finger jumps 67 to 362 (from up to 4,300), finger skin in a cup 4 to 7 mm (from 14
# to 15) with 4 to 5 pads on it (from 0 to 2). Still wrong: a box drawn back 99 mm into the waist for a
# throw; the floor take (hand 62 mm into the box, hold 27 mm off); the mug at the mouth (palm up to 5 cm
# off, wrist at its limit); fingers 7 to 21 mm in the table; the squat's hips at a quarter of standing.
# Third run, after: a carried thing pushed out of the body's own skin (as it will be posed, squatting for
# a low thing) and after a throw's wind-up; the grip chosen between the forearm's way at the grab and at
# the carry; the whole hand's skin kept off solids, 2 cm while it travels and 4 mm on its hold; a hold's
# hand shape used only for fingers that miss; the squat eased in and out; the knees making way for the
# thing. Body skin in a thrown or heavy box 0 mm (from 99 and 45); skin in the table 0 to 11 mm (from 7 to
# 30); finger skin in a box or cup 5 to 8 mm; holds kept within 4 to 9 mm in five takes. Still wrong: the
# floor take (hold 83 mm off as the box is pushed clear of the squatting body, fingers 25 mm in it, thighs
# 18 mm in it); the mug (fingers 25 mm in it, a thumb that starts inside it); fingers 9 to 11 mm in the
# table as a hand leaves; body-joint jumps of 360 to 700; `limited` on about 100 frames a take.
# Fourth run, after: a limb's middle joint flexing about its own axis (the first bone turned in its socket),
# which ended the false limits (0 frames in three takes, 31 to 76 in the others); the body following the
# hands down; the knees opening for a low thing between the feet; a thumb that is in the thing spread out
# from the palm until it is clear; a leaving hand kept on its cleared path for longer. Skin in the table 0
# mm in four takes (9 in the floor take); finger jumps 67 to 242. character.take now answers `reach`:
# whether the body can take the thing from where it stands, and how far it must move if not. Still wrong:
# the floor take (hold 69 mm off, fingers 26 mm in the box, thighs 11 mm); the mug (fingers 26 mm in it);
# body-joint jumps of 360 to 640. Shown on turbo in the Character SDK project (compositions/take_turbo.tsx),
# rendered before this run.
# Fifth run, after: a thing held in one hand is where that hand has it (if the wrist is at its limit the
# thing turns with the hand instead of passing through it), and the elbow's swing also counts what the wrist
# can't do. The mug: finger skin in it 26 to 1 mm, five pads on it (from 2); a moved cup 5 to 2 mm. What
# that exposed: at the mouth the mug tips up to 50 degrees where 29 was asked, and its rim goes 14 mm into
# the face; a carried cup tips up to 2 degrees where the wrist is limited; the mug take has a joint jump of
# 1,378 as the elbow swings out. The floor take is unchanged (hold 69 mm off).
# Also since: a grip chosen by the thing's shape for one more case, a rod lying down (taken over the top,
# the fingers round it across its length; stood on end it is taken by its side), with three of five
# fingers on it on the stand-in body; and raea/character's `fetch`, which takes a thing as asked when it
# is in reach and otherwise walks the body to the take's standing place first (walkUp) and puts every
# time of the take off until it arrives. `fetch` was then rendered on turbo with a walk capture retargeted to it (ACCAD Male2 B3): the body walks 1.5 m
# up to a table, stands where the take says to, and takes a cup; the feet slide as the walk settles.
# The floor take's scenario was itself impossible, which several rounds had been fighting: the box stood on
# the body's toes (toe skin 11 mm in it at rest) with a solid table 38 cm ahead, 17 cm of floor for a 24 cm
# box. Set a forearm's length in front of the feet, the table a top with room under it: the hold is kept
# within 5 mm (from 69), no body skin is in the box, the hips are at 45 per cent of standing at the grab.
# The trunk's lean now comes on as soon as an arm ends short (it waited for the arm's full length and came
# on at once), and the squat's give is a smooth measure of the room the head and chest have (finding the
# least give that cleared jumped): that take's worst joint jump 1,706 to 707. Left in it: fingers 20 mm
# in the table's top as the hands leave, finger skin 15 mm in the box, hips down to 24 per cent later.
Given the six takes of tools/hands-audit on a clean body with real fingers
Then no skin is in the thing beyond a pad's give (2 mm), none in the scene or the body
And every finger meant to hold has its pad on the thing, by a grip chosen for the thing's size and shape
And no joint's speed changes by more than 300 degrees a second in a frame, fingers included
And a low thing is taken with the hips no lower than a real squat and the back as a person holds it
And a body that can't reach walks until it can, on any body, and the walk stops without sliding
And it is shown on that clean body, in motion, and Shane has watched it
Rule: Next, in order
@needs:HG5
Scenario: HG6. The whole body out of itself and the scene
# HG6a, HG6b and HG6c keep the hands, head, chest, forearms, knees and the thing out of the scene's solids.
Then the arms and the held thing stay out of the body's own shape (sdk/body's shape.ts and shell.ts), by
the least move
And one copy of the limits serves both the TypeScript and the Rust
@needs:HG5
Scenario: HG7. The walk is chosen and steered
# HG7a says where to stand and HG7b arrives there on one capture set down to fit.
Given a thing out of reach, anywhere
Then sdk/body's locomotion (its chooser, matching and foot holds) brings the body to the take's standing
place from wherever it is, with a stop that doesn't slide, on any body that has a library
And a low thing's bend is checked against the library's pick-low and lift captures, and takes its shape
from them where they fit (the back straighter, the head up)
@needs:HG5
Scenario: HG8. Things with a way to be held
Given a thing that is held one way (a mug's handle, a sword's grip, a door's handle, a phone, a bag's strap)
Then its holds come with the thing, as places and hand shapes, from the 35 captured hand poses
(character/captured.ts) where one fits
And a thing with no holds of its own gets HG2's
And a hand shape is scored against the hand prior (HG5b) before it is kept
@needs:HG5
Scenario: HG9. Using what is held, and handing it over
Then a held thing can be aimed, swung, drunk from, set to the ear, pushed, pulled and turned (a door, a
drawer, a lever), each a path for the thing that the hands follow
And a thing passes from one hand to the other, and from one character to another, with no frame where
nobody holds it
@needs:HG5
Scenario: HG10. Weight
Then a heavy thing is held low and close, the trunk leans back against it, the elbows straighten, and the
lift is slower; a light one moves with the wrist
And a throw's wind-up and follow-through scale with it
@done
Scenario: HG19. On SOMA's own skin a held thing has no skin of the hand in it
# 11-15, the audit (tools/hands-audit) on SOMA's body: fingers stood 17 to 36 mm inside a held box and cup.
# Three causes, each in the system. A joint bent until its own bone met the surface, and carried the bones
# past it in (a knuckle 60 degrees onto a box's face, the next two bones 24 and 35 mm inside): it now stops
# when any bone past it meets. The curl read each bone's skin as riding that bone alone, where the skin is
# carried by several joints' weights (the ball of the thumb is half the hand's): it reads it as drawn. And
# the ball of the thumb is the palm's: the hand's frame sets the palm's height on it too, and only on skin
# the hand mostly carries itself (the web to the thumb stood 13 mm proud). Now, worst over each take: 0 to
# 1 mm in the thing (3 mm passing a cup hand to hand), 4 to 5 pads on, the palm 1 to 6 mm off.
# Then the table (fingers 20 to 37 mm into it at a box's grab) and the body's own thighs. A reach leans the
# chest, and the second hand's lean carried the first hand 6 cm off its hold with its fingers still shaped
# for the hold: every hand but the last is solved again with the trunk left where it is. A travelling hand is
# kept off solids by its skin as its fingers are that frame (opened, they go further than at rest). The
# audit's own standing pose hung SOMA's fingers 31 mm inside the thighs before any take began: it now hangs
# the arms as near the sides as keeps them out. Five of the six takes now: 0 to 2 mm of hand in the thing,
# none in the scene, 0 to 6 mm in the body's own solids, every holding hand's five pads on. The sixth (a
# box from the floor to a table, squatting) still has 8 mm in the box, 20 in the table and 50 in the thighs.
Given SOMA's body, its skin samples on the joints that carry them
Then through each of the audit's six takes no skin of a hand is more than 3 mm inside the thing it holds
And every hand that holds has four pads or more on it, its palm within 6 mm
And no skin of a hand or forearm is in the scene's solids, nor more than 6 mm in the body's own
Rule: Wider, for the character SDK
Scenario: HG11. Creatures' motion from generated video
# patch-gg/anymove, Apache-2.0. raea's animals have no captures (the dog and cat were called stiff, 11-14).
Given a rigged creature made skeleton first
Then its moves are captured from a generated two-view video, the joints read in both views, the rig fitted
And the model that reads joints runs on hardware a user has, or the step is a cloud one and says so
Scenario: HG12. Motion from words, between poses
# Kimodo (Apache-2.0 code, weights' licence to be read in full first). MotionBricks only if its licence
# turns out to allow it.
Then a situation the library has no capture of is filled by generated motion on the rig, retargeted from
SOMA's skeleton once, and judged against the captures by the same detectors
Scenario: HG15. Twist joints, so a turned limb keeps its thickness
# 11-15, measured, not built: a decision for the user, since it adds joints to every body. On turbo's
# skin a hand turned 90 degrees thins the wrist to 71 per cent of its radius at the thinnest ring (26 per
# cent at 150 degrees); moving the turn to the elbow (forearm_twist, what a take does today) moves the
# same pinch to the elbow. The same turn spread over four twist joints along the forearm (arm.rs
# `twist_joints`, SOMA-X's shares) keeps 97 to 99 per cent everywhere, and the upper arm reads the same
# (71 against 98). The joints would be helpers a body's build adds and the engine drives: no pose,
# capture or call names them, so the 52 joints stay the standard.
Given a body built with four helper joints along each forearm, upper arm, thigh and shin
Then the engine sets them from the limb's two ends each frame, and a turned hand pinches no skin
Scenario: HG13. A body that reacts
Then a pushed or struck character gives way and recovers (the ragdoll looked at again, with a physics
crate chosen for the whole engine first: there is none in the workspace today)
And a hand or a foot can brace on a wall, a rail or the floor as a contact found the way holds are
Rule: SOMA is the standard body for people, decided by the user 11-15
# After HG12b and HG15 the user asked which body works best with generated motion and a generated head, and
# decided: standardize on SOMA (NVlabs/SOMA-X, Apache-2.0). Its skeleton is the one Kimodo generates on, so
# motion plays with no retarget; its rig has the twist joints HG15 measured the need for, and pose
# correctives; its own body and hand shape models are Apache-2.0 (MHR and Anny are optional backends; SMPL is
# separately licensed and not used). It ships a bare body: 18,056 vertices with UVs, eyes, teeth and tongue,
# no texture, clothes or hair. The 52-joint game_engine rig and the people built on it are what this
# replaces; animals keep their own rigs (HG11). HG15 is answered by this: the twist joints come with the rig.
@done
Scenario: HG16a. SOMA's own body plays generated motion in raea with nothing fitted
# 11-15. SOMA's template rig (110 joints: 78 named ones and 32 twist joints) is read in Blender, posed
# frame by frame from a Kimodo motion's own joint turns (given from SOMA's T-pose, for 30 joints, with
# the hips' place), its twist joints set by SOMA's shares (0.05, 1/3, 2/3, 0.95: a forearm or shin takes
# up its far joint's turn, an upper arm or thigh undoes its own near its start), and saved as a glTF
# clip that `<Model animation>` plays. Shown beside turbo following the same run and leap through the
# retarget. The largest limb twist in that motion is 77 degrees. Not yet: the body as a `<Character>`,
# posed by the engine each frame; its shape model; its correctives; any surface but plain grey.
Then a Kimodo motion plays on SOMA's body as the model made it
@done
Scenario: HG16b. `<Character>` poses SOMA's body from a generated motion's own joint turns
# 11-15. A body folder made from SOMA's template rig: body.glb skinned to flat joints under SOMA's names,
# skeleton.json with rig "soma" (the 77 named joints, then the 32 twist joints marked as helpers; SOMA's
# fixed Root frame is left out, so the hips are the root as in every raea body), each joint's turn from
# bind to SOMA's T-pose, and 2,024 skin samples by part. A pose is then arithmetic: a joint's world turn
# is Kimodo's turn after the turn to the T-pose, a joint Kimodo does not name follows its parent, the
# twist joints take SOMA's shares, and each joint's turn is taken relative to its parent. `<Character
# body="soma">` drew the run and leap with no change to the SDK. The body's build and the clip's
# conversion are scripts in the test project for now (tools/soma_body.py for Blender,
# tools/kimodo_clip.py): HG16 moves them into the SDK. The pose itself is in the SDK: raea-sys-body
# turns.rs `from_turns` and `set_twists`, the native call character.turns, raea/character's `turnsPose`;
# the same frame drawn through it matches the composition's own arithmetic (SSIM 0.999996).
Then SOMA's body is posed by `<Character>`, its twist joints included
Scenario: HG16. A SOMA body is a raea body
Given SOMA's rig as a body folder (its 78 joints by SOMA's names, metres, with the twist joints as helpers)
Then `<Character>` poses it, raea-sys-body knows its joints' roles and limits, and the engine sets its twist
joints each frame (arm.rs `twist_joints`)
And a take (reach, grab, carry, put down, throw) runs on it and passes the audit that turbo's takes pass
And a motion on SOMA's skeleton is played as it is, with `from_soma` kept only for other rigs
@needs:HG16
Scenario: HG17. Different people from SOMA's shape model
Then a body's build takes SOMA's shape numbers (its own model's 128, or Anny's measures for age and build)
and writes the body folder, so a cast is a list of numbers and not a set of hand-made meshes
And SOMA's pose correctives are applied, in the engine or baked as shapes, with the cost of each measured
@needs:HG16
Scenario: HG18. A surface: skin, clothes, hair, and the generated head
Then a SOMA body has a skin texture, clothes and hair made by raea, or its surface is the drawn or
generated one with SOMA as the hidden driver
And the generated head replaces the body's head from the collar up, skinned to SOMA's Neck1, Neck2 and
Head and using its eye joints, the face's skin colour carried across the seam
+211
View File
@@ -0,0 +1,211 @@
@spec
Feature: img2raea: a picture made into raea objects, props, environments and scene data, and held to three.js
Goal, 2026-11-16: "lets work on the img2threejs as also a way to get 3js perfect parity and how we can expand the
skill for our own skills like img2raea and how we can do the same with environments, scene data, and what places we
can use procedural tools or nueral networks or any kidn fo machine learnign to get it right".
img2threejs (github.com/img2threejs/img2threejs, Apache-2.0, read at 0c0c49bc) is an agent skill that turns one
picture into a procedural three.js model: a factory, `createXModel(): THREE.Group`, built in gated passes (blockout,
structure, form, material, surface, lighting, interaction, optimisation) against an ObjectSculptSpec, each pass
checked by renders in a browser (the "Divine Eye" views, a turntable, self-intersection, attachment and chirality
gates). Its showcase (img2threejs-showcase, 638b5c73, three ^0.169) has no licence and holds other people's IP, so
it is measured locally and never committed; the corpus we keep comes from running img2threejs on our own pictures.
Found on 11-16: a factory runs in raea unchanged as `<R3F><primitive object={createXModel()} /></R3F>` (the Talon
knife, its tick animation included). So img2threejs's output is already raea's input; what is left is making the
two renderers agree (parity), giving the skill a raea target (img2raea), and doing the same for places and scenes.
Rule: three.js parity, measured on img2threejs's output
@needs
Scenario: IR1. The showcase as a parity corpus
Given the showcase's single-file factories (15 on 11-16: a rifle, a bike, three knives, a chest, a house, a
mascot, a pistol, a shotgun, a humanoid, earbuds' case, a rocket, a truck), fetched at a pinned commit into a
cache outside git
When each is centred, scaled to 2 m on its longest side, seen from one camera at 640 x 400, and drawn by raea's
<R3F> (`raea render`) and by three.js's own <Canvas> in headless Chrome (sdk/r3f/tools/chrome.ts: Chrome only as
three.js's reference renderer, as R3F8 uses it)
And under four rigs: neutral (a hemisphere and two directional lights), direct (the two directional lights),
dark (direct with an ambient light of 0) and lookdev (the author's own lights, moved and scaled with the model)
Then each pair is scored on the model's own box (the union of both pictures' non-background boxes, padded 8 px):
SSIM and RMSE there, the frame's SSIM beside them; the frame's SSIM is not the score, as a model that fills a
tenth of the frame scores 0.99 with its face missing
And the plan
| crate | file | lines | job |
| tools | tools/img2raea/parity.sh | 80 | fetch the pinned showcase into ~/.raea/cache, run both sides, score, sheet |
| tools | tools/img2raea/shoot.ts | 70 | three.js's side: the page bundled with sdk/r3f's three and R3F, shot |
| tools | tools/img2raea/scene.tsx | 80 | one case's scene for both sides: fit, seeded Math.random, the four rigs |
| tools | tools/img2raea/score.sh | 40 | crop to the model's box, SSIM and RMSE, side-by-side pairs, contact sheets |
And 11-16, so far: built and run in a scratch folder (not yet in tools/): 60 cases in 6.5 minutes on this Mac,
raea's renders 5.8 GB peak; 14 of the 15 factories draw (the humanoid throws: IR6); under the dark rig 12 of the
14 score 0.95 or better on the crop (the rocket 0.81: IR4; the chest 0.94: its gold edges' highlights); under
the neutral rig the earbuds' case, the rocket and the chest fall to 0.80-0.84 (IR3); the mascot scores 0.976
with its face missing (IR5), so a per-part or edge score has to join SSIM before 0.95 can mean "the same"
And not yet diagnosed: the bike's tyre lettering is missing in raea (a canvas texture repeated -1 x 1, so a
negative repeat is the first suspect) and the truck's ground ring loses its soft glow (additive blending is
mapped, input/material.ts, so something else)
@done
Scenario: IR2. No ambient light means none
Given a three.js scene with no AmbientLight, HemisphereLight or LightProbe
Then raea draws it with no ambient light either
And today it doesn't: <R3F> sends no ambient, so the camera falls back to Bevy's GlobalAmbientLight (white, 80),
which raea never sets; a metal then shows its colour everywhere where three.js shows black outside its
highlights (the earbuds' copper lid, the chest's gold corners, a knife's blade)
And measured 11-16: the earbuds' case, direct rig, crop SSIM 0.83; with an explicit <ambientLight intensity={0}>
0.996; the chest 0.88 to 0.94, the Gerber knife 0.94 to 0.98
And the fix is one of: sdk/r3f's input/lights.ts sends AmbientLight 0 when the scene has none, or raea's engine
sets GlobalAmbientLight to 0 (a raea scene without an ambient light would then be darker too: decide which)
And 11-16, built in sdk/r3f (input/scene.ts convert): a scene with no AmbientLight, HemisphereLight or LightProbe
gets an AmbientLight of 0, white so it lends no colour (raea sums a camera's ambient lights and takes the first
non-white one's colour, so a composition's own AmbientLight beside the <R3F> is kept as it was); the engine's
GlobalAmbientLight is unchanged (Shane's call, through the 0.1.6 release session). Measured: under the direct
rig the earbuds' case 0.83 to 0.996, the Gerber knife 0.94 to 0.98, the chest 0.88 to 0.94, the mascot 0.96
to 0.99; R3F8's 43 cases as before (one, in-drei, 0.9935 to 0.9943); test/input.test.tsx "ambient light"
@needs
Scenario: IR3. three.js's ambient lights only diffuse
Given a three.js AmbientLight or HemisphereLight
Then it lights a surface's diffuse colour only, as three.js does (irradiance x diffuse; a metal has none)
And today raea's AmbientLight is Bevy's, which also lights specular through the environment BRDF, so under a
hemisphere light a metal glows evenly: the earbuds' case, neutral rig, crop SSIM 0.80
And the fix: a diffuse-only ambient for lights read from three.js (an ambient term raea's PBR shader can switch,
or the hemisphere light as an irradiance-only environment)
@needs
Scenario: IR4. Anisotropic metal
Given a MeshPhysicalMaterial with anisotropy and anisotropyRotation (the rocket's brushed steel: 0.65, pi/2)
Then raea's highlight stretches along the brushing as three.js's does
And today the steel blows out in hard white and black halves: crop SSIM 0.81; with anisotropy 0, 0.94
And what to check first: the mesh's tangents (Bevy's anisotropy reads ATTRIBUTE_TANGENT; a three.js geometry
has none unless computed), then the rotation's sense and the strength's mapping
@needs
Scenario: IR5. Overlays drawn without the depth test
Given meshes with material.depthTest false and a renderOrder above the body's (the mascot's eyes, mouth and
cheeks: decals whose vertices lie on the body shell, drawn on top in renderOrder 3 and 4)
Then raea draws them after the meshes before them, over what is already drawn, as three.js does
And today they are depth-tested and lost inside the shell: the face is missing (crop SSIM 0.976, which hides it:
the face is a small part of the box; IR1's sheet shows it); sdk/r3f passes depthTest on for a patched or
shader material (input/patched.ts, input/shader.ts) but not for the standard ones (input/material.ts), and
renderOrder is read only for render targets (input/targets.ts)
And 11-16, built in sdk/r3f: a basic material drawn without the depth test is three's own basic program
(shader.ts builtinPart, as matcap and normal are), a standard or physical one its patched program (patched.ts),
and any ThreeShaderMaterial without the depth test goes with the transparent ones, after everything opaque, as
raea's opaque pass has no order; the mascot's face is drawn (crop SSIM 0.96 to 0.99 under the direct rig);
test/patched.test.ts "a material drawn without the depth test"
And left: renderOrder among such overlays (the eye's highlight over the eye) is still raea's transparent sort,
by distance; three's order needs a sort bias from renderOrder in raea-sys-three-shader (Material::depth_bias),
an engine change
@needs
Scenario: IR6. A browser's globals a factory reads
Given a factory that reads window.location.search (the humanoid's debug switches) or other browser globals
Then raea's JS host has a location (about:blank's: an empty search), so the factory runs
And today the composition throws at frame 0: "undefined is not an object (evaluating 'window.location.search')"
Rule: img2raea, the skill
@needs
Scenario: IR7. img2threejs with raea as its target
Given img2threejs's emission target socket (docs/EMISSION_TARGET_SOCKET.md: `--target <kind>`, a plugin step
with `provides`, run after the model is action-ready)
When a raea target plugin is added, installed as ~/.img2/plugins/raea/ and read by their forge/_shared/targets.py:
plugin.json `{"schema": 1, "id": "raea", "requires": {"harness": RANGE, "coreApi": 1}, "capabilities":
[{"from": "sculpt-spec", "to": "raea-tsx"}]}`, and a steps.json row `{"id": "emit-raea", "command":
"{plugin_dir}/emit.sh {workspace} {spec}", "provides": {"version": 1, "from": "sculpt-spec", "to": "raea-tsx",
"artifact": {"kind": "raea-tsx", "path": ".img2/artifacts/raea/model.tsx"}}}`, its gates in gates.json
Then `--target raea-tsx` writes a raea composition that draws the factory (`<R3F><primitive
object={createXModel()} /></R3F>`, its tick from useFrame) and its lights, beside the factory, the same bytes
on every run (their socket runs a target twice and refuses a mismatch)
And raea is the render authority for the gates that need pictures:
| img2threejs gate | raea |
| Divine Eye views | `raea render EDIT.tsx --review DIR`: hero, front, right, top, iso, low, colour and clay |
| turntable | a composition turning the model, `raea render` to frames |
| self-intersection | `raea scene lint` (clipping), `raea scene explain` |
| attachment anchor | `raea scene lint`: what rests on what, what floats or sinks |
| surface and lighting pass | `raea render --aov` (normals, depth) and the light meter |
| chirality | the review's front and right views against the reference |
And the gates also pass IR1's parity on the model, so what the skill approved in raea looks the same in three.js
@needs
Scenario: IR8. img2raea in raea's own skill
Given the raea skill (skills/, the public raea-skills)
Then it teaches the same method natively, credited to img2threejs (Apache-2.0: its NOTICE kept with what is
adapted): the picture read into a spec of parts (ObjectSculptSpec's fields), then built in passes in raea's
own vocabulary, each pass checked by `raea render --review` before the next
And raea's vocabulary for it: core/shape's CSG for hard surfaces, core/sdf for organic ones, core/grow for the
numerous (leaves, rocks, terrain), raea's standard material and systems/procmat for surfaces
And a picture's thing can come out as either: a three.js factory raea draws (IR7), or a raea part
@needs
Scenario: IR9. Tried on our own pictures
Given pictures we make (`raea gen image`, under $10) of a prop, a hard-surface thing and a character
When img2raea builds each
Then each is scored against its picture from the picture's own view: the silhouette's IoU (SAM 2's mask of the
picture against raea's alpha render), and SigLIP's similarity of the two crops (on the CPU: Core ML's GPU path
gets SigLIP wrong on this Mac)
And these become the kept corpus (CC0, ours), in IR1's runner beside the showcase
Rule: Scene data
Scenario: IR10. A three.js scene's geometry in scene lint, explain and export
Given an R3F or <Three program> scene, whose geometry raea holds as <BufferMesh> shape "buffer:{positions,
indices, normals, uvs}"
Then contact, `raea scene lint|explain` and `raea scene export` read it as its triangles, and export writes each
such part as GLB (POSITION, NORMAL, TEXCOORD_0) and OBJ (v, vn, vt), without Manifold, as it needn't be closed
And 11-16: built on branch img2raea (core/shape/src/buffer.rs; raea-sys-mesh re-exports buffer_tris), unit tests
in core-shape and interchange pass; before it every such part stopped `raea scene` with "unexpected ':' in a
shape"; the knife's end-to-end export waits for a raea rebuild
@needs:IR10
Scenario: IR11. Materials go with the geometry
Given a part `raea scene export` writes as a mesh
Then its GLB carries its material (base colour, metallic, roughness, emissive, the maps raea has as files), so
Blender and Godot open it looking as it does in raea, not grey
@needs:IR10
Scenario: IR12. An import measured both ways
Given a scene exported by `raea scene export` (scene.json and its meshes)
When it is opened in three.js and in Blender
Then it is held to raea's own render by IR1's scoring from the same camera, so import and export are measured
as the R3F parity is
Rule: Environments
@needs
Scenario: IR13. A place from one picture
Given a picture of a place (a room, a street, a clearing)
Then it is made in raea in stages, each checked against the picture from its camera:
| stage | what | how |
| camera | the lens's field of view and the camera's height and tilt | MoGe-2's point map (MIT, ViT-S 35M) |
| layout | the ground and walls as planes, so things stand on them | planes fitted to the point map (RANSAC) |
| things | a mask and a name for each thing | SAM 2.1 (Apache-2.0), OWLv2 (Apache-2.0) |
| props | each thing as a part at its depth and size | img2raea (IR8), or an image-to-3D model |
| far away | what has no depth worth building: a panorama or splat behind | <Environment>, <Splat> (raea splat) |
| light | the sun's and sky's direction and colour, then exposure | the picture's shading; systems/light-meter |
| contact | nothing floats, sinks or clips | `raea scene lint` |
And what can be made procedurally is: terrain, rocks and trees by core/grow, grass by systems/grass, floors and
walls by systems/procmat, the picture giving their settings rather than their meshes
Rule: Where procedural tools, neural networks and measurement belong
@needs
Scenario: IR14. The map
Then each step uses what gets it right on this Mac (16 GB first) under a commercial-permissive licence:
| step | method | model or tool | licence |
| parity score | measure | crop SSIM and RMSE now; LPIPS or DINO next | ours |
| a thing's mask | neural | SAM 2.1 (Core ML build exists) | Apache-2.0 |
| a thing's name | neural | OWLv2; Apple Vision (systems/vision) | Apache-2.0; system |
| depth, lens, normals | neural | MoGe-2 ViT-S; Depth Anything V2 Small, DA3 Small, Base, Mono-L, Metric-L | MIT; Apache-2.0 |
| parts of a thing | procedural, fitted | core/shape CSG, core/sdf, core/grow | ours |
| a fit's settings | search, judged by measure | render, score against the picture, adjust (CMA-ES or coordinate search) | ours |
| a whole object's mesh | neural, as a reference or a start | TripoSG (geometry only, about 8 GB) | MIT |
| a character | neural | Idol (sheet3d's route, about 3 GB) | as docs/character.feature |
| how close to the picture | neural, as a critic | SigLIP 2 (on the CPU), silhouette IoU | Apache-2.0; ours |
| a surface's look | procedural, fitted | systems/procmat's kinds, colours from the mask's lit pixels | ours |
And left out, by licence or size: Depth Anything V2 Base and Large and DA3 Large and Giant (CC BY-NC), Depth Pro
and SHARP (research only), Hunyuan3D (not the EU, UK or South Korea), TRELLIS.2 (MIT but 24 GB: a reference to
compare against, not a step), SAM 3D Objects (SAM Licence, no published memory, reported out of memory at 20 GB)
And neural models make or name things; measurement decides whether they are right; procedural parts are what is
kept, so a result can be edited as raea's own parts rather than as a mesh no one can change
+230
View File
@@ -0,0 +1,230 @@
Feature: Index: every picture and video you have, searchable in minutes (0.1.5)
Shane, 11-14: "the big thing I need you to ship in 0.1.5 is the fastest fucking indexing tool for videos and images
on the OS and on your phone/photos/icloud ... a plugin that is able to do this for google drive, apple photos and
icloud and locally or on a local drive of course. if free that index just stays local. if pro or team we can factor
it into their plan. ITs vital that a wow moment is just how fast we can index tons of content, embed it all and
manage those embeddings across search." 0.1.5 carries this and the 0.1.4 feed fixes; Character SDK moves to 0.1.6.
This builds on Libraries (docs/libraries.feature): its libraries, sources, local index, cloud index (turbopuffer
through raea-api) and fused search stay. What changes is the first pass. Today a file is hashed, cut into shots and
embedded by EmbeddingGemma 2 on the CPU before it can be found: LB1 took 316 s for 25 files, 12.6 s a file. A
photo library of 50,000 would take a week. EmbeddingGemma 2's picture tower is a 16-layer ViT over up to 2,520
patches, about 0.9 TFLOP a picture, so no runtime makes it the first pass.
So indexing has two passes:
- the fast pass: every picture, and a few frames of every video, through SigLIP 2 B/16-256 on the Neural Engine,
from the small copy the file or Photos already holds, searchable by words through SigLIP 2's text tower. Minutes
for a whole library.
- the deep pass (Libraries as it is): shots, sound, transcripts and EmbeddingGemma 2, in the background, after
the fast pass, never on battery. It adds what's said and heard, and better ranking for video.
Measured 11-14 on this Mac (M5 Pro), with nothing else changed (ixbench in the scratchpad, 600 real files, mostly
big PNGs with no embedded preview, the worst case for decoding):
| step | per second | note |
| ImageIO thumbnail decode to 256 px, all cores | 383-399 | JPEG and HEIC with a preview are faster |
| SigLIP 2 B/16-256, Core ML, CPU + Neural Engine | 194-200 | batch 32 or 64; cosine 0.9985 to fp32 (10-16) |
| the same on Core ML's GPU | 297 | wrong vectors on this Mac (coreml-gpu-siglip) |
| EmbeddingGemma 2, q8 on CPU (LB1) | 0.08 files | 12.6 s a file, shots and sound included |
Rule: The fast pass
Scenario: IX1. A picture is found by words seconds after raea sees it
Given a source with pictures (a folder, a drive, Photos, iCloud Drive, Google Drive)
When the fast pass runs
Then each picture is listed (its place, size, dates, dimensions), decoded to 256 px from its embedded preview
when it has one (ImageIO; PhotoKit's own derivative for Photos), and embedded by SigLIP 2 B/16-256 on Core ML's
CPU and Neural Engine, 32 at a time, while the next batch decodes
And its vector (768 f16, normalised) and a 256 px JPEG thumbnail are written as soon as its batch is done, so
search finds the first pictures while the rest are still going
And an item is keyed by where it lives (a path, a Photos asset, a Drive file id) with its size and dates; its
sha256 comes with the deep pass, or when the original is read anyway. The fast pass never reads a whole
original only to hash it
And sustained, it runs at 150 pictures a second or better on an M-series Mac with nothing else heavy running
(bench/index), and says how fast it went
Scenario: IX2. A video's first pass is a few frames
Then a video gets its poster and one frame every 4 s, at most 16, from the nearest sync frames (AVFoundation,
VideoToolbox's hardware decoder), each a row with its time, so "the dog jumps in the pool" finds the moment
And a video is listed with its length and dimensions before its frames are read
Scenario: IX3. Search reads both passes
Then a query's words are embedded by SigLIP 2's text tower (ONNX on CPU, one query in milliseconds) and scored
against every fast-pass row (brute force over f16 rows in Rust, fast enough to a million rows), and by
EmbeddingGemma 2 against the deep pass's rows as now
And the lists are fused by site/api src/library/fuse.ts with the fast list as one more list of its own weight and
MARGIN, measured on LB1's queries plus a photo set before the weights are set; a model's vectors are never
scored against another model's
And a picture or a frame can be the query ("more like this"), against the fast rows
And results show the thumbnails, grouped per file, with the moment for a video
Status 11-15: the Library's Search asks the Index beside the libraries and shows its hits as a list of their own
("On this Mac": one per file, a video at its best moment, a press shows it in Finder; raea-feed #37); a
described sound isn't asked of it, and the host doesn't start the indexer for a Mac that never indexed
anything. A picture is a query on the Index page (raea-feed #40): a tile's corner button asks serve's similar
op for more like it, said in a chip over the field. Not yet: one fused ranking (the weight and MARGIN need
LB1's queries plus a photo set measured), and agents' `raea library search` reading the fast rows
Scenario: IX4. The deep pass follows
Then once a source's fast pass is done, Libraries' indexFile runs on its videos, sounds and words at low priority,
through antsy, never on battery, its own files before claimed jobs (LB6b)
And a picture needs no deep pass to be found; its EmbeddingGemma 2 row comes when the deep pass reaches it
Rule: Sources
Scenario: IX5. This Mac's folders and drives
Then a folder or a drive is listed fast (getattrlistbulk through fts, skipping packages, caches and raea's own
media), watched with FSEvents, and a drive's mount and unmount set it online or offline (Libraries' volume
sources); an offline drive stays searchable from its thumbnails
Scenario: IX6. Apple Photos, and so iCloud Photos and the iPhone's camera roll
Then turning Photos on asks macOS once (raea.app's NSPhotoLibraryUsageDescription; read-only, never a change to
the library)
And every asset is fetched from PhotoKit at once (PHAsset, newest first), each picture's 256 px image requested
from PHImageManager (its local derivative; one only in iCloud is fetched at that size when "include photos only
in iCloud" is on, by default), a video's frames from its local AVAsset, else its poster
And an asset is keyed by its local identifier; its dates, place, favourite and media subtypes (screenshot,
selfie, live photo, slo-mo) become filters
And photos taken on the iPhone arrive through iCloud Photos and are indexed as they land (PHPhotoLibrary's change
observer)
Scenario: IX7. iCloud Drive
Then iCloud Drive is a folder source (~/Library/Mobile Documents/com~apple~CloudDocs); a file kept only in iCloud
is indexed from its Quick Look thumbnail (QLThumbnailGenerator) without downloading it, marked "in iCloud", and
downloaded only when opened
Status 11-15: until the Quick Look path, a file kept only in iCloud (SF_DATALESS) is left out and counted
(walk.rs cloud_only; Progress.cloud, and the CLI says "N only in iCloud, left out"). Reading one downloads its
original: on this Mac all 3,849 iCloud Drive files were cloud-only, 2,245 of them pictures and videos, and
switching iCloud Drive on would have pulled every one down
Measured 11-15 for the Quick Look path (a Swift probe, QLThumbnailGenerator at 256 px, .thumbnail): 40 cloud-only
pictures and videos gave 40 thumbnails in 23 s at once (1.7 a second, iCloud serving them about one at a time)
and every file was still dataless after; the same 40 again took 0.02 s (Quick Look's cache). So cloud-only
files can go in as a slow second stage after the local ones, about 20 minutes for this Mac's 2,245, with no
download
Built 11-15 (cloud.rs): a folder's cloud-only files in iCloud Drive are listed and go in after its local files,
from Quick Look's thumbnail, eight asked for at once; a batch waiting on them is written after a second, so
each lands as it comes. Measured: 40 fresh cloud-only pictures and videos searchable in 17.9 s (2 a second),
all 40 still dataless after; a mixed folder (3 in iCloud, 2 local) searchable whole, and words found one of the
iCloud ones. Cloud-only files of other providers (Google Drive, Dropbox under ~/Library/CloudStorage) stay out
and counted until each is shown to answer Quick Look without a download. Not yet: marked "in iCloud" on the
page, and downloaded only when opened (the original isn't opened from the Index yet)
Scenario: IX8. Google Drive
Then through the Drive connection (raea-api src/connect; Drive is live since 11-11), raea-api lists the Drive's
pictures and videos (files.list: id, name, mimeType, md5Checksum, imageMediaMetadata, videoMediaMetadata,
thumbnailLink) and hands the Mac each thumbnail through the API; the Mac embeds it. The token stays in raea-api
And a Drive of 20,000 pictures is searchable without one original downloaded; an original streams through the API
(LB6's job media route) only when opened or deep-indexed
And Google Drive for desktop's own folder (~/Library/CloudStorage/GoogleDrive-*), when it is there, is a folder
source like any other
Status 11-15: the folder route is built (raea-feed #36: Google Drive, Dropbox, OneDrive and Box are Index
switches when their app mounts them; their local files go in at full speed, online-only ones are left out and
counted until each provider is shown to answer Quick Look without a download). The API route is blocked on a
scope: raea-api's Drive connection asks drive.file, which reaches only files picked in Google's Picker, and a
picked folder shares the folder alone, never its contents (Google's docs; checked against developer reports
through 2026-10). Listing a whole Drive needs drive.readonly or drive.metadata.readonly, restricted scopes that
need Google's restricted-scope verification and a yearly security assessment (CASA) before a public app may
ask for them. Shane's call (open question 3)
Built 11-15 inside drive.file (raea-feed #41): files picked in Google's Picker go in. The Index's Google Drive row
connects a Drive and opens the Picker in the browser; the feed's host takes the connection's token for the
picked files from raea-api (the Picker page's own, GET /v1/connections/ID/token) and fetches Drive's thumbnail
of each picture and video at 512 px into a folder beside the index, one per connection, which the indexer reads
as a folder source. The token goes only to Google's hosts and no picture reaches raea-api, so Free can do it
and raea-api needed no change. A picture Drive has no thumbnail of is fetched once and made small with sips; a
video Drive hasn't pictured, a folder, a document is left out and said. A hit carries the file's Drive name
and opens its page in Drive. Measured on the real indexer with a fake Google: 4 picks searchable in 25 ms of
fetching plus one batch, each found by words under its Drive name. Tried 11-15 on a real Drive account: a video
picked in Google's Picker went in from Drive's thumbnail in 1.2 s, came first for words describing its picture
(0.20 against 0.06 for the next), and opened its page in Drive. The Picker's API key must list
https://docs.google.com/* among its websites beside raea-api's: the Picker runs in a frame there and shows "The
API developer key is invalid" without it (Google's web-picker guide). Not yet: the Picker showing only pictures
and videos (the page is raea-api's, shared with Libraries), and a whole Drive without picking (the scope
question above)
Scenario: IX9. The phone itself, later
Then 0.1.5 reaches the phone's library through iCloud Photos on the Mac. Indexing on the iPhone in raea's iOS app
(PhotoKit on the device, its Neural Engine, the same model) waits for its Photos usage string and a TestFlight
build in App Store Connect
Rule: Plans
Scenario: IX10. Free keeps the index on the Mac; Pro and Team also keep it in raea's cloud
Then on Free every source is indexed and searched on the Mac, and nothing leaves it (Libraries' local index)
And on Pro and Team the index (vectors, thumbnails, the words and labels, never the media) also goes to raea's
cloud through raea-api, so the library is searchable from raea.io, the iPad and the account's other Macs; a
Team's workspace index is shared by its members
And the cloud index counts toward the plan: its thumbnails and vectors as storage bytes (about 20 KB an item),
shown on Settings → Storage beside media; what each plan includes is Shane's call (open question 1)
Status 11-15, built for the account's other Macs and going out in 0.1.5: the indexer hands out its rows and a
search's query vector (systems/index export.rs, serve's rows op and search vector: true; 0722ce3ae); raea-api
keeps each Mac's rows in turbopuffer, one namespace per account (a Team's org), a row taken only with a
thumbnail the person has in storage, refused on Free (402) (private 3b99935, POST /v1/fast/rows, search,
forget; test/fast.sh); the feed copies each run's new rows there and merges the other Macs' hits into the Index
page's search by score, each tagged with its Mac, a picture both Macs have shown once, and a removed source
forgotten (raea-feed #44, merged 25a526b). Measured live on the real indexer and raea-api on wrangler dev: 3
rows sent in 75 ms; the other Mac's search answers in 23 ms with them at the first Mac's own scores, the
thumbnail byte for byte. raea-api deployed 11-15 with Shane's OK (version 137b25ad); the plans count it as
storage only (Shane, 11-15): the thumbnails are the person's storage bytes, the vectors are free. Not yet: the
copy's bytes shown apart on Settings → Storage, raea.io and the iPad (they need a text tower on the server: the
query vector comes from the Mac)
Rule: Managing the index
Scenario: IX11. Settings → Index says what's indexed, where, by which model, and lets you change it
Then per source: found, fast-indexed, deep-indexed, waiting and failed, with its speed while it runs; pause,
resume, index again, and remove (its rows and thumbnails go; the files are never touched)
And per model (siglip2-b16-256@768, embeddinggemma-2@768): rows, bytes on disk, bytes in the cloud, and its
version; a model's vectors can be dropped and made again; a newer model makes its rows beside the old ones
and search moves over once it is done
And where it all lives (~/.raea/library), and a button that shows it in Finder
Status 11-15 (raea-feed #38): the Index page says its rows, its bytes on this Mac (database, vectors,
thumbnails), its model and its folder, which opens in Finder; a hit shows its file in Finder through the Index's
own reveal (only inside one of its folders). Not yet: pause and resume, index again, a model's rows dropped
and made again, bytes in the cloud
Scenario: IX12. The wow: the counter
Then turning a source on starts the fast pass at once and shows it: items found, items searchable, pictures a
second, and the newest thumbnails landing as a wall; search works from the first batch
And the first run on a library of 10,000 photos is searchable in about a minute on an M-series Mac
Measured 11-15 (IX14, bench/index on v0.1.5-rc4): 10,000 pictures searchable 55.7 to 57.1 s after `raea index
add` started, the first at 0.4 s, on an M5 Pro
Status 11-15 (raea-feed #39): the counter, the rate and the wall move in raea's own window, not only in Chrome:
the window has no EventSource, so /host/index/events also answers its long poll (?after=N). The Index spec
runs whole on raea's window (npm run e2e:blitz -- e2e/index.spec.ts, 4 of 4)
Rule: How it ships
Scenario: IX13. Where the work runs
Then the engine does the work, in its own crate (systems/index, raea-sys-index: sources, decode, embed, store,
search) on raea-sys-vision's Core ML (CpuAndNe), and `raea index` drives it: add, status, search, serve (a
resident process the feed's host keeps, JSON lines)
And the feed shows it: the Index plugin (its sources' switches and the counter), Settings → Index, and search,
which asks `raea index search` and the deep index and fuses them
And agents reach it as they reach Libraries: `raea library search` and the feed's library tools read both passes
Scenario: IX14. Measured, not guessed
Then bench/index runs the fast pass on a fixed public set (pictures and clips under permissive licences) and
prints pictures a second, video minutes a second, peak memory and recall@5 for a fixed list of queries; a
release doesn't regress it
Status 11-15: bench/index/run.sh [RAEA] [N]. Pictures: the first N of Open Images V4's validation set by id (CC BY
2.0, 1024 px JPEGs with no embedded preview; labels CC BY 4.0), downloaded once to ~/.cache/raea-bench/index.
Videos: Elephants Dream and Tears of Steel (CC BY, 720p H.264) cut once into 47 clips of 30 s. Each run indexes
into a new home. Unsplash's Lite set was read and dropped: its terms forbid publishing any of it and grant use
only for training. Each label has many pictures, so recall@5 is precision@5 here ("a photo of a dog": how many
of the five carry Open Images' verified Dog label), a floor since the labels aren't exhaustive. First numbers,
v0.1.5-rc4's Mac build on this Mac (M5 Pro), other sessions' jobs running:
| measure | 10,000 pictures | 1,000 pictures |
| searchable, from the command's start | 55.7-57.1 s | 8.2 s |
| pictures a second, as the indexer counts | 177-181 | 167 |
| the first pictures searchable | 0.35-0.42 s | 0.37 s |
| peak memory (raea's own process) | 244-266 MB | 195 MB |
| warm search, words to ranked hits | 12.8-18.8 ms | 19.4 ms |
| precision@5 | 0.879 (38) | 0.733 (12) |
Videos: 47 clips (23.2 min) searchable in 2.2 s, 10.5 video minutes a second, 371 frames each at its moment.
Not yet a release gate: nothing compares a release's numbers with these
Rule: Open questions for Shane
Scenario: To decide
Then 1. What Pro and Team include for the cloud index (items or bytes), and what past it costs
And 2. Whether Photos' "include photos only in iCloud" is on by default (it fetches each one's small copy over
the network)
And 3. Whether raea-api asks Google for drive.readonly (restricted: verification and a yearly CASA assessment) so
a whole Drive indexes without Drive for desktop, or Drive stays the desktop app's folder plus picked files
+159
View File
@@ -0,0 +1,159 @@
@spec
Feature: A render in layers: captions, text, graphics, footage and sound apart, for CapCut, Premiere, Resolve and raea's timeline
wackyza, 2026-11-16: "export a rendered video, in all its component layers (video, audio, graphics, all separate) to
Premiere, Resolve and Capcut ... keep graphics on one overlay track. Titles aka text elements should be their own
track. And captions, if applicable, should be their own track. I think this separation would be valuable for the
internal (in-app) timeline as well ... the best order of events might be to get the layers rendering really robust,
then be able to push it to the in-app timeline and all the ext editors".
A cut finished in another editor needs its parts, not one flattened movie. `raea export capcut` (docs/capcut.feature)
already hands CapCut the footage and sounds as clips of their own files and everything raea draws as one
transparent overlay. This spec takes that split out of the CapCut export, makes it finer (captions and text apart
from the other graphics), proves it against the render, and gives it to every editor from one place: CapCut,
Premiere Pro and DaVinci Resolve, and the layout of raea's own timeline.
What there is to build on (read 11-16):
- apps/capcut: the manifest's frames grouped into runs of footage and sound (plan.rs), the overlay rendered with
the footage hidden (RAEA_HIDE_MEDIA=1) and what's under it (RAEA_HIDE_MEDIA=under), written as a CapCut draft
(io/capcut). Its plan is written in CapCut's types, so no other editor can use it as it is.
- systems/layers: hide.rs hides layers by key (RAEA_HIDE_LAYERS) and the footage (RAEA_HIDE_MEDIA) as page CSS;
page.rs already calls an element whose children are all text "text", and footage "video".
- io/alpha: transparent movies without ffmpeg (CC1): ProRes 4444, HEVC with alpha, QuickTime Animation, PNG.
- sdk/timeline: tracks by kind (effect, text, overlay, main, sound, TL1a); the captions operation (TL7c) puts
lines on a track named Captions, and read.ts writes each line into the composition as a `text` op, the same op
a title is written with, so once in the code a caption and a title can't be told apart.
The layers, top to bottom, and what each is:
| layer | what it holds | what the editor gets |
| captions | the words said, as raea draws them (CA1) | a transparent movie + an .srt beside |
| text | titles and other words on the picture that aren't captions | a transparent movie |
| graphics | everything else raea draws over the footage: shapes, 3D, FX | a transparent movie |
| footage | each <Video>'s file, at its trims, place and size (CC2a) | clips of the original files |
| under | what raea draws beneath the footage: the backgrounds of what | a movie, left out when all black |
| | holds it (CC2b) | |
| sound | each sound clip, and footage's own sound linked to its clip | audio clips of the original files |
A layer with nothing in it is left out, and costs no render.
The passes cost time only at export. Rendering a composition, in the app or with `raea render`, draws it once, as
it does today; the marks LA1 adds are attributes in the code and draw nothing; raea's timeline reads the code (TL0c)
and renders no layer. Only `raea export` (layers, capcut, premiere, resolve) renders the layers, each pass once.
Background:
Given a composition renders with --manifest (render.json), as docs/capcut.feature's Background says
And the reference render is the composition as `raea render` draws it, every layer at once
Rule: LA1. Captions and text are marked, so every pass and every tool tells them apart
Scenario: LA1a. A caption carries data-raea-role="caption"
Given words drawn as captions: lines the captions operation (TL7c) wrote, or a caption the SDK or an agent draws
Then the element holding each caption's words carries data-raea-role="caption", and so does everything inside it
(a word highlighted as it's said is part of its caption)
And the captions operation's `text` ops say they are captions, and the code they write keeps the mark, so a
timeline read back from the code (TL0c) puts them on the Captions track again
And the raea skill's caption guide says to mark captions this way, and `raea check` names words that look like
captions (timed to the transcript, one line at a time, at the bottom third) and aren't marked
Scenario: LA1b. Text is what Premiere, Resolve and CapCut call text
Given a text item in each editor is words and their own style: Premiere's text layer (Essential Graphics),
Resolve's Text+, CapCut's text, each with its font, fill, stroke, shadow and a background box of its own
Then an element is text when it carries data-raea-role="text", or when it isn't a caption and its children are
all words (page.rs's "text"), and it draws as those editors' text does: its words, its stroke and shadow, its
own background
And the elements around it (a lower third's bar, a card, a shape) are graphics, as a shape is its own item in
each editor, so an editor can move the words apart from what they sit on
And an element can opt out with data-raea-role="graphics" (a logo set in a font, a number in a chart)
Rule: LA2. Each layer is a pass of its own, rendered transparent, only when exported
Scenario: LA2o. A render that isn't an export draws once
Given a composition with captions, text, graphics and footage
When it is rendered in the app or with `raea render`
Then it is drawn in one pass, in the same time as before this spec, and no layer is written
And an export of a version already rendered takes that render as its reference, and doesn't draw it again
Scenario: LA2a. The passes
When the composition is exported in layers
Then it is rendered once for each layer that has something in it, --alpha, with RAEA_LAYER naming the layer:
| RAEA_LAYER | draws |
| captions | only captions |
| text | only text |
| graphics | what RAEA_HIDE_MEDIA=1 draws today, less captions and text |
| under | what RAEA_HIDE_MEDIA=under draws today |
And RAEA_HIDE_MEDIA keeps working as it does, so `raea export capcut` from before this spec is unchanged
And a pass is cut into clips where it draws something, frames that draw nothing a gap (CC2b)
Scenario: LA2b. Captions also go out as SubRip
Then each run of frames a caption shows one line of words is an entry of NAME.srt: its words as the page shows
them (a word highlight doesn't start a new entry), its first frame and the frame after its last, in timecode
And the .srt is written beside the export for the person to upload to a network or keep, and no editor's
project imports it (the captions movie is what the timeline shows, in raea's own style)
Rule: LA3. The layers put back together are the render
Scenario: LA3a. The layers composited over each other match the reference render
Given the layers' movies and the footage's frames as the manifest places them
When they are composited bottom to top (under, footage, graphics, text, captions), each over the last
Then every frame matches the reference render within the alpha codec's error (CC1a's numbers), checked at
least at each clip's first, middle and last frame
And a frame that doesn't match names the layer and the element (its key, file:line:col) that draws there
Scenario: LA3b. What can't be pulled apart is moved, and said
Then a caption or a text element that something drawn after it covers goes down into the graphics layer, so
what's in front stays in front, and the export says which and why
And an element whose look depends on what's under it (mix-blend-mode, backdrop-filter, a mask over footage)
stays in the layer that draws what it mixes with, or is named when no layer can hold it
And CC2e's notes (filters, rotations, masks, notes and <Mix>) are said as they are
Scenario: LA3c. A fixture of each kind passes
Given fixtures: full-frame footage with a title and captions; a lower third (bar and words); a picture in
picture on a coloured card; captions with a word highlight; a title behind a graphic; 3D over footage
Then LA3a passes for each, and LA3b's moves and notes are the ones listed for it
Rule: LA4. One layered timeline, written by `raea export layers`, read by every editor's export
Scenario: LA4a. `raea export layers EDIT.tsx -o DIR` writes the layers and their timeline
Then DIR holds layers.json, each layer's movie, NAME.srt when there are captions, and reference.mp4 (the
reference render, to compare the editor's timeline against; on no timeline)
And layers.json says the frame rate, size and length, and the tracks top to bottom, each with its layer and
its clips: the file, where it starts and how long, its first source frame, its place and size, its gain and
fades, and the id of the clip it's linked to (footage and its own sound)
And it says what LA3b moved and what CC2e notes, the same lines the command prints
And it names no editor's format: CapCut's draft, Premiere's and Resolve's XML are written from it
Scenario: LA4b. The CapCut export reads it
Then `raea export capcut` is layers.json written as a CapCut draft, with a captions track and a text track
above the overlay, and apps/capcut's tests pass as before for a composition with no captions or text
And CapCut's tracks keep CapCut's order (TL1a): text above overlays above the main track, sound below
And reference.mp4 is copied into the draft's folder, on no track, where CC2d kept it only beside the draft;
every export's folder holds it, so the person can compare what the editor plays with what raea rendered
Rule: LA5. Premiere Pro and DaVinci Resolve take the same XML
Scenario: LA5a. `raea export premiere EDIT.tsx` and `raea export resolve EDIT.tsx` write an FCP7 XML project
Then each writes a folder: NAME.xml (xmeml version 5), the layers' movies, the .srt (LA2b) and reference.mp4,
which the sequence doesn't use
And the sequence has the composition's frame rate and size, its video tracks bottom to top under, footage
(main, then each picture in picture on a track above), graphics, text, captions, and its audio tracks below
And each clip of the original footage points at its file where it is, never copied (CapCut's draft copies,
since sandboxed CapCut reads only its own folder, CC2d), at its trim, scaled and placed to its
box (Basic Motion), at its gain (Audio Levels)
And a video clip and its own sound are linked clipitems, so they move together, and each editor's own control
separates them: in Premiere, Unlink; in Resolve, Link Clips off (Cmd/Ctrl+Shift+L); in CapCut, Extract audio
And the two commands differ only where Premiere and Resolve read the same XML differently (found in LA5b)
Scenario: LA5b. Premiere and Resolve open it as raea rendered it
Given the LA3c fixtures exported
When the XML is imported (Premiere: File, Import; Resolve: File, Import, Timeline)
Then every track and clip is where layers.json puts it, nothing is offline, and the frame at each clip's
middle matches the reference render
And which alpha codecs stay transparent in each is recorded here, with the version tested, and each command
uses the first that does
Rule: LA6. raea's timeline is laid out the same way (raea-feed, after LA1)
Scenario: LA6a. A timeline read from the code puts captions, text and graphics on their own tracks
Given a composition read as a timeline (TL0c)
Then elements marked or found as captions are on the Captions track, text on text tracks and other graphics
on overlay tracks, as LA1 says, so the timeline and the exports agree on what each element is
And they stay what TL0c makes them: clips that edit the code, not movies
Rule: LA7. The skill teaches it
Scenario: LA7a. The delivery guide teaches layers
Then sdk/guides/craft/motion/delivery.md says a cut an editor finishes goes out with raea export capcut,
premiere or resolve, that captions arrive styled on their own track with an .srt beside them, and that words
are fixed in raea and exported again, since the editors get them as pictures
And it says to mark captions (LA1a) and to pass on what the export notes
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "raea blender"
summary: "Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth."
order: 104
order: 106
sources: ["apps/tools/src/blender.rs", "apps/engines/src/blender_ts.rs"]
---
+45
View File
@@ -0,0 +1,45 @@
---
title: "raea bug"
summary: "Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed."
order: 129
sources: ["engine/cli/src/bug.ts", "engine/cli/src/cli.rs"]
---
Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed.
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
```sh
raea bug TITLE... --text TEXT [--command CMD] [--error TEXT] [--agent NAME] [--dry-run] (a bug in raea itself, not in your own composition, sent to raea's server with raea's version and the OS, no account needed: words only, paths, emails and keys taken out before it goes; five a day from a machine, the same bug again counted on the first report; --dry-run prints what would go and sends nothing)
```
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
## Flags
| Flag | Takes | What it does |
| --- | --- | --- |
| `--agent` | `NAME` | Who is reporting: the agent or harness's name (claude-code, codex, kimi). Unless said, `RAEA_AGENT`, else the harness raea finds it running under. |
| `--command` | `CMD` | The raea command that went wrong, as you ran it (paths in it are taken out). |
| `--dry-run` | – | Print exactly what would be sent, raea's version and the OS included, and send nothing. |
| `--error` | `TEXT` | What the command printed when it went wrong, up to 4,000 characters (paths, emails and keys taken out). |
| `--text` | `TEXT` | What you did, what you expected and what happened instead, up to 4,000 characters. Needed. |
<!-- generated:end -->
`raea bug` is how an agent tells raea about a bug it thinks it found in raea itself: a command that fails or hangs, a
result that's wrong, or help that says one thing while raea does another. It's for raea's bugs, not the composition
you're writing. It works in any shell, headless or in the app, and needs no account.
The report is words only. raea adds its version and the OS, and takes out paths, emails and anything shaped like a
key or token before it leaves the machine; raea's server takes them out again. A machine sends at most five a day,
and the same bug sent again (by the same line, numbers and paths aside, on the same version) is counted on the first
report instead of being kept twice. `--dry-run` prints exactly what would be sent and sends nothing.
```sh
raea bug "raea render stops at frame 12 with no error" \
--text "Rendered compositions/teaser.tsx to mp4; it printed frame 12 of 240 and exited 0 with no file." \
--command "raea render compositions/teaser.tsx -o out/teaser.mp4" --error "frame 12/240"
```
+53
View File
@@ -0,0 +1,53 @@
---
title: "raea clothes"
summary: "Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body."
order: 104
sources: ["engine/cli/src/cli.rs"]
---
Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body.
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
```sh
raea clothes [make NAME ["WHAT IT IS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB] | settings | cover NAME --parts PART[:SHARE],... --colour #RRGGBB [--stand MM] [--over UNDER] [--hard [--sole MM] [--sole-colour #RRGGBB] [--panels #RRGGBB,...]] | wear OUT_DIR GARMENT... [--body DIR] [--head HEAD_DIR]] (clothes for SOMA's body from words: make sews a garment: a sewing pattern (GarmentCode, MIT) from the words, or the plain base with --plain, its settings changed by --set PATH=VALUE (settings lists them and what each may be), cut to SOMA's measurements, draped by raea's own cloth and baked, as assets/clothes/NAME.json and its .glb, in --colour or the palette's next; the first make sets up GarmentCode and its Python in raea's models folder; cover makes one by procedure in the same file, no picture: the skin of the parts named (hips, waist, torso, chest, neck, head, upperArm, foreArm, hand, thigh, shin, foot, toes; a limb's SHARE is how far along it from its top), in one colour, MM off the skin (6 unless said), --over a garment already made as the one under it; wear puts garments on a body, innermost first (each GARMENT a name or its .json): OUT_DIR/NAME.glb each, with OUT_DIR/body.glb the body without the skin wholly under cloth; --body DIR another SOMA body folder (a headless one for a head part); --head HEAD_DIR the head that joins it (head.json), whose skin the body's is graded to at the collar; alone, the project's garments. The first use fetches SOMA's body (NVlabs/SOMA-X, Apache-2.0) into raea's models folder and needs Blender: raea setup blender)
```
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
## Flags
| Flag | Takes | What it does |
| --- | --- | --- |
| `--body` | `DIR` | With `wear`: dress this SOMA body folder (body.glb, skeleton.json) instead of SOMA's own, such as a headless body that a generated head joins at the collar. |
| `--colour` | `#RRGGBB` | The garment's one colour. With `make` it is optional: one is picked from the name unless said. |
| `--hard` | – | With `cover`: footwear, made as a hard piece. Each foot gets its own shape: a rounded last around the foot, so the toes and the foot's small forms go under it. Underneath is a flat sole, and the top over the leg is left open as the collar. It is skinned to the foot like the skin it covers, and it does not swing. |
| `--head` | `HEAD_DIR` | With `wear`: the head folder (head.json, head.glb) that joins a headless body at the collar. The body's skin takes the head's neck colour and is graded to the head's own skin just under the collar, so no step of colour shows at the join. |
| `--over` | `UNDER` | With `cover`: lay it over one garment made by `cover`, a layer's thickness off it. |
| `--panels` | `#RRGGBB,...` | With `cover --hard`: the colours of up to three panels, in this order: a toe cap, a heel, and a band along each side. |
| `--parts` | `PART` | With `cover`: the body's parts the garment covers, comma-separated; a limb takes a share, how far along it from its top (`foreArm:0.5` is the half nearest the elbow). |
| `--plain` | – | With `make`: start from the plain base (a short-sleeved top) instead of a pattern guessed from words. The default when no words are given. |
| `--set` | `PATH=VALUE,...` | With `make`: change settings of the garment's pattern by path, comma-separated (`sleeve.length=0.9,meta.bottom=Pants`). A choice must be one of its options and a number within its range; `raea clothes settings` lists them. |
| `--sole` | `MM` | With `cover --hard`: the sole's thickness in millimetres (10 unless said, at most 60). Most of it is painted up the side; the bottom sits at most 8 mm below the bare foot, so the person does not sink into the floor. |
| `--sole-colour` | `#RRGGBB` | With `cover --hard`: the sole's colour (an off-white unless said). |
| `--stand` | `MM` | With `cover`: how far the cloth stands off the skin, in millimetres (6 unless said). |
<!-- generated:end -->
## An outfit
```sh
raea clothes make tee --plain --set shirt.length=1.5 --colour "#e8e2d6"
raea clothes make trousers --set meta.upper=none,meta.bottom=Pants,meta.wb=StraightWB,pants.length=0.8 --colour "#2f3b52"
raea clothes wear assets/characters/dressed trousers tee
```
`make` sews a garment: a sewing pattern (flat pieces joined by seams) cut to SOMA's measurements, draped on the body by gravity and baked to a skinned glb. It costs nothing and takes about 20 seconds. The pattern comes from the plain base (a short-sleeved top) with `--plain` or when no words are given, and each `--set PATH=VALUE` changes one of its settings; `raea clothes settings` lists them all with what each may be. Given words (`raea clothes make hoodie "a hooded sweatshirt"`), the pattern is the garment model's first guess from them; the command says what it made, and `--set` corrects it.
The first use sets up what sewing runs on in raea's models folder (`garments/`): GarmentCode's pattern components (MIT) at a fixed commit, a Python 3.11 environment made by `uv`, and SOMA's body as a distance grid for the drape.
A sewn garment is `assets/clothes/NAME.json` with its files in `assets/clothes/NAME/`: the glb, the design, the flat pattern and four pictures of it on the mannequin. Look at the pictures before you wear it.
`cover` lays a garment on the skin by procedure, for what is skin-tight; it can't hang free. `wear` writes a body folder with each garment's glb and the body without the skin that is wholly under cloth; with `--head`, the body's skin is graded to the head at the collar.
+1 -1
View File
@@ -1,7 +1,7 @@
---
title: "raea godot"
summary: "Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project."
order: 105
order: 107
sources: ["apps/engines/src/godot.rs", "apps/engines/src/godot_run.rs"]
---
+5 -1
View File
@@ -56,6 +56,7 @@ The workspace, its projects and what a project holds.
| [`raea add`](add.md) | Add, remove and install npm packages for a project, with no Node or npm: raea.lock and node_modules. |
| [`raea brand`](brand.md) | Read a brand kit from a website on this machine: colours, fonts and logos into brand/ and BRAND.md. |
| [`raea library`](library.md) | Search and manage the person's media libraries in the raea app: folders and drives indexed on this machine, searched by meaning. |
| [`raea index`](indexer.md) | Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app. |
## Check
@@ -103,12 +104,14 @@ Music read, foley and instruments made on this machine.
## Generate and 3D tools
Generated media, physics bakes, Blender and Godot.
Generated media, physics bakes, clothes and motion for SOMA's body, Blender and Godot.
| Verb | What it does |
| --- | --- |
| [`raea gen`](gen.md) | Generate images, video, music, sound, speech, 3D models and text through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI. |
| [`raea physics`](physics.md) | Make the bakes <Physics> and <Goo> play: rigid bodies, soft goo, and parts cut out of a .glb. |
| [`raea clothes`](clothes.md) | Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body. |
| [`raea motion`](motion.md) | Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads. |
| [`raea blender`](blender.md) | Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth. |
| [`raea godot`](godot.md) | Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project. |
@@ -125,5 +128,6 @@ What an agent reads and shows the person, and the tools raea installs.
| [`raea skill`](skill.md) | Print the agent skill this raea ships, matched to its version, or one of its references. |
| [`raea skills`](skills.md) | Install raea's agent skill where Claude Code, Codex, Kimi or Gemini read skills, with its MCP server and hook. |
| [`raea setup`](setup.md) | Find Blender, or download its current LTS, and install raea's add-on and the MCP add-on. |
| [`raea bug`](bug.md) | Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed. |
<!-- generated:end -->
+32
View File
@@ -0,0 +1,32 @@
---
title: "raea index"
summary: "Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app."
order: 32
sources: ["engine/cli/src/cli.rs"]
---
Make every picture on a folder or a drive searchable by words, on this Mac. `add` lists the folder and embeds each
picture's small copy with SigLIP 2 on the Neural Engine, about 170 a second on an M5 Pro, with a counter as it goes;
`search` gives the best matches for words; `status` lists the sources; `remove` takes one out; `serve` keeps the index
open for the raea app, one JSON ask a line on stdin. Nothing leaves the machine.
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
```sh
raea index add FOLDER|photos:... [--json] | raea index search WORDS... [--k N] [--source ID|FOLDER] [--json] | raea index status [--json] | raea index remove ID|FOLDER | raea index serve [--home DIR] (every picture and video on a folder, a drive or Apple Photos (photos:) made searchable by words on this Mac, fast: add lists it and embeds each picture's small copy with SigLIP 2 on the Neural Engine, a counter as it goes, JSON lines with --json; search gives the best for the words; status lists the sources and what each holds; remove takes one out; serve keeps the index open for the raea app, one JSON ask a line on stdin; the index lives in ~/.raea/library/fast, or --home / RAEA_INDEX_HOME)
```
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
## Flags
| Flag | Takes | What it does |
| --- | --- | --- |
| `--home` | `DIR` | The index's folder (default ~/.raea/library/fast, or RAEA_INDEX_HOME). |
| `--json` | – | Print JSON: progress lines for add, the hits for search, the sources for status. |
| `--k` | `N` | How many hits search gives (10 by default). |
| `--source` | `ID\|FOLDER` | Search only one source, by its id or the folder that was added. |
<!-- generated:end -->
+45
View File
@@ -0,0 +1,45 @@
---
title: "raea motion"
summary: "Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads."
order: 105
sources: ["engine/cli/src/cli.rs"]
---
Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads.
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
```sh
raea motion "LINE" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--steps 100] [-o CLIP.json] (body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads; the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters); a line's words are read once and kept. Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT)
```
Headless: it needs nothing running and opens no window. Takes up to 1 argument besides its flags.
## Flags
| Flag | Takes | What it does |
| --- | --- | --- |
| `--frames` | `N` | The clip's length in frames at 30 a second, 2 to 600. Instead of `--seconds`. |
| `--keys` | `KEYS.json` | Kimodo constraints the motion must meet: full-body keyframes, a hand or foot at a place on a frame, a path for the hips. `bun sdk/body/tools/between.ts` writes them between two poses of the body library. |
| `--seconds` | `5` | The clip's length in seconds (5 unless said). |
| `--seed` | `1` | Which of the motions the line could be: another seed is another take of the same line. A seed here is not that seed on Kimodo's PyTorch code (the noise is drawn differently). |
| `--steps` | `100` | Denoising steps (Kimodo's 100). Fewer is faster and rougher. |
| `-o` | `CLIP.json` | Where the clip goes: `{fps, names, root, turns, contacts, ...}`, Kimodo's 77 SOMA joints as each one's turn in the world from the T-pose. Without it, the line's words name the file in the working folder. |
<!-- generated:end -->
## Example
A stage's `do` line made into a clip: the body stands at the start and the end, and the motion between comes from the
words.
```sh
bun sdk/body/tools/between.ts skeleton.json LIBDIR aMale2_A1_Stand:0 aMale2_A1_Stand:0 stand.json 4 0,0 0
raea motion "A person waves at the camera with their right hand" --keys stand.json --seconds 4 --seed 2 -o wave.clip.json
```
A clip takes about 8 seconds on an M5 Pro. `bun sdk/body/tools/makedo.ts` does the whole of it for a stage's lines:
three seeds a line, each checked against the captures the body hands on to, and the one that does the most kept in the
project's made clips.
Loaded 100 of 549 files, more files were not shown because too many files have changed in this diff. Show more