Compare commits

...
768 Commits
Author SHA1 Message Date
shinyobjectz f68805b981 Videoform: its rules in a taste line's shape, and where to start
Controllers are gone (projects.feature PJ9, #209), so a videoform's mined rules go in its own `rules`, each in a taste
line's shape (words, a check, its values, a level), and `raea check PROJECT` holds a piece to the rules of the
fingerprint that judges it (VF8, a 15-line hook in apps/direction check.rs). docs/videoform.feature gains a short
"Start here": the order (VF1, VF2, VF3, then VF4 with VF12 as the gate before VF1b and VF9-VF11), the new crates, the
three hooks into what exists and the bench. docs/fingerprint.md records decision 6: Pro and Studio's monthly pool of
clef checks and content intelligence.
2026-11-20 14:09:40 -08:00
shane db53845b01 Merge pull request #207 from wackyza/styles-plan
Videoform: the plan and its tasks (VF1-VF13)
2026-11-20 12:38:35 -05:00
shane 3ffe34bb7d Merge pull request #205 from wackyza/check-fewer-rounds
raea check: fewer rounds, shorter checks, and raea's own mix and master
2026-11-20 12:38:08 -05:00
Zachary GuglinandClaude Opus 5.5 0706baee4e Videoform: the plan and its tasks (VF1-VF13)
A videoform is the kind of video a person makes again and again, read once from five to ten of their finished videos
(from the drive, or streamed from a URL with nothing downloaded) into embeddings and measures, then followed and checked
on every cut without going back to the references. It's a kind of fingerprint, and flows into what raea has: its
ranges into its profile (FP6e), its rules into a controller's rule fields (DR4, DR8), its structure into a script
template, its references into brief.ts's shape. What ships runs on raea's own models; the domain vocabulary is written
by the person's own AI. docs/videoform.md is the plan (what's built on, what a videoform keeps, the resolver, when it
doesn't hold together, judging, the build order); docs/videoform.feature its rask tasks, with their plans.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 19:09:46 -08:00
shane 1b7450fb4b Merge pull request #206 from shinyobjectz/win-sizes-export-game
Windows: sizes without du, export-game says it makes Mac games; TokenSynth's line in 0.1.8's notes
2026-11-19 21:34:26 -05:00
shinyobjectz 84acab1f50 whats-new 0.1.8: TokenSynth ran end to end on Windows
rc12 on a Windows runner with nothing on the PATH but raea and Windows: raea setup-audio tokensynth in 113 s, then C2 and C3 of "warm analog bass" in about 75 s each on the CPU, both in tune (64.8 Hz and 130.5 Hz), and again from the asset store at once. The Known line now says only that it runs on the CPU there.
2026-11-19 17:52:04 -08:00
shinyobjectz 25280d1eba Windows: sizes without du, and export-game says it makes Mac games
raea setup-audio (and raea motion's model folders) said "(?)" for every size on Windows: raea_io_home::disk_use ran du, which Windows has no copy of. Without du it now adds up the files' sizes (through links when asked, 64 folders deep at most) and writes them in du -h's units. a_folder_is_sized_without_du; run on a Windows 11 PC with no du, and on macOS.

raea export-game on Windows or Linux said "no player at ...\\raea-game (build it: cargo build --profile game ...)": its targets are a Mac's (signed with codesign) and those releases carry no player, so the advice led nowhere. Off a Mac it now says it makes Mac games and that Windows and Linux games aren't there yet.
2026-11-19 17:52:03 -08:00
Zachary GuglinandClaude Opus 5.5 6350c5deb0 raea-runtime-export keeps under its crate limit with LX6 and LT1's plan: the exposure filter's comment trimmed
rask's size gate counts a crate's planned tasks: the 2D fill filter left raea-runtime-export at 2001 lines with them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 17:00:57 -08:00
Zachary GuglinandClaude Opus 5.5 b6dad1b8aa raea check reads the picture once for flashing, freezes, flash frames and blotching: the same findings in half the time
Four of raea check's rules each decoded the whole export, one after another: 3.7 s apiece on the 11-14 walkaround,
38 s of FFmpeg on a 56 s master export. Run at the same time they took 15.8 s, the same as in turn: decoding is the
machine's whole CPU, so only decoding less saves anything. One FFmpeg now decodes it once and splits the frames into
the four filter chains the rules were tuned on, each to its own output with its own options as when it ran alone
(raea-app-check-read once.rs): the flashing screen's frames to stdout with their showinfo times on stderr,
freezedetect's lines on stderr, the 32x18 grey and blotching's 2 s crops to named pipes. Each rule is split into its
read and its judgement, and the judgements run on what the one read gave, in the order they ran before.

tests/parity.rs holds the one read to the four alone on a clip FFmpeg makes: the same flashing frames and times, the
same brightness, the same crops and the same freeze. On both Telluride projects' exports the check's findings and passes
are identical to before (its JSON byte for byte), and it takes 7-8 s where it took 13-20, and 20-29 s where blotching's
comparison render also runs (37-59 before). Without named pipes (Windows with FFmpeg) the rules read alone as before,
and without FFmpeg raea's own readers do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:41:53 -08:00
Zachary GuglinandClaude Opus 5.5 4c3a3ba799 raea mixes and masters every render's sound: dialogue at one level, a leveller before the limiter, room tone at the joins
The person's rule, 11-19: raea does its own mix on everything, then masters it. Until now a render was
mastered only with a <Mix>, and then by a gain and a limiter alone; levels were the agent's to set. The 11-14 walkaround's
lines ran from -13.8 to -26.9 LUFS, so the agent measured each with ffmpeg and set its gainDb, the limiter still took
up to 8 dB off phone speech's peaks, and the joins between lines fell to dead silence (a dropout, the check said). It
then built and mastered the voice outside raea.

- The mix (raea-sys-mix-level, level.rs): each line of dialogue, a clip on the voice bus or footage's sound on no bus,
  is measured over the span of its take it plays (BS.1770, gated) and brought to -23 LUFS, by at most 12 dB. Room tone
  and silent takes (under -45) keep their level; so do music, effects and every other bus, which sit under dialogue as
  their buses set them. gainDb is an offset on top. Live play and the render level the same span the same way (the
  clip's span comes from the SDK's data-clip-from and data-clip-to).
- The master: a leveller in the limiter (from 9 dB under the ceiling, 3:1 on the mix's RMS, 10 ms in, 150 ms out)
  rounds the loud passages so the limiter catches only what's left, in live play, the render and seedling's limiter
  alike; the gain is made up for what it took. Without a <Mix>, every render masters to -14 LUFS at -1 dBTP.
- The joins (joins.rs): a gap the mix drops into dead silence and comes straight back from gets the room's own tone, the
  quietest stretch of sound near it, looped and faded, found at the level the master plays it. A pause that fades is
  the edit's and stays. The render fills them; live play hears the gap.

The walkaround's v1 sound, each line straight from its take: before, its lines spread 6.7 LU and it had a dropout (and
the mono fold's false clipping); now 2.1 LU, no dropout, -14.5 LUFS, -1.6 dBTP, with nothing set by hand. The Kia cut,
whose voice was mastered outside raea, comes out at -14.1 LUFS, -1.2 dBTP. MASTER_VERSION 4. The guides stop telling
agents to level lines or add a <Mix> to be mastered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:41:53 -08:00
Zachary GuglinandClaude Opus 5.5 6d076868f0 raea check measures clipping on each channel: the mono fold read a clean master as clipped
The clipping rule read the sound folded to mono, which ffmpeg's -ac 1 (and raea's fold, after it) make at
(L + R) * 0.707: a centred voice comes out 3 dB hotter than either side. The 11-14 walkaround's v1 and v2 masters peak at
-1.5 and -1.6 dBTP, no channel near full scale, yet their folds passed 1.0 and the check found 9 to 36 flat-topped runs
over full scale. The agent spent two renders on it and then mastered the voice outside raea; raea check on those same
files, each channel at its own level, finds no clipping. Clipping is a channel's: each is now read as it is (read::channels,
FFmpeg's -ac 2 or raea's own decoders), and a second is the most runs any channel had. A clipped channel is still found,
one that the fold would have hidden among the other too. The dropout and dead-stop rules keep reading the fold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:41:53 -08:00
Zachary GuglinandClaude Opus 5.5 119f458018 raea render holds a video's text to the check's rules as it ends, and keeps a 2D frame's fill out of the lighting advice
A round sooner: what the render's manifest already knows is said by the render, not left for the check after it (the
11-14 walkaround's price figures in the UI zone waited a render and a check). Text off the frame is an error, as the
check has it. Text in a UI zone is a warn by the default zones, since the platform's are the check's to decide; reading
time waits for the check, which has the transcript. Video renders only: a stills render samples too few frames to time
a text. raea check's issue-to-finding conversion is now Issue::finding, which both use.

Exposure's lighting advice ("a fill, an ambient or the sky's light reaches them nowhere") is a 3D scene's. A frame with
no 3D in the render and no footage on it is the page's own fill, dark or bright by design (the walkaround's brand-dark
logo card warned on every stills render), so it's measured and kept in the manifest, not said. A frame with footage
keeps its warning: a clip that drew black still shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:41:53 -08:00
Zachary GuglinandClaude Opus 5.5 1899d29dff raea check says who can fix what it finds, so a round goes only to what another render can change
Two Telluride walkaround projects (11-14, 11-16) took nine renders; five chased findings no render could move. The
checks measured right every time; what they didn't say was whose each finding was. Nothing a rule measures, and no
line it draws, changes here: what changes is how a finding is told.

- The picture's own or the encode's (raea-app-check-cause). A rule an encode can cause is measured again on the
  composition drawn at the same frames without encoding (raea render --at, out of the record). Blotching is the first:
  the walkaround's phone footage scored blotchy in 9 of 28 samples before any encoding, so every export failed and no
  setting cleared it. Now the picture's own is a note, and what the encode added is the error with a fix raea has:
  --quality high added to 14 of 28 samples (x264 crf 12 moved the score at most 0.005; master added none), so the
  check says render with --quality master, and the master export then passes with the note.
- Carried. A finding an earlier export of the same composition had at the same moment ends "[also in …]": what changed
  between them didn't move it. Its rank stays as measured.
- A source isn't a delivery: a take under assets/ or media/ checked on its own reports its loudness as a note.

The text rules (clipped, UI zones, reading time, face, cues, brand kit) move to raea-app-check-text, so raea render can
hold its own text to them, and raea-app-check stays under its size limit. Probe gives the video's frame rate.
The rendering guide tells agents to fix every error in one pass, not to repeat a change that didn't move a carried
finding, and that a note is for the person.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-19 16:41:53 -08:00
shane a9ecc06820 Merge pull request #204 from shinyobjectz/win-noavx
Windows: raea.exe starts on a CPU without AVX; 0.1.8's notes for rc10-rc12
2026-11-19 19:19:25 -05:00
shinyobjectz 191314a69a whats-new 0.1.8: #169's workspaces, #112/#124, raea show, Intl, master's darks, no-AVX; Linux's requirements
The Windows fixes since the notes were written (rc10-rc12), in the notes' words, and what Linux needs: a processor
with AVX (the static ONNX Runtime's initializers use it) and glibc 2.39, in the notes' Known and the install page.
Dated the 19th.
2026-11-19 15:27:53 -08:00
shinyobjectz 865e608857 Windows: raea.exe starts on a CPU without AVX (Goldmont, Nehalem)
rc11's raea.exe stopped before main on a processor without AVX (Intel's SDE as a Goldmont Celeron and as a Nehalem:
"Executed instruction not valid", vmovaps ymm at raea.exe+0x123b5d40). The instruction is in one of seven C++
dynamic initializers in the CRT's table: ctt-etcpak's ETC1 tables (Tables.cpp's g_table_SIMD and the rest, set with
_mm_setr_epi16, which MSVC initializes at run time), from the copy ctt builds with /arch:AVX2. ctt picks an ISA's
copy at run time for its encoders, but every copy's static initializers run at start, on every CPU. With those seven
skipped (a patched rc11), raea.exe --version runs under SDE as both chips.

ctt comes only from Bevy's compressed_image_saver feature (bevy_image's CompressedImageSaver, BC7/ASTC/ETC2 for
Bevy's asset processing), which raea never runs. It's out of the plugin catalog's Bevy features (0.19 and 0.20),
engine/bevy-plugins' generated `bevy` feature (tools/bevy-plugins.sh sync agrees) and engine/render's bevy-all, so
ctt's eight crates, fast_image_resize, ispc-build-utils and zstd leave the lock; NOTICE and LICENSES are
tools/licenses.sh's on main with the change. compressed_image_saver_universal (basis-universal) stays.
2026-11-19 15:27:47 -08:00
shane 56cf86c5c8 Merge pull request #203 from shinyobjectz/windows-169-rc12
Windows: #169's last bugs, and what the agent shell got wrong there
2026-11-19 18:03:10 -05:00
shinyobjectz ee1f3bc32e JavaScriptCore modules get their import.meta.url on macOS 15 too
macOS 15's JavaScriptCore leaves import.meta.url undefined for a module from raea's Objective-C loader (macOS 27's
sets it), so new URL("./x.png", import.meta.url) threw there. jsengine's tests::jsc, run in CI for the first time by
#169's step, found it on the macos-15 runner. A module that reads import.meta gets `import.meta.url ??= "URL";` on
line 1, before its own first line, so every other line keeps its number and an engine's own URL is left alone.
2026-11-19 14:44:39 -08:00
shinyobjectz 040153449c CI runs what a Windows or Linux user meets: Intl on QuickJS, openh264 at master, git, the Node core (#169)
The matrix's unit tests left out raea-runtime-jsengine, raea-io-soft and raea-io-assets, and tests/node.rs and
io-soft's tests/quality.rs need features (modules, h264), so none of #169's fixes ran in CI.
2026-11-19 14:30:32 -08:00
shinyobjectz b60d901473 Git on a PC without it: found or fetched once, as the app's host does (#169)
raea workspace, project and controller failed with "git: program not found" on a PC whose only Git was the app's.
raea_io_assets::git(): $RAEA_GIT, the PATH's, then on Windows the app's (InstallLocation\git), Git for Windows off the
PATH, and raea's own in the tools cache, fetched once (dugite-native, the build the app's host uses, sha256 checked).
Elsewhere it says how to install git. The default root is joined a folder at a time. NOTICE names the fetch, and
FormatJS and CLDR for the Intl commit before this.
2026-11-19 14:30:31 -08:00
shinyobjectz 457121f804 raea show, brand and cut on Windows and Linux (#169)
raea show asked kill whether the app ran, looked only in /Applications and said it opened files in "the Mac's own
viewer". app.ts asks each system its own way through one Here a test can fake: tasklist and the installer's
InstallLocation (#178) on Windows, Explorer to open files and start the app, raea.desktop and xdg-open on Linux, and one
PowerShell listing to name the harness that ran it. The shell's absolute-path tests take C:\, \\server\share and \
(show.ts absolute/fromCwd). raea brand reads a logo's size from its own header (PNG, GIF, JPEG, WebP, ICO), sips only as
a Mac's fallback, and cutting by words off a Mac says what works there. conformance/app.test.ts fakes each system.
2026-11-19 14:30:17 -08:00
shinyobjectz 3f9d5eda2d The agent shell's Node core speaks Windows: platform, arch, ppid, paths, file URLs (#169)
process.platform was Rust's word ("windows", "macos"), so every === "win32" and === "darwin" in the shell was false, on
a Mac too; os.platform() said "darwin" and the arch "arm64" everywhere; there was no process.ppid. path was POSIX only:
resolve(".") named "/C:\Users\...", isAbsolute("C:\x") was false and dirname/basename ignored \. On Windows path
parses drives, shares and \ now and writes /, path.win32 parses them anywhere, and fileURLToPath, pathToFileURL,
createRequire, tmpdir, execSync (cmd) and the module URL (file:///C:/...) follow. tests/node.rs checks each against
Node 22's answer. The arch and parent-pid helpers live in node/os.rs (node.rs was over the size limit).
2026-11-19 14:30:17 -08:00
shinyobjectz 3a08d33f37 openh264 keeps every block of a slowly changing dark ground at --quality master (#169)
Its background detection took a dim glow drifting over black for still and copied old blocks forward: 6-8% of dark
blocks stepped in every sampled frame, at any bitrate or quantiser. Off, 0.1%, as a lossless encode of the same frames.
a_dark_glow_drifting_keeps_every_block_at_master asks under 3% (5.3% before, 1.6% now).
2026-11-19 14:30:17 -08:00
shinyobjectz 917bc94f59 Intl on QuickJS: a composition that formats a number works on Windows and Linux (#169)
QuickJS has no Intl, so toLocaleString or Intl.NumberFormat threw "Intl is not defined" off a Mac. FormatJS's polyfills
(MIT) and the CLDR data they carry (Unicode-3.0) are packed in runtime/jsengine/js/intl.pack (2.2 MB, deflate; js/intl
build.ts, versions pinned), and js/intl/loader.js runs the core the first time anything reads Intl or calls a toLocale*
method, and a locale's data the first time something asks for it, so a script that never formats pays nothing. A small
Collator (letters, then accents, then case) backs localeCompare. quickjs_formats_as_javascriptcore_does: fourteen cases
give JavaScriptCore's answers, and on a Mac it asks JavaScriptCore too. Apple builds are unchanged.
2026-11-19 14:30:17 -08:00
shane 69fb3d8f87 Merge pull request #202 from shinyobjectz/win-export-xml
Windows: export xml's paths open in Resolve (#195); DX12 with DXC renders 3D again (#196)
2026-11-19 15:37:33 -05:00
shane a669144986 Merge pull request #201 from shinyobjectz/whats-new-weather
whats-new 0.1.8: raea/wear's weather during a shot (WR9)
2026-11-19 14:46:12 -05:00
shinyobjectz b39dd4e7de release.yml windows-verify: the bundle's list beside release-check.sh, where it reads it
windows-verify checks the zip on a runner with only release-check.sh and lavapipe.sh checked out, and runs
release-check.sh from RUNNER_TEMP; since the Windows bundle it reads release/win-bundle.files beside itself, which
wasn't there, so the step would have stopped on it once rc9's pack step stopped failing. It's checked out and copied
there now.
2026-11-19 11:39:35 -08:00
shinyobjectz f46529b461 Release: the Windows bundle's list read without its \r (rc9's Windows pack failed on it)
GitHub's Windows runner checks text files out with CRLF, as the Models step already allows for (tr -d '\r' <
models.tsv), so release.sh looked for "vcruntime140.dll\r" in target/dist, beside the vcruntime140.dll win-bundle.sh
had just put there, and stopped. release.sh and release-check.sh, the list's two readers, now strip it.
2026-11-19 11:37:55 -08:00
shinyobjectz c3e7206581 DX12 with DXC: hanabi's utils shader named so DXC can read it; an export refuses a codec before rendering (#196)
wgpu hands DXC a shader module's label as its source's file name, and on Windows LLVM reads "hanabi:shader:utils"
as a root and a file, so DXC said "error reading 'hanabi:shader:utils'" and every Bevy app failed: on a PC where
dxcompiler.dll is on the PATH (wgpu loads it when it can, else FXC), rc8 rendered no 3D at all on DX12 (exit 101 on
an RTX 4070 with WGPU_BACKEND=dx12 and DXC 1.9.2609; the same render passed with FXC). raea export xml's passes were
where the reporter saw it, on a PC whose Intel iGPU puts raea on DX12. Bevy names its modules nothing; hanabi's
utils module and its contract tests' were the only labels with a colon, now underscores.

And an export refuses an alpha codec this machine can't write (ProRes or HEVC off a Mac) when it starts, not after the
reference render: Codec::chosen, which layers, capcut and render_movie share.
2026-11-19 11:37:55 -08:00
shinyobjectz 96c450fb75 export xml: a Windows path is a file URL an editor opens (#195)
0.1.8-rc8 percent-encoded a Windows path whole into <pathurl>: file://localhostD%3A%5CWork%5C... for D:\Work\...,
which DaVinci Resolve refused. The same XML imported at once with file:///D:/Work/... (the reporter's test). A drive's
path is now that, a share's file://nas/clips/..., separators as slashes and the \\?\ prefix off; a Mac's and
Linux's are as before. cargo test -p raea-app-layers passes, with a test of each kind of path.
2026-11-19 11:37:55 -08:00
shinyobjectz 85f4b98616 whats-new 0.1.8: raea/wear's weather during a shot (WR9)
The page named the bake and the shader but not the eight conditions or weatherAt, which change the weather as a
shot runs (rain soaking a front over minutes and drying over the hour after, snow settling, frost forming).
2026-11-19 10:59:41 -08:00
shane fcdcf1c883 Merge pull request #200 from shinyobjectz/wear-crumble
raea/wear: crumbling (WR6), weather during a shot (WR9), the corner house demo (WR7); wear on the public hook (EX9)
2026-11-19 13:55:36 -05:00
shane 3f99e479cd Merge pull request #199 from shinyobjectz/win-bundle
Windows: everything raea needs ships in bin\, under licences we can meet
2026-11-19 13:46:12 -05:00
shinyobjectz bb8b497b58 docs/wear.feature WR8: what the wear shader costs, measured before building the detail layers
At 4K on the M5 Pro the corner house renders 17.2 ms a frame plain and 17.2 worn (17.6 and 17.7 again), so the
recipes' per-pixel noise costs nothing a render can see; the bake's four maps hold 36 MB on the GPU, which BC7 would
take to about 9 MB once the class code has a map of its own. WR8 stays open: the detail layers, mips on arrays (with
them) and BC/KTX2 maps with a fallback where BC isn't.
2026-11-19 10:14:49 -08:00
shinyobjectz c37509d17f Debris thinned by raea-sys-touch's rule, a crack's bounds by parry's Aabb (two near copies folded)
raea-sys-damage kept its debris in seed order with none nearer than a gap, as touch's thin() does for spots, and
found a crack path's bounds with a fold pick.rs also has. touch's rule is now thin_by (any candidate with a place),
which thin_if and damage's debris both use, and the bounds are Aabb::from_points. The same spots come out:
cargo test -p raea-sys-touch -p raea-sys-damage -p raea-sys-weathering pass. Near-duplicate groups back to 58, so
tools/dupes.max goes down to it.
2026-11-19 10:14:49 -08:00
shinyobjectz 913931ad9a Windows: bin\ carries what raea needs, so a PC with nothing installed and no downloads works
tools/release/win-bundle.sh puts beside raea.exe, each with its licence: Microsoft's Visual C++ runtime
(vcruntime140, vcruntime140_1, msvcp140, msvcp140_1) from the runner's Visual Studio, app-local as Microsoft
documents; raea's LGPL FFmpeg 9.0.2 (tools-ffmpeg-9.0.2-lgpl, libvpx's licence and patent grant beside it); and
uv. Before, raea.exe didn't start without the VC++ Redistributable installed, and a PC that blocks GitHub's downloads
couldn't read a phone's video or set up a local model. Its pins are setup.rs's, so what ships and what raea fetches
where it isn't are the same build: setup.rs now fetches our LGPL zip (sha256 d3a3d8cd...) in place of GyanD's GPL
essentials. release.yml runs it, and release-check.sh refuses a Windows zip whose bin\ lacks a file
win-bundle.files lists, whose FFmpeg isn't the LGPL build, or that has no libvpx-vp9 or h264_mf. NOTICE, the README
and 0.1.8's what's new say so.

Checked on the Windows box with the published zip: LGPL, the libvpx VP8/VP9 decoders and h264_mf listed; a 2 s
H.264 clip with AAC cut by h264_mf at notes check's arguments; an alpha VP9 WebM decoded with its alpha (253,0,0,127);
the filters raea runs (ebur128, freezedetect, signalstats, scale, concat, showwavespic, ...) present.
2026-11-19 10:05:03 -08:00
shinyobjectz 02051ee992 One smoothstep for the systems: raea_core_ease::smoothstep (raea-sys-damage's copied raea-sys-foliage's)
Neither crate can depend on the other (systems don't reach sideways), so the cubic Hermite ease goes down to
raea-core-ease, the curves crate, and both use it; foliage keeps its name for it (smooth). Behaviour unchanged:
cargo test -p raea-core-ease -p raea-sys-damage -p raea-sys-foliage pass.
2026-11-19 09:58:24 -08:00
shinyobjectz adec0aef74 docs/wear.feature: WR6, WR7 and WR9 as built, done
Their crates, files, lines and proof: raea-sys-damage and raea/wear's crumbling (WR6), the corner house demo with
worn paint and EX9's deletion (WR7), and weather during a shot with the eight conditions named (WR9). WR8, detail
textures from mask stacks and what they cost, is what's left of raea/wear.
2026-11-19 09:55:02 -08:00
shinyobjectz 84b7659b09 Worn paint is a surface shader of raea's own; raea-sys-wear goes (docs/examples.feature EX9)
MeshStandardMaterial's wear and raea/pbr's <WearExtension> drew with the engine's own MaterialExtension
(systems/wear). They now write the same shader on the public surface hook (sdk/render/src/worn.ts, WORN_WESL: the
same noise, curvature edges, grime, rust and chips, in the mesh's own space), so wear is an author's shader like any
other and raea/wear's weather and the paint wear share one path. A parity scene (sharp, turned and round parts, every
setting) renders the same as before, RMSE 3.8e-5 of full scale. One change: clay draws custom surface shaders as they
are, so worn paint now shows in a clay render, as a ShaderExtension's does.

Deleted: systems/wear, its WearPlugin, its spawn branch, its mesh-row columns, its layer entries, and its type in
the registry snapshot, bevy.gen.tsx and sdk-coverage (reached 1557 -> 1556: the type is gone; wear is still
authored). wear with shader or grid on one material is refused (it was silently dropped). WearExtension keeps its
props, so the guides are unchanged; it carries no @bevy tag of its own now, since its Bevy type is ShaderExtension's.
2026-11-19 09:53:04 -08:00
shinyobjectz e8e3500466 Clip cuts pick the H.264 encoder this machine's ffmpeg has (raea_io_ffmpeg::h264)
raea notes check's sign-off clip and a postmortem's clip were cut with libx264, which only a GPL ffmpeg has:
Homebrew's and Linux distributions' do, and GyanD's Windows build did, but the LGPL build raea now ships on
Windows doesn't. h264() asks ffmpeg -encoders once and takes libx264, else Windows' own Media Foundation encoder
(h264_mf, in raea's LGPL build), else VideoToolbox's, at 8 Mb/s for the system ones; None without one (notes check
says so; a postmortem plays the whole piece, as it did when a cut failed).
2026-11-19 09:51:02 -08:00
shinyobjectz abc6828def Git for Windows' complete source, published beside raea's releases (tools/release/git-sources.sh)
The Windows app ships dugite-native's Git for Windows (GPLv2) so a workspace is made on a PC without Git. GPLv2
section 3 asks whoever distributes it to make its complete corresponding source available, and dugite-native's
repository alone isn't that: Git for Windows' MSYS2 runtime, bash, curl, OpenSSH and the rest are built from their
own source packages. git-sources.sh resolves each package the build's etc/package-versions.txt names to the source
package it came from (51: Git for Windows' pacman repository first, MSYS2's source mirror for the rest) and packs
them with the list; tools-git-sources.yml publishes that once as the prerelease tools-git-<tag>-sources, which the
app's git\SOURCE.txt names.
2026-11-19 09:49:58 -08:00
shinyobjectz d184deb4d1 FFmpeg for Windows, LGPL, built from FFmpeg's own release (tools/release/ffmpeg-win.sh)
raea ships FFmpeg beside raea.exe on Windows so a PC that can't download it still reads a phone's video. GyanD's
essentials build, which raea fetched until now, is GPLv3 with a dozen GPL libraries linked in; shipping it would
mean shipping all their sources. This build is FFmpeg's own code, zlib and libvpx's decoders (BSD, for alpha
WebM, #113), static, LGPL 2.1 or later, with no capture devices and no network; its H.264 encoder is Windows' own
through Media Foundation (h264_mf), since FFmpeg has none of its own and libx264 is GPL. Its complete source is
FFmpeg's signed tarball, libvpx's tarball and this script. tools-ffmpeg.yml builds it with mingw-w64 (apt reading
Ubuntu's archive, as the runner's own mirror trickled) and publishes it once as a prerelease with that source.
2026-11-19 09:49:58 -08:00
shinyobjectz 80ffc0f8e3 wear WR7: the corner house demo (examples/materials/wear)
A Berlin corner block made in code (house.ts): a sandstone plinth, a rusticated ground floor, plastered storeys,
sills, a string course, a cornice on consoles under a hipped slate roof, a door in a sandstone surround up granite
steps, an iron balcony, a zinc gutter and downpipe, an enamel street plate on each face of the corner, a cellar
hatch, a brick firewall, the walk and the road. Its openings go through the walls with the glass 15 cm in, so
cracks start at their corners; one glTF material per wear class. make-house.ts writes media/house.glb.

wear.tsx bakes it once and draws it new, after 80 years of a coal-burning city, as a ruin (with the debris its
age leaves lying, in lumps), at its door and its foot up close; each of the 16 causes in false colour; each of
WR9's eight conditions by day and at dusk; and a shower crossing it as a timelapse (weatherAt). Rendered on the
Mac, 0 errors on every still. Its tests (6) check the house's parts, the openings, the .glb and that the demo
lists every cause and condition.
2026-11-19 09:37:02 -08:00
shinyobjectz 80cc01f11d wear WR6: crumbling, from the same causes (raea-sys-damage, raea/wear); WR9's weather during a shot
Where a building breaks, by rules over the weathering bake's texels, in a crate of its own (raea-sys-damage 3):
- cracks from the re-entrant corners of a wall's openings: a wall texel is beside one when, of eight probes
  across and up the wall, only one diagonal misses it; about half the corners crack (which ones by place, so a
  house cracks the same way every bake), each leaving away from the opening, steeper than 45 degrees, 0.35-1.25 m,
  wandering. causes3's alpha is each texel's distance to the nearest crack on its own wall.
- the loss potential: how readily a coat comes off at the damp foot, where run-off soaks what the rain doesn't
  wash, at a knocked arris low down and along a crack (LOSS; raea/wear's test checks its copy against it).
- debris on the walk under outdoor plaster with a high loss potential, dropped onto the walk from 0.2 m out (none
  where a plinth or step is below first, none from a wall the rain never reaches, a room's or a hollow model's
  back), each with its potential (spots.json "loss"); touch's old debris rule, which waited for this, is gone
  (raea-sys-touch 5). raea-sys-weathering 7 keys on raea-sys-damage's version.

raea/wear draws it by neglect (years less what upkeep keeps up): render lost to the brick 2 cm behind it (drawn
at the view's parallax) under a shadowed lip, paint to red-lead primer and the wood, enamel flaking to rusting
iron, cracks no thinner than a pixel (stepped along brick's joints). What a lived-in house mends however poorly
it is kept (panes, most slates, fallen render on its walk) goes only once it is left empty: abandonOf, neglect
past ABANDON_FROM (0.85) by the house's own upkeep. wearSpots reads spots.json; wearDebris is the debris an age
leaves lying; debug views crack and loss.

WR9: weatherAt eases what lies on the surfaces (wet, snow, driven snow, frost) toward what the sky does, spell by
spell, each at its own rate (WEATHER_RATES, ASSUMED: wet in about 3 minutes, dry over an hour), exactly, so any
frame draws alone; WEAR_CONDITIONS are the eight conditions as weather.

Tests: cargo test -p raea-sys-damage (5: an opening's four corners and no others, cracks along the wall, about
half the corners crack, what loosens a coat, debris under outdoor plaster's foot and on the walk only),
-p raea-sys-weathering (11), -p raea-sys-touch (9); bun test in sdk/wear (22).
2026-11-19 09:37:01 -08:00
shane 7d71973476 Merge pull request #198 from shinyobjectz/wear-recipes
raea/wear: a recipe per material class (WR5)
2026-11-19 12:18:40 -05:00
shinyobjectz 8581fac811 raea/wear: a recipe per material class (WR5)
wearBake bakes a model's causes once (the native call, now typed), and wearShader draws them as wear by material
class: one WESL function per class (plaster, brick, sandstone, granite, wood, iron, zinc, copper, slate, felt, glass,
enamel, brass, ground), the stains, rising damp and splash they share, and WR9's season and weather over them, from
uniforms (age: years, soot, upkeep; weather: day, wet, snow, storm, ice). A debug mode draws any of 14 causes in false
colour from a lit hook. A mesh without the bake's second UV set is left as it was.

The bake (raea-sys-weathering 6) writes each texel's class into causes2's spare alpha, read by textureLoad, so one
shader serves every material; dilation copies class and element into the gutters instead of averaging two into a
third; a primitive with no UV set gets the atlas's as TEXCOORD_0 too, since Bevy's standard surface reads the first
wherever there's a second.

Proof: bun test in sdk/wear (12), cargo test -p raea-sys-weathering (11), and a street front of all 14 classes
baked and rendered by day, in rain, snow and autumn, and cause by cause.
2026-11-19 08:36:34 -08:00
shane 0cd894553d Merge pull request #197 from shinyobjectz/ort-dynamic
Windows: raea starts on a processor without AVX2 (#110)
2026-11-19 11:26:55 -05:00
shinyobjectz c218ecfcdb Windows: raea starts on a processor without AVX2 (#110)
On an Intel Core i5-3550 (Ivy Bridge, 2012) raea.exe stopped at once with 0xC000001D, an illegal instruction, whatever it was asked. Intel's Software Development Emulator, running rc8's raea.exe --version as an Ivy Bridge, named the instruction: a shlx (BMI2) in the C++ library's unordered_map rehash, called from a static initializer that fills ONNX's set of experimental operators (ATen, Affine, ConstantFill, Crop). It was the static ONNX Runtime that ort downloads and links, built with AVX2. Its initializers run before main, so no path of raea's could avoid them: every CPU without AVX2 and BMI2 (an Intel Core before 2013, many Celerons and Pentiums) stopped there. With the emulator told to report and carry on, all 8 such instructions in raea --version lay in that library's code.

On Windows x64, ort now loads ONNX Runtime when a model first runs (load-dynamic), from onnxruntime.dll beside the executable, and links none of it. raea.exe and raea-perceive.exe are the two that used it; the hosts never did.

- systems/{ml,song,columns,speech,index}: ort's load-dynamic on Windows x64, in each crate that uses ort, since raea, raea-perceive and the hosts build in separate cargo runs (checked with cargo tree: disable-linking in both). The crates compile with it (checked on the Mac target; ring's C can't build for Windows here).
- tools/release/onnxruntime.sh: Microsoft's own build, Microsoft.ML.OnnxRuntime 1.28.0 from NuGet (the version the static build was; MIT), checked against its pinned sha256 (its sha512 matches NuGet's record), with its LICENSE and ThirdPartyNotices.txt. Under the emulator as an Ivy Bridge and a Sandy Bridge it loads, makes an environment and opens raea's beat model.
- release.yml runs it in the Windows job on both the built and the promoted paths, and lists the DLL's imports; release.sh packs the three files and refuses a build without them.
- release-check.sh allows that one DLL of Microsoft's, by name, and requires it and its licence in a Windows zip. Its song check (raea song) runs ONNX Runtime from the unpacked zip on every release.
- What's new for 0.1.8 says so.
2026-11-19 08:12:54 -08:00
shane 813ea34251 Merge pull request #194 from shinyobjectz/media-public
staticFile finds a web project's public/
2026-11-18 22:20:18 -05:00
shane 0112793530 Merge pull request #193 from shinyobjectz/fetch-sweep
Setup: a fetch stopped partway no longer leaves its download behind
2026-11-18 22:20:14 -05:00
shinyobjectz 7da3ef25ce staticFile finds a web project's public/
A web project keeps its static files in public/. raea's staticFile is /media/x, found in the edit's media/, the project's media/, then its assets/, so a project brought over with its footage in public/ refused it ("vid\\media/orbit.mp4: The system cannot find the path specified", seen on rc7's Windows run) while its sounds played: the sound preload already scans public/.

media_path tries public/ last, the edit's own and then the project's, so nothing found today moves. Every engine path a staticFile takes goes through media_path: the render's video and pictures, the bundler's rewrite, CSS url()s, UI materials, model calls, games and the frame's media rows.

media_from_the_project: a clip only in the project's public/ is found, the edit's own public/ comes ahead of the project's, and assets/ still comes ahead of public/.
2026-11-18 19:11:55 -08:00
shinyobjectz 2238d3d66b Setup: a fetch stopped partway no longer leaves its download behind
uv's and FFmpeg's fetches download into NAME.part<pid> and move it in when it's whole. A fetch stopped partway (a Ctrl+C, a closed window, a killed process) left its part folder, and every later fetch made a new one: on a Windows test box three were left beside FFmpeg, one holding the 114 MB zip.

Both fetches now end through one settle(): the part moved in when it's whole and nothing got there first, the part removed, and once the tool is in place every NAME.part* beside it swept. A part another process is still writing stays on Windows (its open file can't be removed); elsewhere that fetch fails, finds the tool in place, and counts as done, as a failed fetch that finds the tool already does.

settle_sweeps_stopped_fetches: two stopped FFmpeg parts and this run's are swept while uv's is kept, a failed fetch that finds the tool is done, and one that doesn't says why.
2026-11-18 19:09:09 -08:00
shane 9f3ece646e Merge pull request #192 from shinyobjectz/whats-new
What's new for 0.1.5, 0.1.6, 0.1.7 and 0.1.8
2026-11-18 21:24:28 -05:00
shane fcc8fded73 Merge pull request #191 from shinyobjectz/windows-ffmpeg
Windows reads a phone's or a camera's video: raea fetches FFmpeg the first time one needs it
2026-11-18 21:18:05 -05:00
shinyobjectz cc9f9b1135 What's new for 0.1.5, 0.1.6, 0.1.7 and 0.1.8
The manual's What's new stopped at 0.1.4, and GitHub's release notes for 0.1.5 to 0.1.7 say only "notes follow".

- 0.1.5 and 0.1.6 are the notes written for them (the Studio release folders' notes.md), with the internal
  comments that backed each line taken out.
- 0.1.7 is written from what it shipped: the Windows release (#169's paths and the workspaces they broke repaired,
  sign-in and keys kept on Windows, this PC and Ctrl, Use another account on raea.io's link page).
- 0.1.8 is written from its launch thread and the PRs since 0.1.7: Windows (agents, the installer's folder,
  DX12 for Intel and AMD, phone video through a fetched FFmpeg), local models with nothing installed, layers
  (thanks to wackyza), labels, the window's memory and feed speed, live 3D, Linux 3D, and for builders: controls,
  @shared imports, raea check without FFmpeg, raea gen's fal fixes, WGPU_BACKEND and video-decompiler. Its Known
  list carries forward what's still open and adds DX12's slower shader compile and TokenSynth on Windows.

Dates are Pacific, as 0.1.3's and 0.1.4's are; 0.1.8's is the day it's staged.
2026-11-18 18:11:38 -08:00
shinyobjectz 4dfe231d32 Windows reads a phone's or a camera's video: raea fetches FFmpeg the first time one needs it
On Windows raea's own decoders read H.264 without B-frames (openh264) and AV1, not what phones and cameras write:
H.264 with B-frames, HEVC, VP9. With no FFmpeg installed (as on nearly every Windows PC), raea media probe, raea
check and a render's <Video> refused such a clip ("no picture or sound raea can read"). Found testing 0.1.8-rc6's
raea.exe on Windows with orbit.mp4 (H.264 High, B-frames).

- raea_io_assets::ffmpeg_tool: ffmpeg or ffprobe from the PATH, else raea's own in $RAEA_TOOLS_CACHE/ffmpeg/bin.
  On Windows raea's own is fetched there once: GyanD's essentials build 9.0.2 (the one winget's
  Gyan.FFmpeg.Essentials installs) from its GitHub release, 114 MB, checked against GitHub's SHA-256 digest
  for it, unpacked by Windows' tar (ffmpeg.exe, ffprobe.exe and the LICENSE, ~210 MB). Nothing is bundled.
  Off Windows the error names the package manager's command.
- The fetch shares uv's code (fetch_archive, from fetch_uv), which now resumes across curl's tries
  (-C - --retry-all-errors, as #189 does for the models).
- The ffmpeg backend runs that binary everywhere. Only opening a file named as a video fetches; sound,
  encoding and asking what FFmpeg can do never do, so a silent clip tried on every backend, or an mp3, never
  downloads 114 MB.
- raea-app-media opens a video through every backend in order (raea_io_media::preferred), as renders already
  did, instead of the platform's alone: media probe, the change and picture commands, and raea check's
  native reader. probe's refusal now says what each backend said.

Checked on the Mac with no FFmpeg on PATH and the portable backend first: B-frame H.264 and HEVC probe
through VideoToolbox (they were refused before), and VP9 is refused with each backend's reason, ending in the
install line; VP9 probes once FFmpeg is on PATH. The zip's layout and extraction were checked with bsdtar.
The Windows fetch itself is proved on the release's raea.exe on Windows. Tests: raea-io-assets, raea-io-ffmpeg,
raea-app-media and raea-app-check-read (parity against FFmpeg) pass.
2026-11-18 18:03:37 -08:00
shane 8a94b68093 Merge pull request #190 from shinyobjectz/windows-gpu-dx12
Windows: an AMD GPU runs on DX12 too (#155), and DX12 draws meshes right
2026-11-18 21:01:59 -05:00
shinyobjectz 0013c2eac2 Windows: an AMD GPU runs on DX12 too (#155), and DX12 draws meshes right
#155: raea's app crashed before its window in AMD's OpenGL driver (atio6axx.dll, 0xc0000005) on a laptop with an
AMD 780M beside an RTX 5060, under wgpu's every-backend default and under Vulkan, and ran with WGPU_BACKEND=dx12.
#180 put an Intel GPU on DX12, but looked only at DX12's high-performance pick, which on that laptop is the NVIDIA
GPU. Now dx12_first looks at every GPU DX12 lists: an Intel or AMD one (not WARP) puts the process on DX12, whichever
GPU it then draws on. A PC with only NVIDIA GPUs, a Mac, Linux and a WGPU_BACKEND someone set keep wgpu's own pick.

Testing that on the RTX 4070 (the laptop's pick) found DX12 drawing meshes wrong: a box and a sphere came out as one
mangled shape. The shared device drops wgpu's indirect-draw validation in release builds, and on DX12 that pass is
what writes each indirect draw's first vertex and first instance (wgpu-core's D3D12 special constants). With it on,
the same frame matches Vulkan's. So the validation now stays wherever DX12 can be the backend (on Windows, unless
WGPU_BACKEND leaves DX12 out); Mac, Linux and a Vulkan-only Windows process keep the speed-up. Without this, 0.1.8's
#180 would have drawn every Intel GPU's 3D mangled.

Known cost, unchanged here: DX12 compiles shaders with FXC (raea ships no dxcompiler.dll; DXC 1.9.2609 fails on
bevy_hanabi's shaders), so a 3D render's first frame on DX12 took 22 s on the 4070 against Vulkan's 8 s.

docs/settings.md gets a WGPU_BACKEND row (what raea picks, and the override).
2026-11-18 17:49:56 -08:00
shane 10390997d3 Merge pull request #189 from shinyobjectz/resume-downloads
A local model's download resumes where it stopped, instead of starting over
2026-11-18 20:49:39 -05:00
shinyobjectz d3ebd0baf8 A local model's download resumes where it stopped, instead of starting over
On Windows (11-18) SAO's setup failed 110 MB into the 1.4 GB DiT graph: curl's error 56 (schannel: server closed
abruptly), which --retry doesn't retry, and fetch() threw the .part away, so every rerun began again from zero. Now
the .part is kept across tries and runs and resumed (curl -C -, or a Range request in the urllib fallback), with up to
8 tries a run; a file already whole (416) counts as done, and the SHA-256 check still runs on the finished file.

Tested against Hugging Face with t5-base's tokenizer.json, on the Mac and on Windows, curl and urllib: a 300 KB head
resumed to the whole file (SHA-256 matching), and a second call on the whole file left it as it was.
2026-11-18 17:31:26 -08:00
shane 56de5f1fd7 Merge pull request #188 from shinyobjectz/local-models
Local models install and run on a Mac, Windows or Linux with nothing installed first
2026-11-18 19:42:41 -05:00
shinyobjectz 4d44519fc1 Local models install and run on a Mac, Windows or Linux with nothing installed first
Each local model's setup is now tools/<model>/setup.py (standard library only, on tools/local_setup.py), run by uv
on any OS as raea runs it: uv on the PATH, else raea's own uv 0.12.24 fetched once into ~/.cache/raea-tools/uv (where
tools/ensure.sh puts it) and checked against its SHA-256. The setup.sh beside each is a wrapper for a Mac or Linux.
Until now each setup was a sh script needing uv already installed (brew install uv), so Windows had no way to
install any local model.

- SAO: Core ML on a Mac, ONNX Runtime elsewhere (CUDA where nvidia-smi finds a GPU; RAEA_SAO_CUDA=0|1); its WAV is
  written by Python's wave module, not an installed ffmpeg (same samples)
- matchmove, splat: footage read through PyAV, whose wheels carry FFmpeg's libraries (no ffmpeg/ffprobe needed);
  splat fetches Brush v0.3.0's release build for macOS arm64, Linux x86_64 or Windows x86_64, each SHA-256 checked
- goo: Taichi on Metal on a Mac, else its best GPU (CUDA, Vulkan) or the CPU; the backend is reported as run
- TokenSynth: its code as GitHub's archive at a pinned commit (no git); coremltools only on a Mac
- the engine runs .venv\Scripts\python.exe on Windows (venv_python), Brush's brush_app.exe
- tools/release.sh ships tools/local_setup.py
2026-11-18 16:24:45 -08:00
shane bb109cd6d1 Merge pull request #187 from shinyobjectz/check-native
raea check reads a video without FFmpeg (native readers, held to FFmpeg's answers)
2026-11-18 18:57:10 -05:00
shinyobjectz d8945089ed raea check reads a video without FFmpeg: raea's own decoders stand in where it isn't installed
0.1.7's raea check refused any video without a system ffprobe and ffmpeg, though raea media probe and loudness
never needed them; Windows never has FFmpeg. Every read check makes now has a native reader in a new crate,
apps/check/read (raea-app-check-read): the probe, each frame's light, the dark crops blotching scores, the flashing
screen's area- and point-sampled frames, the sound folded to mono, momentary loudness, freezes, integrated loudness
and true peak, and a caption's contrast. FFmpeg stays the reader where it's on the PATH (the reference the rules
were tuned on); RAEA_CHECK_NATIVE=1 forces the native readers.

tests/parity.rs holds each native read to FFmpeg's on a clip FFmpeg makes: crops, light, sound, meter, freeze and
loudness agree to within a hundredth; flash frames to 4.4 levels. raea check gives identical output with and
without FFmpeg on PATH for a moving clip with a freeze and loud sound, a render, and a strobe with stray frames.
2026-11-18 15:38:16 -08:00
shane dc9dacf41e Merge pull request #186 from shinyobjectz/shared-imports
@shared/ imports render: both bundlers resolve the workspace's shared/ (LY2)
2026-11-18 18:35:35 -05:00
shinyobjectz ac7c37f256 @shared/ imports render: both bundlers resolve the workspace's shared/ (LY2)
raea's skill tells agents to import shared code as @shared/components/NAME, and the project's tsconfig maps it, so
tsc passes; but raea render's bundler took @shared/... for a package and the composition threw "Can't find variable:
_shared_components_badge" before its first frame (0.1.7, reported by an agent on macOS). A relative import of the same
file worked.

raea_io_home::shared finds the workspace's shared/ as the engine's loader does (the folder holding .raea/workspace;
its root for a workspace from before shared/) and the file an @shared/ name means. runtime/bundle's copy of an edit
treats @shared/ like any import from outside its folder: copied to ext/shared/ with what it imports, the import
pointed at the copy (a project that is its own repo too). engine/bundle's script resolution (raea run, specs) resolves
it from the importer. A name shared/ doesn't have is refused naming its importer, not left to the bundler.

Checked: raea render of a composition importing @shared/components/badge draws (it threw before); raea run resolves
@shared/; a missing name is refused with the file it looked for. raea-io-home, raea-runtime-bundle and raea-bundle
tests pass (new: an_import_of_shared_finds_the_workspace_s_file_from_any_depth,
outside_copies_the_workspace_s_shared_code).
2026-11-18 14:59:37 -08:00
shane 08d0c7782a Merge pull request #184 from shinyobjectz/window-images
The window's memory: a picture decoded at the size its URL asks (raea-w, raea-h)
2026-11-18 16:28:14 -05:00
shane 12870b2426 Merge pull request #185 from shinyobjectz/window-trees
The window's memory: UI trees kept only for a reader, once per run; the page's code handed over once
2026-11-18 16:25:44 -05:00
shinyobjectz cba2c338d3 The window's memory: UI trees kept only for a reader, once per run; the page's code handed over once
raea's page host kept the last 240 frames' UI trees (tree.rs TREES) for the MCP ui tool. It did that in the person's
app too, where the MCP server is off and nothing reads them: 315 MB of serde_json trees with a feed of 120 cards open,
found by MallocStackLogging in raea-feed's e2e/memory.spec.ts (MEM_STACKS).

- The trees are kept only once the MCP server serves (tree::KEEP, set by mcp::serve). LATEST, which BRP's ui method
  reads, is kept as before.
- The frames the MCP reader was handed already (tree::SEEN) are let go: its next ask is always for a later frame.
- Frames in a row whose trees are the same are kept once, with their first frame, and handed out as each frame. A page
  at rest is one tree however long it rests, and every reader gets what it got before.

The page host's main also hands the page's code to the mount once instead of keeping it for the app's whole life: the
feed's bundle is 21 to 26 MB.

raea-feed's memory spec, 60 stills of 2560x1440, with raea #184 and raea-feed #97:

| Stage | 0.1.8-rc3 | Now |
|---|---|---|
| Feed open | 1131 MB | 757 MB |
| End of feed | 2032 MB | 904 MB |
| After opening items | 2526 MB | 1317 MB |

Unit tests (tree::tests) cover:
- a run handed out frame by frame;
- what was handed out let go;
- a run part-way through kept;
- the 240 cap.
2026-11-18 13:15:42 -08:00
shinyobjectzandClaude Opus 5.5 87589c84c3 Merge main into window-images (vendor.toml: blitz-dom's reason has main's :has() clause and this lane's picture fit)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 12:53:57 -08:00
shane 1c8f405463 Merge pull request #183 from shinyobjectz/linux-winit
#182: no Engine makes an event loop, in any build, so 3D renders on Linux
2026-11-18 15:36:25 -05:00
shinyobjectz b36c98b418 The window's memory: a picture decoded at the size its URL asks (raea-w, raea-h)
A feed card drew a 2560x1440 still at 720 points at most, and raea's window held it decoded at full size: 14.7 MB
of RGBA a still, and the window grew 25 MB for every still scrolled past (raea-feed e2e/memory.spec.ts: 1.1 GB open,
2.0 GB after 60 stills, 2.5 GB after opening a few). blitz-dom's image decode now fits a picture whose URL's query
asks raea-w=N and/or raea-h=N to that box, its shape kept and never larger, area-averaged on premultiplied pixels
when any is see-through. The servers ignore the query (the app's node server returned the same bytes; raea-page's
file loads read url.path()), and so does a browser. The feed's cards ask theirs at the card's size.
2026-11-18 12:08:31 -08:00
shinyobjectz 4f74e7e754 #182: no Engine makes an event loop, in any build, so 3D renders on Linux
raea's headless Engines (raea-render's, the page's BlitzPage) left Bevy's WinitPlugin out only when a registered
plugin that brought bevy_winit said so (hanabi's x11, raea-page-host's window). A build that brought it some other
way, cargo unifying features across `-p raea-cli -p raea-page-host --features raea-page-host/window` or the whole
workspace, kept it on: each App made an event loop, winit allows one a process, and every 3D render and play
panicked "Failed to build event loop: RecreationAttempt" on Linux (with no display: "neither WAYLAND_DISPLAY nor
... DISPLAY is set"), while a page rendered.

raea-runtime-plugins now compiles bevy_winit in on the desktop (x11 on Linux, loaded at run time, never opened)
and its group() always leaves WinitPlugin out, however the build brought it. The lockfile already held the graph
(winit was in for raea play's window). A unit test says so on macOS and Ubuntu (CI's test list), and the release
archive check renders a 3D frame on Linux and macOS, on Linux once more with no display: no release step had
rendered 3D on Linux.
2026-11-18 11:59:42 -08:00
shane 067c030b67 Merge pull request #181 from shinyobjectz/callouts-0.1.8
Labels from the CLI: raea show --label/--detail/--labels, media sheet writes OUT.labels.json; skills at 76691d0 (callouts)
2026-11-18 14:08:43 -05:00
shinyobjectzandClaude Opus 5.5 1cc07ce266 Merge main into callouts-0.1.8: the skills pin is raea-skills 76691d0 (#103), after main's f37e5e3 (#99)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 10:30:13 -08:00
shinyobjectzandClaude Opus 5.5 dd0197900f skills: pinned at raea-skills 76691d0 (#103: the raea skill labels what one picture holds; cli.md and feed.md for the labels)
Also brings raea-skills #102 (video-decompiler), merged there since the pin at f37e5e3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 10:27:08 -08:00
shinyobjectz f858b78c3b Labels from the CLI: raea show --label/--detail/--labels, and raea media sheet writes OUT.labels.json (CO2b, CO2c)
raea show FILE --label "PLACE TAG" [--detail PARAGRAPH] sends the app's host each label as { place, text, detail? }; the
host (raea-feed labels, host/show.ts shownLabels) reads each place and refuses one that isn't, naming it. PLACE is
x0,y0,x1,y1 or x,y in the picture's 0-1, then #N, @T or @T-TO, or part=KEY. --labels FILE.json sends a list as feed_post
takes them (read by raea's own handler, index.ts, where the shell's files are). A --label with no tag, a --detail with
no --label before it or a second one, labels with no file shown, and --label with --labels are refused, saying what a
label is. The flags are in raea show's help line, the one list stray() reads.

raea media sheet writes OUT.labels.json beside OUT: each cell's box in the sheet's 0-1 and its time (0:03.2), or its
file's name for a sheet of several; raea show OUT.png takes it along with nothing more said. Tested: conformance 12/12
for show (bun), sheet_tests 2/2, and end to end against a stand-in host: a sheet of one film (four times) and of two
(their names), each flag's body as the host reads it, and the refusals.

docs/callouts.feature: status for 0.1.8; CO6 (the card's count) is built, so it's no longer 'Open'.
2026-11-18 10:22:56 -08:00
shane 4bb94788af Merge pull request #180 from shinyobjectz/windows-intel-dx12
Windows: an Intel GPU runs on DX12, not Vulkan (0.1.7's Intel integrated graphics crash)
2026-11-18 13:18:50 -05:00
shinyobjectz 61b832fcba gpu: one backend rule for every wgpu instance, so Bevy's own device and the kernels take DX12 on an Intel GPU too
#180's first commit chose DX12 for an Intel GPU only in the shared device. Bevy's own device (when the shared one
fails) and systems/k's kernels asked wgpu for every backend, so they still met the Intel Vulkan driver that crashed
0.1.7 on Windows. raea_gpu_device::backends() is now the one answer for all three: WGPU_BACKEND when set; else, on
Windows, DX12 alone when DX12's pick is Intel's own GPU (dx12_first); else every backend, wgpu's default. Found once
a process. On a Mac nothing changes: the sample room renders at 10.0-10.1 ms a frame warm, against main's 10.1-10.5.
2026-11-18 10:03:25 -08:00
shane 6e19fb5dbe Merge pull request #179 from shinyobjectz/layers-into-main
Land Zach's layers stack (#167, #170, #171, #172) for 0.1.8: raea export layers / xml, CapCut from layers.json, keyed footage
2026-11-18 12:56:29 -05:00
shinyobjectz 6ee9a06f67 gpu/device: an Intel GPU on Windows runs on DX12, never meeting its Vulkan driver
raea 0.1.7 crashed on a Windows 10 PC's Intel integrated graphics under Vulkan, and ran with WGPU_BACKEND=dx12. Asked for
every backend, wgpu takes Vulkan's adapter for the same GPU. With no WGPU_BACKEND on Windows, DX12's pick is asked
first now, and kept when it's Intel's own hardware (vendor 0x8086, not WARP); any other pick is dropped and every
backend asked as before. NVIDIA and AMD, a PC with no GPU, a Mac or Linux, and a WGPU_BACKEND someone set (Windows'
release check sets vulkan, for lavapipe) keep wgpu's own pick (dx12_first, tested). The page window, the stage and
renders all take this device (runtime/view render_creation); only its fallbacks (Bevy's own device, systems/k when
the shared device is off) don't.
2026-11-18 09:45:46 -08:00
shinyobjectzandClaude Opus 5.5 fb0fca507f raea-cli and raea-runtime-scene back to 2000 lines (tools/size.sh): each side was at the limit alone
Main and Zach's stack each left the two crates at 2000 lines, and the merge made them 2001. Zach's comment on
export layers / export xml is one line now, like each dispatcher's beside it, and the scene's own-ambient retain is one
line, as the file writes its other one-statement ifs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 09:45:07 -08:00
shinyobjectz b3d3308a37 docs/callouts.feature: an agent's labels on what it makes, beside the picture, an armature to the place on hover
The spec for labelled frames (CO1-CO6): a label is a short tag (a paragraph on click) on a place in a still, a
storyboard's frame, a film's time or a scene's part or point; posted with feed_post labels, raea show --label/--labels
or a contact sheet's .labels.json; drawn beside the picture, never over it; on hover an armature reaches in to the
place. The feed's side is on raea-feed's labels branch; the CLI flags, the sheet's sidecar and the skill text follow
after 0.1.8, since they change what the skills gate reads.
2026-11-18 09:37:54 -08:00
shinyobjectzandClaude Opus 5.5 f40e458776 Land Zach's layers stack (#167, #170, #171, #172) on main for 0.1.8
raea export layers and layers.json, CapCut drafts written from layers.json with a captions track, raea export xml
(FCP7 XML for Premiere Pro and DaVinci Resolve), footage that moves, is cut or fades keyed in every export, and the
delivery and words guides teaching them (raea-skills #99, merged onto raea-skills main).

Conflict: engine/cli/src/cli.rs's help, where main added raea wear and raea setup motion beside Zach's raea export
layers and raea export xml; both kept. The skills pin is raea-skills main with #99 merged (f37e5e3).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 09:33:11 -08:00
shane 5194d34efa Merge pull request #177 from shinyobjectz/fc1c-live-fields
FC1c: live play keeps a material's animated fields and a shader's time moving past the first frame
2026-11-18 11:45:27 -05:00
shinyobjectz 0c132413b6 FC1c: live play keeps a material's animated fields and a shader's time moving past the first frame
LT21 (a3fec64205) let live play's fast path keep component rows as they were sent while scene_sig, made of the lights
and each part's <BevyComponent>s, stayed the same. A material's animate of a field past the row columns' four
(material_fields) and a ThreeShaderMaterial's uniforms, time and textures (three_uniforms) are component rows too, but
weren't in the sig, so after the first frame nothing sent them again: the glowing cube in bevy-ts's material-field-live
stayed red where frame 25 is dark. v0.1.8-rc1's Windows release job failed on it, and the Mac does the same.

scene_sig now takes every source of component rows: the components, a material's field: props and a shader's
uniforms, time and textures. A frame where none of them changed keeps LT21's fast path.

Measured on the Mac with the fix: bevy-ts's play cases 12 pass (material-field-live included); live-plugin needs the
plugin build's avian, which the release zip has. raea-runtime-look's tests: 12 pass, one new.
2026-11-18 08:35:53 -08:00
shane 7ef7acc028 Merge pull request #173 from shinyobjectz/windows-navigator
sdk/ui: the page's navigator says the system raea's window runs on
2026-11-18 03:00:28 -05:00
shinyobjectz eaac2989d1 sdk/ui: the page's navigator says the system raea's window runs on, not a Mac's everywhere
A Windows PC's page said MacIntel and a Mac's user agent (0.1.7), so a library that picks ⌘ or Ctrl by
navigator.platform (CodeMirror's and ProseMirror's Mod-) took Ctrl+Z, Ctrl+C and Ctrl+V as a Mac's. userAgent,
platform and userAgentData now read globalThis.__raea_window.os (set by the window before the page's bundle) when
asked: Win32 and a Windows NT user agent on Windows, Linux x86_64 on Linux, the Mac's as before with no window (a
render). test/navigator.test.ts.
2026-11-17 23:53:10 -08:00
shinyobjectz 6e4f947fc9 codec: the master's make-up gain converges on heavily limited sound
Limiting takes loudness off, and master_gained made it up a dB for a dB in three
passes. On a gambit range demo (rifle cracks over a quiet bed, the limiter eating
most of the gain) that stopped 1.8 LU short: -15.8 LUFS against -14. Each pass now
steps by what the last one's gain bought (a secant, slope clamped 0.05..1, step
clamped 12 dB), up to 8 passes or within 0.1 LU: the demo's sound now masters to
-14.11 (13 dB-for-dB passes reached -14.03). Test: a crack-over-wind signal the old
loop leaves 0.25 short.

Seen, not fixed: limited ~10 dB, noise-like transients come out up to a dB over the
ceiling between samples before the encoder (sample peaks hold); master_for's
post-AAC pass is what takes that off.
2026-11-17 20:42:47 -08:00
shinyobjectz 76f33c467b FO13: surface roots buried a third deep and wider than tall, swelling along their length, so they come up out of the soil rather than lying on it 2026-11-17 20:41:17 -08:00
shinyobjectz bf95366d54 FO13: a street tree's roots show only in its pit, sized to the tree
Roots ran up to 1.5 m out and came up through the paving past a 2 m pit. A tree now has a pit (Plant::pit): 0.6 m of
open soil past its flare, never under 1 m in radius (ASSUMED), and each root goes under the soil inside it, clear of
the paving's edge. The grower writes it beside each .glb (TREE.json) for the ground to draw the same pit. Test: no
species shows bark above the ground outside its pit.
2026-11-17 20:06:21 -08:00
shinyobjectz dfe8cff1a7 skills pin: raea-skills 075be77 (PR 101: sdk.md's raea/app list without validControls) 2026-11-17 19:52:34 -08:00
shinyobjectz 7669977ddd The manual's SDK reference regenerated for the controls (raea and raea/app: useControl, the controls' types), registry exporting their types as it did before the split 2026-11-17 19:52:34 -08:00
shinyobjectz 5bb9bd83c3 skills pin: raea-skills 898b99d (PR 100: raea motion on PyTorch, raea wear and raea light in the 3D router, the compositions guide's controls, cli.md and sdk.md regenerated) 2026-11-17 19:52:34 -08:00
shinyobjectz 04adefa570 L1 for every branch landing at once: crates and files back under their limits, copies folded, the Solari fix marked
- raea-sys-shots: raea-sys-frame's cuts between cameras as a crate of their own (frame re-exports it as shots), so
  frame's new Cut fits under the crate limit; runtime/scene's paint_cut joins cam_keyed's prefixes.
- sdk/video controls.ts: a composition's controls out of registry.tsx (under 500 lines), each kind documented.
- raea-runtime-segments in tools/layers.toml; vendor/bevy_solari's compaction-queue fix marked raea:.
- sdk/cloud: a farm job's GPU kind is `card` (a prop names what it picks, not the processor); the farm's query is
  unchanged.
- Copies folded: io-media's backend() is backend_unsigned wrapped by the signer; paint's cut colours read by one
  closure; foliage's one smoothstep, a triangle's bounds in one pass, a cell's pixels as one range; segments' video
  track found once in its tests and its shortest segment set where it's used; the Solari switch through
  raea_io_home::env_on; kimodo's package record a path like its others; a few one-liners written directly.
  tools/dupes.max names the six left, which match by shape only (trait forwards, foliage's own FNV and stream).
2026-11-17 19:52:34 -08:00
shinyobjectz e41890c456 FO13: raea-sys-foliage joins the workspace: its roots tested (a trunk flares at the ground and its roots sink into it)
The crate's members line, its layer (systems) and its facility row (the city's tree LODs build on it). Tests: 7
pass, the rewritten roots among them.
2026-11-17 19:52:34 -08:00
shinyobjectz 371a406507 FO1-FO13: raea-sys-foliage, trees grown by species for the 1917 city (in progress: not a workspace member yet)
Ten street and park species (lime, elm, plane, maple, chestnut, locust, oak, birch, poplar, willow) grown by space
colonisation into lobed crowns, leaves as cards on an atlas, bark tubes, and FO13's foot: a flared trunk and
structural roots that rise at the flare and dive under (Day et al. 2010; Lee 2022; the rest ASSUMED in
species.rs). docs/foliage.feature holds FO1-FO16. The rewritten roots are untested; the crate joins the
workspace's members when they are.
2026-11-17 19:52:34 -08:00
shinyobjectz b6a968dae5 docs/video2raea-sound.feature, the sound spec 2026-11-17 19:52:34 -08:00
shinyobjectz 07f8dd3b99 runtime/bake's read tests 2026-11-17 19:52:34 -08:00
shinyobjectz 8c52f63c4e blitz-dom's text editing: IME, keys and undo 2026-11-17 19:52:34 -08:00
shinyobjectz 3a62efa343 core/scene, systems/sampler's arrays, systems/procmat, and a pbr.md line 2026-11-17 19:52:34 -08:00
shinyobjectz 90b2621d5b raea/character's anatomy (bones, organs, pieces, hits) and its test 2026-11-17 19:52:34 -08:00
shinyobjectz bd9f7b73b8 a composition's controls in the SDK, sdk/video's registry and systems/tweak's values 2026-11-17 19:52:34 -08:00
shinyobjectz 30c26b919c The paint look takes soft (its light as a gradient instead of flat bands), cuts (up to four balls, each a world: a mesh is drawn only in its own, cut per pixel in the main pass and the prepass, with nine styles for what is inside) and a rim and a terminator colour. All default off: at the defaults every shader branch is the code before it. Its docs, tests and the skills reference are still to come 2026-11-17 19:52:34 -08:00
shinyobjectz c848379314 RR3: in progress: bench/rerender/rr3.sh turns segments on (RAEA_SEGMENTS=1) while they are opt-in; its one-run render turns them off 2026-11-17 19:52:34 -08:00
shinyobjectz e50c22064f RR3: in progress. A whole video made as shot segments and joined by stream copy, behind RAEA_SEGMENTS=1 until RR3's gates are measured. raea-runtime-segments: a new encoder run (unsigned) at each cut once the segment before holds a second of frames (split.rs), the whole wrapped by the signer so the export is one file with one watermark id, signed once after the join (encode.rs); the join reads the segments' MP4s with re_mp4 (H.264/HEVC to Annex B with their parameter sets ahead of each keyframe, AV1 OBUs as they are) and writes one with muxide, the sound laid under once from the backend's new Backend::sound (AAC on Apple, Opus on soft and av1) (join.rs). Cuts come from each frame of the fed render (an outermost Sequence's data-raea-start, raea-runtime-page shot_starts; the engine's camera cut, raea_sys_frame::shots::Cut set in pre_step) and the timeline's Shots up front. io-codec gains SoundTrack, remux::aac_track and hvcc_params; io-media backend_unsigned and a public sign::wrap. Benches: film.tsx's cut and cut-long compositions, pages.tsx, rr3.sh (segmented against one run: SSIM >= 0.999 and VMAF >= 99 per frame; join under 1 s on 3,600 frames). Tests: two segments joined are one video with one sound and the segments' own bytes; the encoder splits at cuts but not after a short shot 2026-11-17 19:52:34 -08:00
shinyobjectz 58fe65aad1 IDOL (speridlabs/idol, image to 3D Gaussian splat), in progress, before any ONNX export. tools/idol holds the Modal runner and the step that proves the two ungated encoder sources and dumps the PyTorch reference: FLUX.2-klein-4B's VAE equals FLUX.2-dev's on 251 of 251 tensors after the bf16 cast; timm's DINOv3 ViT-H+/16 gives the gated transformers model's tokens at cosine 0.99999979 (against its public ONNX conversion), with the key map into DINOv3ViTModel. The export, the Rust pipeline and everything after are not started 2026-11-17 19:52:34 -08:00
shinyobjectz 7b1e9d0f6b DC1: the 0.1.5 character SDK update filed as scenarios (drawn characters: the drawing's splat on raea's rig, DC1 to DC8) 2026-11-17 19:52:34 -08:00
shinyobjectz dd9773ce99 @raea/task and docs/plan.feature: a project's plan.org as typed tasks, read and written by task id
The plan of a project's work (asked 11-14: "i like org mode for managing projects ... integrates well with
typescript/react/jsx"): one Org file at the top of the project's folder, the to-do list the person sees in the app and
the one every agent keeps. sdk/task reads it losslessly (parseOrg/printOrg give back any text byte for byte: CRLF,
tabs, unknown drawers, LOGBOOK, blocks, tables, no final newline), gives its tasks as typed values (ids, keywords,
priority, tags, dates, :ITEM:, :AGENT:, :FROM:, subtasks, checkboxes, progress cookies, links by id), and edits it by
task id (add, set, state, move, remove, check: ids minted, CLOSED stamped, cookies recounted, untouched lines kept, a
bad edit throws and changes nothing). Plugins add keyword sequences, properties, kinds and views; board, agenda and
outline ship. planDigest and the plan tools' answers serve any host; ./react has usePlan, useView and the outline,
agenda and board components. No runtime dependencies.

docs/plan.feature PL1 to PL6 says what the app, the agents and the SDK do. The app is raea-feed integration-014
(tasks-org merged, 1214a21) and the skill raea-skills #75.

Checked: bun test (org, edit, extend, tools) 32 of 32; with its React tests under the app's vitest, 35; the gates in
a clean export of main with these files (layers, names, size, one-version, no-void, dupes, rask, sdk coverage, sdk
props, taxonomy) all pass.
2026-11-17 19:52:34 -08:00
shinyobjectz b6f8180b07 RT3: playback of plain films in the feed's timeline, measured and what is built (docs/realtime.feature)
RT3 said only that timeline playback of pre-rendered films is choppy and repeats itself, to be measured first. It now has the bench (the app's e2e/playback.spec.ts: 1080p30, 1080p60 and 4K30 films made with ffmpeg, each frame the window shows logged), the before and after table, and scenarios: RT3a to RT3e built (each frame once and in order, the playhead at each frame drawn, a seek while playing, an edited film across a split and a cut, a stop at the end; the window's part is on the timeline-playback lane), RT3f to RT3h not (frames passed over on a loaded machine, the window playing an edited film's ranges itself, the sound clock measured on screen).
2026-11-17 19:52:34 -08:00
shinyobjectz d81049d925 a layout read's settling and the stall guard (runtime/react settle and commits, runtime/shared stall and calls), with bench/realtime's stage and docs/layout-reads.feature 2026-11-17 19:52:34 -08:00
shinyobjectz 4c71a31628 realtime-bench: the realtime-editing plan's experiments 1, 2 and 3a, measured (docs/realtime.feature)
bench/realtime/stage.sh shows a composition on the engine's stage in a headless raea window (its own MCP port),
pauses it on frame N, changes one control with stage.props, captures each draw and compares it by SSIM with
`raea render --frame N` of a copy holding the new value (and, for ray tracing, with frame N of a render of 0..N).
bench/realtime/window.sh renders the 5 s draft window the app's host/draft.ts writes (edit segments, scale 0.5),
cold and warm, then once with signing on and looks for a C2PA manifest. Cases: a 2D card, a raster scene, the same
under an HTML caption, a Solari room, a Math.random/Date card, and 60 s and 180 s films of RR0's six shots.
bench/render-play gains rows for the 2D, raster and caption cases, and RAEA_RP_ROWS with absolute paths, so copies
of films outside the repo can be measured.

Results: 2D and raster on the stage equal the render (1.000000; HTML over 3D 0.999999), but only after a seek
following the props: props alone leave a paused stage's old frame up. A 90 s raster film plays at 0.945 against its
render with the play's seed replayed, mostly the paint look's wind (0.993-0.997 with it off). Solari reaches 0.9934
of the film's frame after 32 draws and 0.9942 after 64, never 0.995. The 180 s film's window costs a median 1.14
times the 60 s film's; warm startup to the 3D frame is 2.05-3.71 s, about 1 s of it a second start once the first
frame meets 3D; a window takes 9-20 s. The public raea never signs a draft; the signed build does. 8 of the last 30
timestamped notes on composition films are value-only. So, per the plan: live frames are labelled Preview, the
warm worker and background reopen move into P1, ray-traced previews draw without Solari, and unsigned local drafts
are P1 work.
2026-11-17 19:52:34 -08:00
shinyobjectz 2f377010ad scene lint, explain and export read a <BufferMesh>'s own triangles (three.js and R3F parts)
A <BufferMesh>'s shape is "buffer:{positions, indices?, normals?, uvs?}", what raea/r3f makes of every three.js
geometry. core/shape's cache read only CSG expressions, so contact, `raea scene lint|explain` and `raea scene export`
stopped at "unexpected ':' in a shape" on any R3F or <Three program> part (an img2threejs model in <R3F><primitive>
was the first case found, 11-16).

core/shape/src/buffer.rs: buffer_tris (moved from raea-sys-mesh, which re-exports it) and export_tris, triangles
written as GLB (POSITION, NORMAL, TEXCOORD_0) or OBJ (v, vn, vt) without going through Manifold, since a buffer mesh
needn't be closed. The cache reads a buffer: shape as its triangles; interchange's export writes a buffer mesh's GLB and
OBJ from them. mesh.rs's bounds and glb helpers are shared by both exports.
2026-11-17 19:52:34 -08:00
shinyobjectz d44cd9c41b The layout snapshot's rects in one pass: what each element asks of its ancestors (display: none, a transform on the way up) is kept for the next (blitz-dom's RectMemo, get_client_bounding_rect_in). Each was a walk to the root for every element, every frame, and on the installed app's page the snapshot was about a third of its main thread. The same rects (tests/rects.rs, every element in tree and reverse order); on a 3,153-element page 20 deep, 0.37 ms to 0.18 ms 2026-11-17 19:52:34 -08:00
shinyobjectz 7f7acd70f8 raea clothes: a strap across the body and a framed bag hung on the cloth (trims)
Two trim kinds for kit worn over a garment, made for THE GAMBIT's tram conductress (LOC LC-B2-3498-12: a framed
leather money bag at the right hip on a narrow strap over the left shoulder):

- sash: the band's ring in the plane through a point by one hip and one over the other shoulder, front to back,
  each ray cast in from outside so it lies on the outermost cloth, smoothed taut over the folds. In SOMA's A pose
  the arm leaves that plane nearly square to it, so the rays by the shoulder meet its top, not the sleeve. Also a
  bandolier or an officer's cross belt.
- bag: a rounded leather pouch (a superellipse in plan, closed flat at its frame, rounded below) hung where a ray
  meets the cloth, its back bent round the hip across its width, a metal frame and a two-knob clasp on top. Every
  vertex is skinned as the one cloth vertex it hangs from, so it moves whole (emit(rigid=)).

The sash's rows run across its plane's normal the other way round from band's, so they are reversed for slab()
to face it out (first made, it faced in and was culled: no strap).
2026-11-17 19:52:34 -08:00
shinyobjectz 5285e38348 raea clothes: a collar trim closes at the throat over a neckline cut low in front
trims.py's collar "drop": the stand's top runs from its height at the back of the neck to no lower than this at
the throat, the stand growing where the garment's neckline scoops lower in front. GarmentCode cuts no higher
than its fc_depth 0.3: on THE GAMBIT's conductress's coat (SOMA's woman build) the neckline scooped 10 cm below
its back, and a collar following it was a ring round her collarbones; with drop 0.045 it closes at her throat
as the 1915 photographs show (LOC LC-B2-3580-6).
2026-11-17 19:52:34 -08:00
shinyobjectz 4af90803d5 raea clothes: a stiff stand-and-fall collar trim, built from the neckline and kept off the skin
A sewn turtle collar has nothing to hold it up: in the drape its front falls
open in a V at the throat (the M1915 Bluse, the British service dress). The
collar trim builds the stand from the garment's neckline (the highest cloth
at each angle round the neck, since a sewn garment's seams leave open edges
too) up to the neck, its top a few millimetres off SOMA's skin by the drape's
distance grid, and turns the fall down over it, open a little at the front.
Its points can carry an L of braid, piped (an NCO's collar). Sew such a
garment with collar.component.style=none.
2026-11-17 19:52:34 -08:00
shinyobjectz 8fe4b08911 tools/garments' trims 2026-11-17 19:52:34 -08:00
shinyobjectz 82a461297d raea clothes: cloth maps, panels in their own colour, and trims (buttons, straps, a belt) on sewn garments
A sewn garment was one flat colour: wool read as vinyl at a close-up, and a uniform had no buttons, straps, belt
or collar facing (THE GAMBIT's 1917 greatcoat, docs/character.feature CH49a).

- tools/garments/fabric.py: wool, serge, cotton or felt as tileable albedo, normal and roughness maps (periodic
  noise, a whole number of ribs a metre, so the tile has no seam) in the cut's UVs, which are laid flat in metres;
  each material keeps its colour in its factor, so <MeshStandardMaterial color> still recolours it
- bake_batch.py PANELS / sew.sh --panels: the pieces a key names (collar, cuff) in a colour and material of their
  own, set per face before the seams are welded
- sew.sh --design FILE (a saved design made again with a setting changed; read before the folder is emptied) and
  --cloth KIND
- tools/garments/trims.py: buttons (domed, cast onto the cloth), conformed patches (shoulder straps with piping,
  pocket flaps, a buckle; square, round or pointed ends) and bands (a belt round the body, the sleeves left out),
  each skinned from the nearest cloth vertex and carrying the source it is attested by
- tools/garments/glbio.py: the glb rewritten from what is still referenced, so a cover or trim set made again
  replaces the last (measured: trims, cover, trims again keeps 10 parts and 6.1 MB)
2026-11-17 19:52:34 -08:00
shinyobjectz 7c83b42fbb raea/people: a role's headwear drawn per person by weight on its own fork, so everything else draws as before 2026-11-17 19:52:34 -08:00
shinyobjectz c75455936f raea/people: streetMix, the street's mix by the hour from the city's days
streetMix(day) counts each role's minutes walking (trips on foot) in each
hour of a cityDay, for passersBy's mixAt: the sidewalk then carries the
people whose days put them on it (the shift to the Works at half past five,
the children out of school at one) instead of a mix set by hand. An hour no
one walks in takes the day's mix; an empty mix at a minute takes FlowInput.mix.

Test: on the test city's day, housewives walking to market at half past ten,
only the patrols at noon, and passersBy's noon street carrying the patrols.
2026-11-17 19:52:34 -08:00
shinyobjectz 2ddcf9fbe1 raea/people: passersBy's street mix by the hour (mixAt)
A street's walkers were each one person by a fixed mix all day, so a noon
sidewalk carried the munitions workers who are at the Works and the children
who are in school till one. FlowInput.mixAt(minute) gives the mix by the time
of day: each round of a walker (out of a door, along the street, in at a door)
is then its own person, drawn by the mix when the round began, so the street's
people change as the day goes and no one changes on it. A round runs at the
slowest walker's pace so anyone's walk fits it, and a walk has more slots by
the mean pace over it, so a street holds about as many either way. Without
mixAt every draw is as before (existing shots unchanged).

Test: before the change only one mix's role, after only the other's; across
it, step by step, no one jumps or changes role and new walkers come out of
doors; as many out at 5 pm as without it. CH52 says so.
2026-11-17 19:52:34 -08:00
shinyobjectz 179f244e5d raea/people: passers-by go door to door round a block, legs keep their own busyness, no one jumps
- Walk.closed (a ring round a block: walkers turn its corners), Walk.legs (each street's side its own walkers a
  metre), Walk.doors (walkers come out of one and go in at another, a while indoors between): a world's tile walks
  were cut at every tile edge and wherever its raster said building, and walkers wrapped at each cut, popping in
  frame (THE GAMBIT's Leipziger x Jerusalemer corner)
- a walker heads the way with more of its leg ahead and turns a corner by at most SPILL (25 m), so a busy leg stays
  busy; slots are scaled by each leg's measured stretch share so a leg holds its nominal walkers a metre (0.311 and
  0.074 against 0.3 and 0.08 over 17:00-19:00)
- the keep-right offset turns smoothly through 1.5 m either side of a corner (it jumped 0.7 m at one) and spreads
  across the pavement (two loose streams, not two files)
- test: 48 frames at 24 fps round a block, no walker moves more than 0.12 m a frame, everyone who appears does so at
  a door, the avenue side over 2.5 times as busy a metre as the quiet sides
2026-11-17 19:52:34 -08:00
shinyobjectz 4b707f246f raea/people: passers-by on a city's sidewalks, places found by grid, queues on the world's line facing the door (CH52)
- flow.ts: passersBy(walks, minute, {roles, folk, mix, seed, busy}) - each sidewalk holds walkers by its length,
  its busyness at the busiest hour (5 pm) and the hour's share (STREET_HOURS); each a person by the mix walking the
  line at their own pace, keeping right; computed per minute, not stepped, so any frame stands alone
- near.ts: Grid/gridOf - the nearest few of a kind and all within a reach from the cells around a point (a slice of
  Berlin has 16,000 shops: placeFor sorted them all for every block of every day); cityDay's byKind no longer copies
  the list per place
- Place.line: where the world says a queue forms (a tile's queue line); queued people now face the door (they faced
  away: f + pi/2 is the line's own direction)
- a block with nowhere to happen (no workplace found, no place of its kind) is not lived: a sentry with no post
  stayed at his own front door 'on guard' (266 at one stand-in post in gambit's first run)
- tests: the grid against a full sort (200 points), the line followed and faced, blocks without a place, passers-by
  (count by hour, on the line, keeping right, deterministic, a walking pace)
2026-11-17 19:52:34 -08:00
shinyobjectz cfb58e87ac raea/people: the people of a place as data and as days (docs/character.feature CH50-CH53)
A project lists roles (a profession, a rank, a household part: the share of women, ages, traits, dress and kit by
weight, modes of travel, workplace, a day of blocks and habits) and places; populate() draws everyone from one seed
(name, sex, age, five traits, habits, crowd-face numbers, height, hair, dress, gait), dayOf() gives each a day at
real places with punctuality from conscientiousness and trips by a mode chosen first (left in time by that mode,
waiting when early), and snapshot() places everyone at a minute: near, middle, far by distance with hysteresis, or
inside (counted, never drawn), with people out at the same door stood in a queue along its front. census() is the
far level; react() how a person meets an event (a shock underfoot, a report). Folk.avoid rejects names a place's
records hold (a real resident's). Made for THE GAMBIT's Berlin: 3,003 people and their days in 35 ms.
12 tests (sdk/character/test/people.test.ts); raea/people in sdk/tsconfig.base.json and the layout conformance.
2026-11-17 19:52:34 -08:00
shinyobjectz c3ba126ccf raea gen: image.edit's mask reaches a fal model's mask field
A step's media all went into the endpoint's image field, so a mask went into
image_urls beside the picture and a fill model read none. A media input named
mask now goes to the schema's mask field (mask_url when there is no schema).
Test: fal::tests::a_mask_goes_to_the_mask_field.
2026-11-17 19:52:34 -08:00
shinyobjectz 3826a68bfc raea gen: a fal step sends the settings its endpoint's schema names (resolution, aspect_ratio)
fal::body sent prompt, seed, negative and x_* only, so a 4K edit on fal-ai/nano-banana-pro/edit came back 1024 px
(chars/gb-organ's profile views, 11-17) and its face fit failed. Any other setting is sent when the endpoint's
OpenAPI input names it; one it doesn't name is still dropped (made.app's names that fal has no field for). Test:
fal::tests::settings_the_schema_names_go_through.
2026-11-17 19:52:34 -08:00
shinyobjectz 36564204e6 docs/character.feature CH44b: a sewn garment worn over others moves on the cloth follower 2026-11-17 19:52:34 -08:00
shinyobjectz 196fb8ddf5 raea clothes: seams pressed flat in the drape, a followed coat's skirt hides nothing, cover --over a sewn garment refused
The drape (tools/garments/drape_mlx.py) bends across every seam as across the cloth, each at its two pieces laid flat
across it (SEAM_BEND=0 for the old hinge): a seam was a free hinge and stood out as a fin, 3 cm proud down a
greatcoat's centre front from the chest to the hem, drawn as a crinkled line once the coat moved.

hide_under.py: FOLLOW=NAME,... names garments the cloth follower carries (sdk/body tools/worn.ts); their cloth below the
crotch hides nothing under it, since it swings off what it lay on at rest (a greatcoat's skirt had cut 13,531 of the
trousers' 23,512 faces, and the holes showed the coat's inside as it swung; 5,400 now).

garment.py cover: --over a sewn garment is refused with what to do instead (it crashed with KeyError 'stand').
2026-11-17 19:52:34 -08:00
shinyobjectz e251524164 raea gen: a loaded file changed in place is a new input
A media.load step was keyed by its path alone, so a picture made again at
the same path kept every step made from it cached: a face's front remade
in place would keep its old bald edits. The run now keys a load of a local
file by its contents too (Flow::keys_in with the run's base dir); keys()
without a base is unchanged. Test: a_loaded_file_changed_in_place_is_a_new_input.
2026-11-17 19:52:34 -08:00
shinyobjectz 673479e573 raea character: a head worn as a part drawn as skin; the skin shader compiles with its tile off
A GNM head is a part, and <Character skin> drew only the body's "skin" material as skin: the
faces, the skin most seen, were plain glTF PBR (no light under the skin, no clearcoat, no fine
relief). A part may now carry its own skin settings (its maps and the fine relief's scale: a
head's UVs aren't the body's), and a head part (one with eye joints) is drawn as skin whenever
the Character's skin is on.

skin.ts: WESL's @if covers one statement, so mtex and grain read an msamp never declared when
microMap was false; each line now has its own guard.
2026-11-17 19:52:34 -08:00
shinyobjectz 744301d1a1 raea/character: onJoint, where something carried on a joint goes as the body is posed (a slung rifle on RightShoulder)
Placed against the joint at rest in the body's frame and carried by the joint's turn from rest, as a cap rides
Head; the body's placement moves and turns it with the body. Tested in test/carry.test.ts.
2026-11-17 19:52:34 -08:00
shinyobjectz db6e7fb5e0 raea/character: a head part's cornea drawn as one, reflection only
A hero's head (sheet3d's gnm_headglb.py) carries its cornea as a white glTF
material at alpha 0.08 under BLEND. Bevy lights it as it does skin and lays 8%
of it over the eye: a grey film that hid chars/gb-sapper's brown irises in any
real light (the cab's lamps, a studio key), and chars/teal's before. Every part
with eye joints now has its cornea re-covered Premultiplied over black at alpha
0, which adds the reflection alone: the iris shows, with a catchlight.
2026-11-17 19:52:34 -08:00
shinyobjectz cdcdee527d raea clothes: a garment draped over the garments under it
sdf_igl.py --under GARMENT.glb: garments already sewn on the body made part of what the next one drapes over.
Each one's open edges (a skirt's waist and hem) are capped so it closes round the body; it is inflated by its
cloth's thickness (--under-thick, 3 mm) and joined to the body's distance grid. A coat was cut and draped on
the bare body, so THE GAMBIT's conductress's skirt, wider at the knee than the coat's hem, stood out through it
and showed the edge hide_under had cut under the coat. Draped over the skirt, the coat's hem is 3.7 cm wider
each side at the knee and lies on it (docs/character.feature CH42d).
2026-11-17 19:52:34 -08:00
shinyobjectz 2fb97c51d2 raea clothes: garments cut for a body of another build
A garment was cut to soma.yaml's measures and judged against SOMA's template whatever body it was sewn on.

- sew.sh GARMENT_MEASURES: the body's own measures (soma.yaml unless given), beside GARMENT_SDF and SOMA_BODY
- soma_measure.py TEMPLATE_MEASURED.yaml: soma.yaml sets a few values by hand where GarmentCode means other than
  the tape (neck_w 18.5 where the template reads 10.8, shoulder_w 35.5 for 32.2, bust, back_width); given this
  tool's own reading of the template, a shaped body gets each scaled by its reading over the template's
- drape_mlx.py: sleeves and cuffs start round the arm where GarmentCode places them (SLEEVE_LIFT 0.01), not lifted
  7 cm as a top's torso is: a woman's narrower sleeve began with its under-seam inside her arm and draped as two
  flaps beside it. The template's greatcoat drapes as before (re-sewn and looked at).
- drape_mlx.py: 'stayed on' scales the template's shoulder and waist heights by the body's height to the neck
  (the woman's coat, at her neck at 1.35 m, had read as slid off against 1.38)
- docs/character.feature CH42d
2026-11-17 19:52:34 -08:00
shinyobjectz ebc9e8a389 raea clothes: a shaped body's joints move with its skin (SOMA builds)
tools/clothes/body.py SHAPE=... moved the skin along SOMA's shape model and left every joint where the template
has it, so only small changes of build were right (docs/character.feature CH42b's 'not done'). Each joint now
moves with the skin it carries: the skin-weighted mean of that skin's move, a vertex 8 cm off counting 0.6 of
one at the joint. A limb joint takes its two segments' twist joints' skin, since SOMA hangs an arm's and a leg's
skin on the twist joints and none on the elbow or knee itself (without them a woman's elbow stayed at the
template's distance from her shoulder, 3 cm off her shortened arm). A joint with no skin moves as its parent;
the eyes move with the head; the soles stay on the floor; CUT, given in template metres, moves with the neck.

Made for THE GAMBIT's tram conductress: SHAPE=0:-1.8,5:1.5,7:-1.5,3:1 is a sturdy woman of 159 cm (CH42d),
her upper arm 0.270 m and shin 0.381 m against the template's 0.289 and 0.424.
2026-11-17 19:52:34 -08:00
shinyobjectz 0c8042d140 sdk/cloud's client 2026-11-17 19:52:34 -08:00
shinyobjectz 20379f2da8 RaeaCloud type-checks under Cloudflare Workers' types as well as the DOM's, so a Worker can drive a box (raea-bot): write() casts its upload to Uint8Array<ArrayBuffer> instead of the DOM-only BlobPart, and the ACP socket uses addEventListener for open, error, message and close instead of the on* properties workers-types lacks. The box smoke test with the echo agent passes its ACP turn and refusal on the Mac; its two Mac-only failures (the symlink fixture, BSD tar) are as before. 2026-11-17 19:52:34 -08:00
shinyobjectz 93b8e55537 raea cloud's server gets POST /v1/shell {command, cwd, timeout_ms} (CL6b), for an agent whose loop runs elsewhere (raea-bot's shell tool): a bash command line in the workspace with /v1/run's NDJSON, in a process group of its own so a timeout (10 min default, 1 h most) or a dropped request stops all of it, the last line saying timed_out. RaeaCloud.shell() reads it through the same follow() as run(). test/smoke.ts checks output, exit code, the timeout, an empty command (400) and a cwd outside the workspace (403); passed against a local server. 2026-11-17 19:52:34 -08:00
shinyobjectz 4a9646d2ff RaeaCloud.job() casts its upload to Uint8Array<ArrayBuffer> instead of the DOM-only BlobPart, so the client type-checks under Cloudflare Workers' types too (raea-bot drives a box from a Worker); the rest of that change is on cloud-shell. 2026-11-17 19:52:34 -08:00
shinyobjectz e82cd4efe6 raea cloud farm: a render's sound pass finds its models on raea-models (docs/cloud-render.feature CR25): RAEA_SAO=/models/sao (Stable Audio Open small on ONNX Runtime with CUDA, deploy/modal/sao.py) and RAEA_TOKENSYNTH=/models/tokensynth with RAEA_TOKENSYNTH_DEVICE=cuda (deploy/modal/tokensynth.py), for a sound the project's store doesn't have yet; RAEA_AUDIO_AUTOSETUP=0, so a model the volume lacks fails the job at once instead of installing on a GPU's clock. 2026-11-17 19:52:34 -08:00
shinyobjectz 1fb9e01468 raea cloud: a cached file goes only to a job whose own signed URL opens it (CR23)
The farm's hash cache is shared by every job, so a hash alone mustn't open it: on a cache hit, farm_media.py reads one
byte (Range: bytes=0-0) through the job's own URL, which raea's LFS signed only for an account that has the file, and
refuses the job if it doesn't answer. test/farm_media.py: the second job costs R2 one byte, and a job naming a cached
hash with a URL that doesn't open gets nothing. Live: the raea-1 Sprite's tour took its 5.2 MB from the cache
through prod's signed URLs (0.0 MB from R2), about $0.009 on cold containers.
2026-11-17 19:52:34 -08:00
shinyobjectz 1d4779f0c2 raea cloud: a render's hash list follows the tar's excludes, and raea-repo finds its helper through a link (CR22, CR23)
media.ts's inputs skip what offload.ts's tar leaves out (./out/*, ./.git, ./.raea-cloud-out, or RAEA_CLOUD_GPU_EXCLUDE):
excluded() reads tar's patterns the way tar does, so an old render in out/ is no longer fetched for a new one.
repo.sh resolves its own path through a symlink, so the box's /usr/local/bin/raea-repo finds git-credential-raea.

Live on the raea-1 Sprite: it cloned cloud-tour with its agent key in 6 s, sent the render with 3 media files by hash
(not the earlier render), the farm had all 5.2 MB in its hash cache (0.0 MB from R2), 60 frames on a T4 for about
$0.005, 37 s round trip; the box pushed a 132-byte pointer and the Mac pulled the video.
2026-11-17 19:52:34 -08:00
shinyobjectz 39639485d2 raea cloud: the farm names its User-Agent, and a job whose media didn't come still answers /out (CR23)
Cloudflare's Browser Integrity Check refuses Python's own User-Agent (Python-urllib) on raea's domains, signed URL
or not, so farm_media.py's GETs and PUTs say raea-farm/1. A job stopped by its media (a fetch refused, a hash
wrong) now writes an empty changed.txt, so /out gives an empty tar instead of a 500.

Live on raea's workspace with raea-api's Git on Artifacts (an Enterprise test account): a box's clone sent 0.0 MB
of media, the farm took its three files (5.2 MB) from R2 by hash, rendered 60 frames on a T4 (about $0.013) and put
out/tour.mp4 (5.4 MB) in R2; the box pushed only its pointer and the Mac's pull got the same SHA-256.
2026-11-17 19:52:34 -08:00
shinyobjectz 4ad870b947 raea cloud: repo.sh and git-credential-raea say why raea refused (CR21)
Both ask raea with curl --fail-with-body and print its answer on a refusal, so a project whose account isn't on raea
Enterprise (Git on raea's servers is Enterprise's alone for now) reads 402 enterprise_required instead of a bare
curl error. raea-api's repos test checks repo.sh create says so for a Team account without Enterprise.
2026-11-17 19:52:34 -08:00
shinyobjectz 67d5b3ff86 raea cloud: a Sprites box signs in to raea projects with an agent key (CR22, CR23)
box.sh up puts git-lfs, deploy/git's repo.sh (as raea-repo) and git-credential-raea on the box, with a git identity
naming the box; box.sh key NAME takes a raea agent key from a pipe or the clipboard, never echoed, into the box's
env file as RAEA_AGENT_KEY and restarts its server, so its agents clone and push raea projects and offload.ts sends a
render's media by hash.
2026-11-17 19:52:34 -08:00
shinyobjectz 8a1e9248df raea cloud: test/media.ts, both sides of a farm job's media by hash on one clone (CR23)
server/media.ts on a box's clone of a raea repo, farm_media.py standing in for the farm: every committed media file goes
by hash, the farm's copy of each is its hash, its new render goes to R2 by a signed PUT and is verified, and the
clone gets a pointer for it. raea-api's repos test runs it against a local raea-api, then pushes the pointer from the
box and pulls the render on the Mac (same SHA-256). The farm's PUT names its content type as git-lfs does.
2026-11-17 19:52:34 -08:00
shinyobjectz 2c84003a83 raea cloud: a farm job's media by hash, from R2 and back to it, never through the box (CR23)
In a raea repo with the box signed in (an agent key), offload.ts no longer packs the project's media: each LFS file whose
copy is its committed one goes by its object id with a download URL raea's LFS signs, and the farm fetches it from R2
into a cache on its volume keyed by hash (farm_media.py), checking each, so a file is fetched once across every job. A
job started with media=1 keeps its media outputs on the farm: the box asks raea's LFS for upload URLs, the farm PUTs
each to R2, the box verifies them (so they count in the account's storage) and writes pointer files. The farm never
holds a raea credential, only URLs signed for one object each. Media changed on the box and not pushed still goes in
the tar; without a repo or a sign-in, everything is as before.

Checked: test/farm_media.py (a local server for R2's signed URLs): inputs by hash, the cache hit on a second job, a
wrong hash and a path out of the job refused, outputs found by type and size and PUT, files for outside the project
left alone. Deployed to raea's workspace; test/farm.ts still renders a plain job there (90 frames, 69 s, $0.020).
tsc passes. The live run with raea's LFS waits on its deploy.
2026-11-17 19:52:34 -08:00
shinyobjectz 408529cf83 raea cloud: git-credential-raea and repo.sh, a project's Git and media signed in on any machine with no token in its config (CR21, CR22)
repo.sh makes a folder a project's repo on raea's servers (its Git on Artifacts, .lfsconfig pointing at raea, media decided
by type and size as the app does), clones one (Git, then its media) and signs a clone in. git-credential-raea is the
credential helper both hosts use: for LFS (the host of the repo's .lfsconfig) it answers raea's own token; for Artifacts
it asks raea's server for a token for that one repo just then. The token is an agent key on a cloud box, else a token
from the environment, else the raea app's Keychain item, so nothing is typed and no repo's config holds one. Bash and
curl only, so a Mac, Linux, a cloud box and Windows' Git Bash run the same.

Checked: raea-api's test/repos.sh runs both against wrangler dev with Artifacts' simulator: the Mac makes a project, a
box clones it with its agent key, pushes a render with plain git, the Mac pulls it, and neither repo's config holds a token.
2026-11-17 19:52:34 -08:00
shinyobjectz 094d928013 raea cloud: raea's Modal apps in raea's own workspace, and this machine's logins for it beside any others
deploy/login.sh gives a machine a Modal profile for the raea workspace (never made the default; a token that reaches any other workspace is removed at once) and a Sprites token for the raea Fly org, read from the clipboard so it is never typed, and writes the org where deploy/sprites/box.sh reads it. deploy/modal/guard.sh is the one check every Modal script makes: the profile reaches the workspace of its own name and none listed under private/cloud, with image builder 2025.06, the newest this client builds. deploy/modal/workspace.sh makes the workspace from nothing: the farm and made.app secrets, raea's models (once), TripoSG fetched inside Modal (deploy/modal/weights.py), and raea-farm, raea-step and raea-comfy; it repoints this machine's farm and upscale settings only after the farm answers, raea-step upscales a picture and ComfyUI reports its version. The usage lines now name the raea profile.

Checked: workspace.sh built the raea workspace and all three apps answered; test/farm.ts rendered edit.tsx there, 90 frames at 1080p on an A10 in 77 s, billed about $0.024; the guard refused an unset profile, a missing one and a denied one, and a wrongly approved profile was removed from a sample config.
2026-11-17 19:52:34 -08:00
shinyobjectz 3067b55fe1 raea cloud render farm: a long job goes to its GPUs as a queue of parts, so a slow card draws fewer frames
When the GPU limit caps a job, each GPU now takes up to 4 parts from the job's queue (farm_plan.parts_per_gpu), each part still big enough that its start is at most a fifth of it, and the job runs on at most its GPUs at once (with_options(max_containers)). A GPU that finishes early takes the next part, so an L4 that fell in among L40Ss no longer holds up the job. Below the limit nothing changes: each GPU already gets just enough frames for its start.

Checked: test/farm_plan.py (8) passes, with a 1000-frame job on 2 stand-in GPUs in 8 parts; on the farm, 60 classroom frames at 64 samples capped at 2 GPUs ran as 8 parts, never more than 2 at once, 60 frames back in order, a warm part starting in about 2 s against 3.7 s cold, billed about $0.17.
2026-11-17 19:52:34 -08:00
shinyobjectz 775469dbac raea cloud render farm: one render split across Modal GPUs, a bench of every GPU kind, and an agent box on a Fly Sprite
deploy/modal/farm.py (app raea-farm) serves sdk/cloud's jobs protocol on many GPUs. A raea render to a video or a folder is probed on one GPU (frame 0 and the manifest), timed on 8 frames, then split into contiguous runs on as many GPUs as pay for their start (a start at most a fifth of the work, farm_plan.gpus_for), with an optional price ceiling (max_usd, exit 3). Video runs are H.264 parts that the coordinator joins by stream copy while it renders the sound on its CPU; Blender scenes (Cycles on OptiX) split the same way and encode their parts on their own GPUs. raea asks for T4, A10, then L4 (its frames are bound by the CPU); Blender asks for L40S, RTX PRO 6000, then L4 (the most samples a dollar). GPUs render without the clipping check, with 4 cores and 16 GiB, a 2 s idle window (at 60 s a job billed several times its GPU work), shader and kernel caches on the volume, and raea's models from the raea-models volume (deploy/modal/models.sh). Each job's log ends with its bill per container.

bench/gpus.py runs raea (edit.tsx, Solari, clip check on and off) and Blender's Open Data benchmark on every Modal GPU kind at once; bench/results holds the 11-17 run and bench/report.py prints its tables. deploy/sprites/box.sh puts raea, the ACP agents and the server on a Sprite with its renders sent to the farm; it reads the org only from ~/.config/raea-cloud/sprites.env and refuses orgs listed under private/cloud. The client and offload.ts pass gpus, gpu and max_usd.

Checked: test/farm_plan.py (7, stand-in GPUs) passes; test/farm.ts against the deployed farm returned edit.tsx as 90 frames at 1080p in 70 s on a T4, and Blender's classroom as 20 frames at 1080p and 256 samples on up to 10 GPUs (frames 3.1x faster than on one).
2026-11-17 19:52:34 -08:00
shinyobjectz aefd7f7787 RT5: a trial behind RAEA_SOLARI_DYNAMIC=1: a skinned mesh gets a traced twin posed each frame, and a hidden part leaves the traced scene; unset, nothing changes 2026-11-17 19:52:34 -08:00
shinyobjectz c202f3e590 runtime/scene's live groups public, as runtime/live's props read them 2026-11-17 19:52:34 -08:00
shinyobjectz 9f4cce5b00 RT4: the realtime editing work so far
stage.show's render flag, stage.status's render/opens/adopted/last_show/props/held/controls (engine/page/stage
calls.rs, lib.rs, open.rs, status.rs), the composition's controls in the entry's settings (runtime/bundle entry.rs),
Live::open_render and props held per part (runtime/live lib.rs, open.rs, pick3d.rs, props.rs, raea-runtime-scene in
its Cargo.toml and Cargo.lock). In progress.
2026-11-17 19:52:34 -08:00
shinyobjectz dd246e6ab3 A 3D render can start with its 3D live (RAEA_3D_FIRST=1), in progress
In runtime/export/src/render.rs: a bundle that holds data-3d starts its render with its 3D live (live_3d) when
RAEA_3D_FIRST=1, instead of throwing its first 2D frames away at the first 3D one (~300 ms of a warm 150-frame 3D
render, 11-16). Unset, nothing changes.
2026-11-17 19:52:34 -08:00
shinyobjectz 2ccfa6df4f archive.feature: Pro and Team projects move to the account's raea cloud storage when the device needs the space (11-17), checked by hash before the local copy goes: by hand, automatically when the disk runs low, or by an agent through raea archive plan / archive / archive restore, building on the existing sync blobs, LFS and the storage plan flow. Planned, nothing built; AR1-AR8. 2026-11-17 19:52:34 -08:00
shinyobjectz c53a2cfd47 TokenSynth on an NVIDIA GPU (docs/cloud-render.feature CR25): run.py --device cpu|cuda (the DAC decoder and the model on the device, sampling still on the CPU from the seed), raea's asset store passes it from RAEA_TOKENSYNTH_DEVICE (the device is in the cache key, so a GPU's note is its own sample), and an install from before --device says to run setup.sh again. sdk/cloud/deploy/modal/tokensynth.py installs it into raea-models (built at its own path on the container's disk: uv's temporary files fail on the volume, and the venv names its path) and measures it. On a Modal A10, 2.5 s a note with the model loaded against 50.6 s on 4 CPU cores; a process a note, 15.5 s on a T4 against 103 s. CLAP audio embeddings: 4 of 6 GPU notes are as close to the CPU's as two CPU seeds are. 2026-11-17 19:52:34 -08:00
shinyobjectz c808083f86 Stable Audio Open small off the Mac (docs/cloud-render.feature CR25): tools/sao/run.py gets an ONNX Runtime backend beside Core ML, with one sampler for both (the same numpy generator draws the start and every re-noise from the seed), so a backend changes only how each network is computed. The ONNX graphs are the same weights as three fp32 graphs (atauser001/stable-audio-open-small-onnx at a pinned revision, each file against its published SHA-256, its LICENSE and NOTICE kept beside them): cond on the CPU, the DiT and the decoder on CUDA when onnxruntime has it (--device auto|cpu|cuda), else the CPU. --backend defaults to Core ML on a Mac with its packages, else ONNX; --times prints each stage's seconds. setup.sh installs the ONNX build off a Mac (RAEA_SAO_BACKEND=coreml|onnx picks; onnxruntime-gpu with its CUDA and cuDNN wheels where nvidia-smi finds a GPU or RAEA_SAO_CUDA is set, else onnxruntime; sha256sum or shasum). sdk/cloud/deploy/modal/sao.py installs it into raea-models (/models/sao) and times it. Measured 11-17: the Core ML path writes the same bytes as before; ONNX on a T4 and on the CPU against the Mac's Core ML take of the same prompt and seed, 4 sounds, SNR 35.0 to 51.4 dB, correlation 0.9999 to 1.0000, log-spectrum difference 0.34 to 2.08 dB (two different sounds: -2 to -14 dB, 22 to 46 dB), so a sound keeps its cache key on every backend. A warm T4 process 5.3 s a sound (load 3.4, eight DiT steps 0.6, decode 0.6), 4 CPU cores 13 s (decode 6.8), the Mac's Core ML about 5 s. 2026-11-17 19:52:34 -08:00
shinyobjectz 63e1547df4 registerRoot finds the compositions of a root whose components are written inline: a hook inside component={() => ...} runs when React renders that component, not when the root is called, but the walk read the root's whole source for a hook call, so any such root was taken for content and registered one composition, "main". looksHooked now reads only the function's own body: the bodies of the arrow functions and function expressions written inside it are left out (past strings, template literals, comments and regex literals), so a hook in an inline component, a render prop or a callback isn't the root's. A root that calls a hook itself is still content, and a component in the tree that does is still not run. Four new registry tests: inline block, expression and named-function bodies; a root's own hook; a component with an inline render prop beside one with its own hook; braces, arrows and slashes in strings, a regex, a comment and a template. 2026-11-17 19:52:34 -08:00
shinyobjectz bb5cb7ffdd A solid read from a mesh file is kept under the file's length and modified time as well as its expression, so obj("path") or glb("path") written again at the same path is read again. The kept-shapes cache named a mesh by its expression and the build only, so a scan remeshed in place (gambit's Iron Hindenburg head, 11-17) kept drawing its first mesh, holes and all, until RAEA_SHAPE_CACHE=0. files_read finds every obj("...") and glb("...") in an expression, nested ones too, and folds each file's stamp into the key; an expression that reads no file keys as before. Test: the same path written again reads as another file. 2026-11-17 19:52:34 -08:00
shinyobjectz 6d9ec6b7ea Copies is Debug, so raea-sys-material's tests compile; .gitignore takes a linked node_modules and tsbuildinfo
tint.rs's test unwraps copies()'s error, which needs its Ok type to be Debug. sdk/blender and sdk/godot link
sdk/raea's node_modules (a link isn't the directory node_modules/ ignored), and tsc's incremental record stayed
untracked in every SDK package.
2026-11-17 19:52:34 -08:00
shinyobjectz ce16bf2003 WR4: the weathering bake's copied code folded (tools/dupes.sh)
The rain cone is raea-sys-exposure's (now public), chart merging takes raea-core-meshcheck's union-find (now public),
a texel's index is the atlas's own px(), a drop leaving a face goes through one drip() in runoff's walk, a spot's
spacing and the nine cells round a point read without the shapes other crates share, and raea wear bake's -o reads
as a match. Nine exact and three near-duplicate groups gone; the bake's tests unchanged.
2026-11-17 19:52:34 -08:00
shinyobjectz c37616685c raea-app-motion: raea motion and raea setup motion leave raea-app-tools, and kimodo's torch path passes L1
raea-app-tools was 2050 lines, over the crate limit, with the motion verbs: they move whole to apps/motion
(raea-app-motion), and raea-app-tools re-exports it as motion, so the CLI's tools::motion calls stand. A path handed
to PyTorch goes through dunce::canonicalize (std's gives \\?\C:\ on Windows), and the run's temp folder is
raea-kimodo-PID (the retired name gone). The environment's venv and checkpoint folders are fields made with the
Torch, a constraint row's numbers are read without a closure, and what a folder takes on disk is io-home's
disk_use for raea setup motion and raea sounds alike: tools/dupes.sh's new groups from kimodo, folded.
2026-11-17 19:52:34 -08:00
shinyobjectz 86b5e813f8 FC1a: an <Instances>' copies move to raea-sys-copies (systems/copies)
The copy machinery (a copy's markers, its bare spawn, a part's material components found by type path, a mesh's
copies with its materials cloned as handles or with a colour a copy over one TintMaterial, a model's scene copied
placement by placement with a shader cover's link) is its own crate, which knows no rows; runtime/scene3d's
instance.rs reads the rows and calls it. raea-runtime-scene3d is back to 2000 lines. Tests:
a_models_shaded_parts_are_copied_with_their_surface, a_models_part_with_no_material_is_refused (moved).
2026-11-17 19:52:34 -08:00
shinyobjectz ea77b0dbb1 WR4: raea wear bake and the native call wear.bake, on the weathering bake [WR1] [WR2] [WR3]
A .glb gets a second uv set and four cause maps over it, kept by content in the composition's asset store: sky,
the year's sun, cavity and edge; run-off, what it left and its kind, and touch; height over the walk, the chart's
element and open sky; the winter sun, driven snow and where blown things settle. raea-sys-weathering packs planar
charts (flood, merge, split, absorb, hide) and casts parry3d rays; raea-sys-runoff walks rain down faces, along
ledges and off drips, carrying rust, copper, zinc and grime downstream; raea-sys-touch finds door leaves, treads,
rails, passages and gateways, and where plates, bills and nameplates belong; raea-sys-exposure takes the sun by
date and driven snow; raea-sys-glb reads and writes the .glb. wear.bake is registered with the calls crate's
natives (runtime/calls). Tests: weathering 10, touch 9, runoff 4, exposure 4, wear 3.
2026-11-17 19:52:34 -08:00
shinyobjectz 624c60be25 FC1a: an <Instances> of a model takes any mesh material, not only its glTF's standard one
Each part's copies get the part's own material components as handles (instance.rs copy_scene, as a mesh row's
copies already did), so a model under a shader cover is instanced and still batches, and a shaded copy keeps the
link that makes it follow the standard material the rows animate. A toon or look surface still isn't instanced.
Tests: a_models_shaded_parts_are_copied_with_their_surface, a_models_part_with_no_material_is_refused.
2026-11-17 19:52:34 -08:00
shinyobjectz f7b42e8bcc <Instances> take any mesh material: a procedural, worn or grid surface instances as a standard one does
A mesh row with `inst` refused every material but the standard one ("not toon, grid, wear or shadow-only"), so
a set drawn with raea-sys-procmat or raea-sys-wear surfaces (projects/gambit's interior kit: plaster, wood,
jute and brick, all procedural) had to draw one Mesh3d a placement. Now each copy gets the row's own
MeshMaterial3d<M>, whatever M is: found on the row by type path (each MaterialPlugin registers its
MeshMaterial3d's type) and cloned with an opt-in EntityCloner, so the copies share the handle and Bevy still
batches them. A colour a copy (inst_tint) still needs the standard surface and says so; a shader over the
copies is still refused, as before.

Checked: two unit tests (copies share a non-standard material; a mesh with none is refused), and a render of
nine chairs and sacks in the kit's procedural wood and jute as <Instances> against one Mesh3d a copy: RMSE
1.4e-5 (the installed raea refuses the same composition).
2026-11-17 19:52:34 -08:00
shinyobjectz 5d18a5f03e LT21: what is built and measured so far, in its scenario. Detail's level switches on the 540p fly over 1917 Berlin are gone (45, 20, 19 and 17 one-frame spike blocks at frames 41, 117, 122 and 157), JS levels' unchanged; two left at 35 and 226 wait on the extract-order fix's rebuild. Live at 2560x1440, work p50 JS levels against detail: walk 51.7 against 48.9 ms, fly 50.3 against 50.1 (four runs each), streamed run 34.7 against 31.8. What is still open is listed. 2026-11-17 19:52:34 -08:00
shinyobjectz d399e38325 LT21: meshes are extracted after visibility ranges. Bevy 0.20 runs extract_visibility_ranges and its mesh extraction in no set order; a mesh re-extracted because its VisibilityRange changed, when meshes went first, baked the range's previous buffer slot into its MeshInputUniform and kept it until its range changed again, so the GPU dithered it by an older range than the one the CPU culled by. raea-sys-lod rewrites a part's ranges as the eye moves (a city tile's origin is the world's), so a level could be in range on the CPU and wholly dithered away on the GPU: on the 540p detail fly over 1917 Berlin, tile 39140_581855's LOD1, in range and 14% faded out, drew nothing on frames 33 and 34 and snapped in over 35 and 36 (29 one-frame spike blocks at 35; 12 at 226 on the same horizon), while its LOD2 drew its 14% of dots. Taking that tile out of the frame leaves the area steady. raea-sys-lod's install now orders MeshExtractionSystems after extract_visibility_ranges in the render app's ExtractSchedule. Crate tests pass; a render on the next rebuild checks the spikes. 2026-11-17 19:52:34 -08:00
shinyobjectz c77c4858c0 LT21: detail cross-fades on every surface and from where the GPU measures. raea's generated fragments for ShaderExt (surfaceShader: surface and lit hooks) and ShaderMaterial (shade) never called Bevy's visibility-range dither, so a part drawn with them (the city's facades, glass and ground) drew both levels fully inside a fade band and cut one at the band's edge, a pop: on the 540p fly over 1917 Berlin, detail made one-frame spikes of 45, 20, 19 and 17 tiles at frames 41, 117, 122 and 157 where the JS levels made theirs at 58, 106, 112 and 148. Both fragments now call visibility_range_dither under @if(VISIBILITY_RANGE_DITHER), as Bevy's own pbr fragment does (a source with its own @fragment calls it itself). And Bevy's GPU dither measures from a mesh's origin (mesh_world_from_local[3]) while its CPU check measured from the box's centre under use_aabb, which raea-sys-lod set for meshes baked in world coordinates (a city tile's origin is the world's, its geometry hundreds of metres off), so the two disagreed. Now every range is measured from the origin (use_aabb off) and moved by how much farther the origin is than what the part is measured to: its nearest edge (edge), the mesh's own middle when its origin lies outside its bounds, else nothing; the move can be negative, and a range never goes below 0. A moved range is rewritten once the eye has gone a third of its way to the nearest fading band, which bounds a stale move's error (the distance moves as far as the eye, a move twice as far). RAEA_LOD_DEBUG=time now times apply inside it: between two systems ordered around it others ran, so it read 1 ms with no Details at all. 2026-11-17 19:52:34 -08:00
shinyobjectz 5dd7623ac3 LT1: the light check's worst tile is max_by over the tiles, the first of equals as before, not a fold whose closure was code copied elsewhere (tools/dupes.sh: one exact group fewer). 2026-11-17 19:52:34 -08:00
shinyobjectz df8c577fc3 LT21: shapeFromChildren reads a Text3D's and a BufferMesh's props as their own types again, one if per type, so tools/sdk-props sees BufferMesh's seven props read (positions, normals, uvs, colors, indices, attributes, copies: 0 unread). The fragment-aware loop is kept: a shape inside a fragment is still the mesh's shape (conformance/detail.test.tsx). 2026-11-17 19:52:34 -08:00
shinyobjectz a3fec64205 LT21: detail costs the live scene no more than JS levels. A part's detail is a component row, and the live diff's fast path refused any scene holding rows of another kind, so every frame of a scene with a detail took the full diff: on 1917 Berlin's 1440p walk, step 29.7 ms against 10.6 ms with the levels picked in JS. Now the fast path keeps component rows as last sent and goes the full way only on a frame where any part's components change (scene_sig: light_sig plus each part's components), and a component row whose part has gone counts its missing frames and is forgotten as the full path forgets it. RAEA_LIVE3D_CHECK agrees over 3,413 frames of a moving scene where a part with a detail goes and comes back and another's detail changes. raea-sys-lod's apply keeps each part's meshes, bounds and last eye, walks its meshes again only when a mesh is added or its Detail changes, moves edge ranges by whole metres and rewrites a part only once the eye has moved a third of its way to the nearest fading band, since Bevy rebuilds its whole range table on any changed VisibilityRange. RAEA_LOD_DEBUG=time prints apply's time a frame. Walk at 1440p, JS levels then detail: step 10.6 / 11.8 ms, work p50 48.2 / 50.0, p99 100.5 / 87.1; fly: step 4.9 / 6.2, work p50 44.6 / 42.2, p99 139.7 / 125.0. 2026-11-17 19:52:34 -08:00
shinyobjectz 33b3d3d4a6 LT21: edge: true measures a part's distances to its nearest edge, not its middle, for big parts a camera stands in or beside (a city's tile, a terrain chunk). Bevy measures a range to one point, so each frame every mesh's range is moved out by the gap between that point and the part's nearest edge for the shot's camera, which the shadow passes measure from too; a start at 0 and an endless end stay put. On 200 m slabs whose near edge is 58 m from the camera and middle 153 m: far 60 with edge drawn, far 60 without it not, far 40 with edge not. 2026-11-17 19:52:34 -08:00
shinyobjectz c5df492df8 LT21: detail for anything raea draws. A part's detail prop (<Model>, <Mesh3d>) is raea-sys-lod's reflected Detail, which each frame becomes Bevy's VisibilityRange on every mesh under the part (a glTF's meshes are its children). It is drawn between near and far metres, or between sizes on screen in px, converted for the shot's camera from its field of view and its target's height, with the part's size taken as its bounds' diagonal. Each edge cross-fades by Bevy's dither over fade of its distance; past the end nothing is drawn, in the view or the shadow passes; shadow: false keeps it out of the shadow maps. Checked on five spheres at minPx 30 (drawn to 133 m, culled at 302 and 617 m), a cube past its far, and four court pumps (far 3 at 5 m gone with its shadow, shadow false drawn without one). RAEA_LOD_DEBUG=1 prints each range and whether Bevy kept it in range of each camera. Mesh now finds its shape inside a fragment: shapeFromChildren and boundsFromChildren read only direct children, so <Mesh3d><><Sphere /><StandardMaterial /></></Mesh3d> was dropped from the scene without a word. Conformance: sdk/raea/conformance/detail.test.tsx. 2026-11-17 19:52:34 -08:00
shinyobjectz f21929e9e3 LT21: realism.feature plans detail, draw distance and culling for anything made in raea: ranges in metres or by size on screen, cross-fades, shadows left to a coarser level, auto levels by meshoptimizer, posters baked by raea, GPU culling of Instances' copies, a visibility bake, and generators giving their own levels. 2026-11-17 19:52:34 -08:00
shinyobjectz 9f75dddd30 LT20: Berlin's frame is set by its geometry, not its pixels (the walk's 3D at a quarter of the pixels saves 5 of 30 ms), so the levels are generated from the city's own rules, not simplified: level 0 with instanced kit parts, level 1 fronts with their detail baked into textures, level 2 merged blocks, posters (impostors) for landmarks, trees and the far crowd, and shadows cast from a coarser level. 2026-11-17 19:52:34 -08:00
shinyobjectz c4cb327b85 LT2: raea GI measured on Berlin's walk at 1080p: the probe rays cost 0.26 ms of GPU at 128k a frame and 0.9 ms at 512k, the TLAS 0.83 ms of CPU a frame (5,518 instances, 707 BLAS). Probes are kept by their place in the world, so a moving grid keeps what it learned and a probe new to it traces the warm rounds; a resolve pass writes the volume each frame. The volume lights the scene only with RAEA_GI_SHOW=volume, since on the Mac it is a 17th fragment sampler for hooked materials (D19 warning). raea light check gets a gi path with the pass's GPU ms; Berlin's live and flicker scene is gambit's light-walk, people-ingame being a contact sheet. 2026-11-17 19:52:34 -08:00
shinyobjectz 77e88cb85c LT20: realism.feature plans LOD, streaming and culling for Berlin: levels picked by error on screen at the inside size, streaming budgeted in bytes and ms, a per-cell visibility bake, instanced props, impostors and an HLOD, three crowd rings, the ray scene built from the same tiles, and a walk down Leipziger Strasse at 1440p held to the frame budget. 2026-11-17 19:52:34 -08:00
shinyobjectz 70dd4ed129 LT12: the game's budget, confirmed: 60 fps at 2560x1440 out on this Mac with raea GI at most 5 ms, 4K out the stretch, both drawn inside near 1080p and upscaled by MetalFX (D13); the live 3D gets a size of its own so the check measures 1440p and 4K out. 2026-11-17 19:52:34 -08:00
shinyobjectz 34ab7a4887 LT19: realism.feature adds the camera and the finish (a physical camera from a photo's EXIF: depth of field, motion blur, noise, bloom, AgX; OIDN in the film tier), leaves and layered materials as shading models (LT11), alpha-cut cards in the ray scene (LT3), a tier with no ray-tracing hardware (LT12), and ReSTIR PT Enhanced as the film tier's later accelerator (LT5). 2026-11-17 19:52:34 -08:00
shinyobjectz 2b8ca92365 LT1: raea light check finds the home folder on every OS (raea_io_home), raea-light gets its layer, and three one-line closures no longer copy others'. 2026-11-17 19:52:34 -08:00
shinyobjectz c4578438d1 LT2: raea GI's first probe pass on systems/rt (RAEA_GI=1, unset nothing changes): a grid of probes around the camera (RAEA_GI_GRID, RAEA_GI_SPACING), 64 rays a probe through the TLAS, a miss seeing the camera's environment and a hit a flat stand-in lit by the sun through a shadow ray and the sky's diffuse light; each probe's ambient cube kept as a running mean and written into Bevy's irradiance volume. A ray budget a frame (RAEA_GI_RAYS) sets how many probes refresh; a moved grid or changed light starts again with RAEA_GI_WARM rounds; the pass's own GPU timestamps go to RAEA_GI_STATS. raea_sys_rt::passes installs traced AO and GI behind one plugin line. 2026-11-17 19:52:34 -08:00
shinyobjectz df67edc978 LT2: realism.feature revised from the research (docs/realism-research.md, added). Gather in three stages, screen trace then TLAS then a world cache; the world cache a hash grid on surfaces (Unreal 5.9's World Cache, GI-1.0, Solari's, made raea's) in place of probe grids; no surface-cache cards: a hit reads its record's averaged material, a cache cell that learns colour from the G-buffer in every season, then the material's own code at the hit; a coarse, persistent ray scene with instance records (LT3); occlusion counted once from the screen trace's short rays (LT10); a reference with full materials at every bounce and a film tier with no history (LT5); speed designed from LT2, which now also times the TLAS, BLAS and raster passes and an owned Metal intersector (D18); dropped effects warn (D19). 2026-11-17 19:52:34 -08:00
shinyobjectz d48a969211 LT16: each photo recreated as a set of its own (D17): modelled by us from nothing, object for object, at the photo's season, day and hour, owned by the realism lane in gambit; Berlin's look takes a season (snow, autumn, summer, wet) and the world lanes keep their work ready for every season. LT16 the sets (eight first, one fitted and one held out a season), LT17 a photo matched against its set on blocks and by region, LT18 residuals reverse-engineered. 2026-11-17 19:52:34 -08:00
shinyobjectz fc8e7d7387 LT15: realism.feature gets its second bar, real photographs. D15: full-colour, high-definition modern photos under a commercial-permissive licence, each with the EXIF that rebuilds it (field of view, EV, time and place), Berlin first and every season equally (snow, autumn, summer, wet). D16: a photo teaches the renderer, never one shot; half the set held out by place and season. LT15 the set (bench/light/photos.json, fetched outside git), LT16 a photo matched (the camera posed on the true-coordinate city, the sun from time and place, exposure from EV, compared in linear light by region for places and on blocks for rebuilt sets), LT17 residuals traced to their pass and fixed there; LT14 reports photo numbers too. 2026-11-17 19:52:34 -08:00
shinyobjectz 4782bb27b9 LT1: realism.feature rewritten for raea's own renderer, no Solari
11-17: Solari measured accurate but 2.6 times raster's frame on FLOOR3, so raea Light becomes raea's own
renderer in the design Unreal's Lumen and AMD's GI-1.0 use: raster for what the camera sees and direct light; a world
radiance cache and screen probes traced on systems/rt for bounce light; a surface cache captured through the deferred
pass every material writes, so a hook's look reaches the rays; traced reflections; occlusion from the GI; skin, hair and
cloth as shading models; raea's own path tracer as the reference. Fourteen steps, the world radiance cache's cost on
Berlin first (LT2), Solari removed last (LT13). Findings M11-M15 added (Solari's cost, systems/rt has no hit data, Bevy's
irradiance volume, the character SDK's lit hooks, the editor's budget isn't a game's); the game's own budget (60 fps at
1080p, raea GI at most 5 ms) is proposed, to be confirmed.
2026-11-17 19:52:34 -08:00
shinyobjectz f7484f2eb5 LT1: live frame time, flicker against the path-traced shot, light measured on 8x8 blocks, a converged FLOOR3
raea light check now plays each scene live (raea play --offscreen --no-vsync --3d, 6 s at 1080p) and reports its
milliseconds a frame; adds a traced-ao path (raster with systems/rt's traced occlusion); measures distance on 8x8-pixel
block means, so antialiasing and a reference's leftover noise count for little; measures flicker as the second
difference in time of each pixel's error against the same shot path-traced, so motion cancels; keeps a reference only
while it's the same frames at the same samples (made.json); and takes a scene's own sample count. The path tracer's
reset is now one-shot, as Solari's is (vendor/bevy_solari pathtracer/extract.rs, raea: mark): it stayed set, so a cut
under the path tracer restarted accumulation every frame after it. RAEA_LIGHT_SPP restarts each frame's accumulation
(raea-render restart_pathtracer), so a thing moving under a held camera isn't smeared.

LT1 measured on FLOOR3 against a 2048-sample reference: raster 1.38 stops off (worst tile 3.37), 18.0 ms a frame;
Solari 0.96 (2.62), nearly all one bias a stop dark, 47.6 ms a frame. Berlin is the main scene from here; it and the
kitchen get references once their materials and lights are in the traced path. LT1's plan table is in the feature.
2026-11-17 19:52:34 -08:00
shinyobjectz 2161a524ab LT1: raea light check, the bar raea Light is measured by
RAEA_LIGHT=raster|solari|pathtracer puts every 3D camera on one light path whatever the composition asks
(engine/render/raytrace force.rs; Solari's plugins come in when it forces them), and RAEA_LIGHT_SPP=N draws each
frame N times (runtime/export bevy_frame.rs) so a path-traced reference converges: gambit's street at 1080p, 128
samples, in about 11 s. raea light check SCENES.json -o DIR (new crate raea-light) renders each scene's stills on
each path and against its reference (kept until --fresh), and reports the distance in stops (mean, bias, worst
64-pixel tile), a moving shot's flicker (each pixel's second difference in time) and a still's cost in
DIR/report.json and a table; metric.rs has unit tests. bench/light/scenes.json lists the reference scenes: gambit's
street (no reference until LT2, LT3 and LT5), FLOOR3, gambit's first-person kitchen table and the glade. The anything
film's kitchen doesn't render today: every composition in content/anything throws "Can't find variable: raea".
2026-11-17 19:52:34 -08:00
shinyobjectz ac78166b2a LT: docs/realism.feature, one strategy for shading, ray tracing and occlusion
The ask on 11-17 was for Unreal-level quality and one centralized strategy in place of today's misaligned paths. The
file records what was measured on gambit's people-ingame (M1-M8: five lighting paths, hooks absent from the
G-buffer, characters untraced, no owner, no reference, an unannounced brightness change), the decisions (D1-D12:
Bevy and wgpu stay, Solari's ReSTIR becomes raea's own light-transport core, one TLAS, one material in every pass,
a path-traced reference as the bar) and the steps LT1-LT11, the bar first.
2026-11-17 19:52:34 -08:00
shinyobjectz 3bdd163c78 LT6: raea's traced AO builds on Metal: its ray query lives in a helper function
Declared in the loop's body, naga's Metal output reassigned the query each pass (rq = intersection_query<..> {}), and
Metal's intersection_query has no assignment, so the raea_traced_ao pipeline failed to build on the Mac and every
render with RAEA_TRACED_AO refused. passes_rt.wesl already keeps its query in a helper (blocked) and builds. Checked
on gambit's people-ingame (frames 0, 6, 11): it renders, darkening contacts and creases.
2026-11-17 19:52:34 -08:00
shinyobjectz 10a18eb332 raea motion on PyTorch off the Mac, raea setup motion, and shaded meshes that spawn after a load
raea motion runs Kimodo on MLX on a Mac as before; on Linux and Windows it runs upstream Kimodo (commit e1c219c, Kimodo-SOMA-RP-v1, post_processing off) on PyTorch, CUDA when there is an NVIDIA GPU, else the CPU. Python hands back the sampler's raw features and raea's Rust decoder makes the clip, so both write one clip format (systems/kimodo torch.rs, torch/run.py). raea setup motion [--check] fetches or checks the MLX models on a Mac, and elsewhere makes a uv Python 3.11 environment and fetches the weights (Llama 3 from NousResearch's ungated copy, its files checked against Meta's SHA-256s, each repository pinned). Checked on the Mac: MLX unchanged, the torch path's Rust half on MLX's own features (same keys, root gap 1.1e-16 m), cargo check for macOS, Linux and Windows. Not yet run end to end on Linux or Windows (docs/character.feature CH15d says what is and isn't tested).

scene3d's shade_meshes: a mesh row waiting for its shader gets it after a live frame's or a fed render's rows too, not only when a model spawned (a shaded part with no model beside it drew its bare standard surface). docs/first-person.feature: the first-person hands, interactions and cutscenes spec (FP1-FP11).
2026-11-17 19:52:34 -08:00
Zachary GuglinandClaude Opus 5.5 ee3451714d layers LA7a: the delivery and words guides teach the layered exports; skills pinned at the raea-skills layers-exports branch
motion/delivery says a cut an editor finishes goes out in layers: `raea export capcut` (or the app's Export to,
then CapCut) and `raea export xml`, its NAME.premiere.xml and NAME.resolve.xml each for its own editor; what arrives
(footage and sounds as clips of their files, keyed where they move, raea's drawing as transparent clips over and
under them, captions on their own track with an .srt, reference.mp4 to compare); that captions and graphics are
pictures there, so a word is fixed in raea and exported again; and what to pass on from the notes, CapCut's crop
that can't change over a clip first. motion/words says to mark captions data-raea-role="caption", in its example
too. The skill's copies and reference/cli.md (now listing raea export layers and raea export xml) are regenerated in
raea-skills; tools/skills.sh check-cli passes against this tree's raea.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:22 -08:00
Zachary GuglinandClaude Opus 5.5 3acbaab880 layers LA4c, LA4d, CC2f: footage that moves, is cut or fades is keyed in every export, each editor placing it as raea drew it
The manifest says what of a video a box it's in leaves showing (clip) and its object-position; layers.json keeps
each footage clip's box, clip, object-position and opacity at the frames they change (keys). One reading of a
picture (plan::picture: object-fit, object-position, cut only where its box or a box it's in cuts it inside the
frame) places it in every export:
- the FCP7 XML keyframes Basic Motion, crop and opacity, written per editor (NAME.premiere.xml, NAME.resolve.xml):
  Premiere's crop in Basic Motion, Resolve's as FCP7's Crop mirrored for a phone's take stored turned; Scale and
  Center each in that editor's clip at Scale 100 (Premiere: the media as described, a phone's take as stored;
  Resolve: the media fitted to the timeline), read from what each did with what it was given
- the CapCut draft keys position, scale and opacity (common_keyframes); its crop holds as the first frame shows it,
  and a crop that changes over the clip (a split screen's seam) is said: CapCut can't show it
- keys a straight line between gives to 0.15 px are left out; a clip at another speed is placed at its own, and said

Also: a layer's ProRes movie that opens on an opaque frame keeps one sample description with alpha (VideoToolbox
otherwise starts a second, which Premiere won't import and Resolve shows opaque); a sound's clip ends where its file
does; the stack's duplicate code folded (tools/dupes.max 59 -> 58 near).

Checked on 11-17: Premiere Pro 26.2.2 and DaVinci Resolve 21.2.0 on the Telluride test (iPhone takes, a keyframed
split close) and the positioning test (horizontal and phone takes, 1080 and 4K compositions); CapCut 9.5 on Telluride;
LA3a composites the fixtures and the positioning test back as the render at 33-49 dB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:22 -08:00
Zachary GuglinandClaude Opus 5.5 1caad9f024 layers LA5: raea export xml imports into Premiere Pro and DaVinci Resolve as raea rendered it, stereo kept
- Each channel of a stereo file is panned to its side by FCP7's Audio Pan on its clip (-1 left, 1 right), as Resolve
  writes it. Without it Premiere and Resolve both imported the channels centred, so a stereo track played as mono
  (heard with a raea-rendered track, a low note left and a high note right). Premiere's own track pan
  (PannerCurrentValue) was tried alongside it and neither editor read it, so it isn't written.
- Sequence explodedTracks, a timecode on every file and a uuid, as Premiere writes them: without them Premiere
  imported the mono-a-channel sound as an empty A1.
- docs/layers.feature: LA5a's sound layout and pan; LA5b's results on 11-16 (Premiere Pro 26.2.2, DaVinci Resolve
  21.2.0: the multi-clip test with every track, clip, source time, placement and caption as raea rendered it, nothing
  offline, ProRes 4444 transparent, footage sound linked, music stereo); LA5c, CapCut 9.4.4589 opening the drafts
  (CC3a). No editor needs an XML of its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:22 -08:00
Zachary GuglinandClaude Opus 5.5 230a265b34 layers LA5a: raea export xml writes an FCP7 XML project for Premiere Pro and DaVinci Resolve (work in progress)
- apps/layers xml.rs (pure): layers.json as xmeml version 5: one sequence at the composition's rate (29.97 as 30 NTSC)
  and size; video tracks bottom first; footage at its file where it is, placed by Basic Motion (scale, centre in frame
  units), a Crop where object-fit: cover cuts it, its Opacity; the layers' movies full frame, alpha straight; Audio
  Levels as linear gain; a footage clip linked to its own sound.
- Sound laid out as Premiere Pro 2026 writes it, read from an XML it exported: the sequence explodedTracks, each
  stereo file's channels described one by one, each channel a mono clipitem on a track of its own (sourcetrack and
  outputchannelindex 1 and 2), every clipitem of a clip and its linked clip linked together, a masterclipid each, and a
  timecode on every file. The first layout (one stereo clipitem on a "Stereo" track) imported with no audio at all.
- File gains channels and sample_rate (layers.json reads files without them as stereo at 48 kHz).
- `raea export xml EDIT.tsx [-o DIR]`: the layers into out/xml/NAME, NAME.xml beside them; in raea's help and the
  manual.

Checked so far: the multi-clip test imports into Premiere Pro 2026 with its video and, after the layout above, its
sound. Still to check: placement, transparency and Unlink in Premiere; all of it in Resolve.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:22 -08:00
Zachary GuglinandClaude Opus 5.5 338c140f4c layers LA2c: what's behind a picture in picture is its own layer, between it and the footage under it
A picture in picture on a card over footage that fills the frame lost its card: the card is a background holding
footage, so it went into the under layer, beneath every piece of footage, where the full-frame clip covers it (the
multi-clip test's C in the corner over B at 4-6 s: 23.2 dB). CapCut's export always had this.

- systems/layers hide.rs: RAEA_LAYER=behind:FILE draws the backgrounds of what holds FILE and no other footage; what
  holds other footage too is cleared, not hidden (the page draws nothing inside a hidden element); the rest hidden.
- apps/layers: a behind:FILE pass for each file shown as a picture in picture, its clips kept only where it is one, on
  a "behind picture in picture" track (Layer::Backing) between the pictures in picture and the footage that fills the
  frame. CapCut names it "raea behind picture in picture".
- composite.rs finds a layer's frames by its movie's name (several backing passes), and RAEA_LAYERS_PROJECT checks a
  project of its own: the multi-clip test passes at 36.2-42.7 dB (37.5-38.3 in the picture in picture); the fixtures
  still pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:22 -08:00
Zachary GuglinandClaude Opus 5.5 26a3415c47 layers LA4b: raea export capcut is written from layers.json, with a captions track and the reference in the draft
- apps/capcut exports the composition in layers first (raea_app_layers::export into out/capcut/NAME: the reference,
  the graphics, under and captions passes, layers.json) and writes layers.json as CapCut's tracks (from_layers.rs,
  pure): bottom first, the footage CapCut's main track, "raea overlay" (the graphics) above it, "raea captions" above
  that, "raea under" below the footage when there is one. A footage clip's linked sound is its volume, as CapCut keeps
  a video's own sound (Extract audio separates it); footage with no linked sound is silent.
- The reference render is copied into the draft's folder, on no track (where CC2d kept it only beside the draft).
- The export's own three renders, its overlay and under spans, its footage-covered check and its media probes go:
  raea-app-layers does them, for every editor. CapCut keeps where a picture sits in its terms (plan::place) and the
  draft's cover. The manifest readers' tests move to raea-app-layers with the code; `lay` goes (model::lay).
- What changes for a composition with no captions: the 3D is under the footage, as raea draws it, not over it.

Checked: lower-third and three-d (apps/layers/fixtures) exported as drafts with -o: footage, raea overlay, raea
captions (frames 10-50) / raea under, raea overlay, raea captions; reference.mp4 in each draft folder. Tests:
raea-app-capcut (with a layers.json-to-tracks test), raea-app-layers; tools/layers.sh; manual regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:09 -08:00
Zachary GuglinandClaude Opus 5.5 6b410a9827 layers LA2b, LA3a, LA4a: raea export layers writes the layers and layers.json; the 3D is the layer under the page
- apps/layers (new): `raea export layers EDIT.tsx [-o DIR]` renders the reference with its manifest, then the
  graphics, under (when there's footage or 3D) and captions (when a frame shows one) passes; writes each layer's
  movie, layers.json (model.rs: the editor-neutral timeline, tracks top to bottom, footage linked to its own sound),
  NAME.srt (srt.rs) and reference.mp4. The manifest's readers (runs, sounds, spans, full, resolve) move here from
  apps/capcut/src/plan.rs; CapCut keeps its own placement and track laying and reads the rest from here.
- engine/page manifest.rs: a text entry inside data-raea-role="caption" says caption: true (the SRT's words, and
  whether the captions pass runs). runtime/export: the manifest says has3d.
- The 3D moves from the graphics layer to the one under the page (raea_sys_layers::draws_3d): raea draws the 3D first
  and the whole page over it, footage included. The under pass renders opaque, since --alpha clears the 3D's clear
  colour, which is the page's background over 3D (three-d lost its background: 21 dB before, 39 after).
- vendor/blitz-dom mutator.rs: an element whose :has() was matched (ANCHORS_RELATIVE_SELECTOR) is matched again when a
  node under it is inserted or removed, as Chrome does. A caption a <Sequence> put on the page at frame 10 stayed
  hidden under the captions pass's :not(:has(...)) (lower-third: 23.5 dB before, 34.1 after); footage coming in
  later under RAEA_HIDE_MEDIA=under had the same fault. Recorded in vendor/vendor.toml.
- apps/layers composite.rs (LA3a), an ignored test run by hand with a GPU: four fixtures (apps/layers/fixtures)
  exported, composited back bottom to top at each clip's first, middle and last frame, against the reference:
  highlight 33.0-35.1 dB, lower-third 34.1-35.1, pip-card 33.2-33.5, three-d 39.1-39.8 (floor 30).
- docs/layers.feature brought up to what was built; docs/manual/reference/cli/export.md regenerated
  (tools/manual-ref.sh gen). The skill's reference/cli.md (raea-skills) needs the new verb with LA7.

Tests: raea-app-layers, raea-app-capcut, raea-sys-layers, raea-runtime-scene, raea-runtime-page, raea-runtime-bundle,
blitz-dom, raea-cli (with the skills submodule), sdk/timeline; tools/layers.sh. raea export capcut runs as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 15:04:09 -08:00
Zachary GuglinandClaude Opus 5.5 9df6d769e3 layers LA1-LA2: captions marked data-raea-role="caption", and RAEA_LAYER renders one layer of an export (captions, graphics, under)
docs/layers.feature amended: text is part of the graphics layer (a text layer only ever opt-in), one `raea export xml`
for Premiere and Resolve, the composite check a test of the method rather than every export's, no reuse of an earlier
render, no unmarked-caption heuristic.

- sdk/timeline: the captions operation's `text` ops say `caption: true`, as does a caption clip added on its own
  (said: true), so the code raea-feed writes can carry the mark.
- runtime/page elements.rs: data-raea-role is kept on the page (KEPT names the data-raea- props the page keeps; the
  mark was dropped before it could be matched).
- systems/layers hide.rs: RAEA_LAYER=captions draws only what is marked a caption: the page draws nothing inside a
  hidden element (vendor/blitz-paint render.rs), so what holds a caption is cleared, not hidden, as RAEA_HIDE_MEDIA=under
  clears what holds footage. graphics and under are RAEA_HIDE_MEDIA's 1 and under, less the captions. RAEA_HIDE_MEDIA's
  own CSS is unchanged, so raea export capcut is too. hiding_css is the pure function hidden_css reads the settings into.
- runtime/scene items_of: a layer that draws no 3D (captions, under; raea_sys_layers::draws_3d) keeps only the
  cameras, since Bevy draws the 3D and the page's CSS can't hide it. This also keeps the 3D out of capcut's under pass
  once it moves onto RAEA_LAYER.
- runtime/bundle cache.rs: a render with RAEA_LAYER isn't the export cache's, as with RAEA_HIDE_MEDIA.

Checked with a source build on two fixtures (footage on a card, a lower third and a caption with a highlighted word;
a 3D turntable with a title and a caption): each layer draws only its own, and raea export capcut writes its draft
as before. Tests: raea-sys-layers, raea-runtime-scene, raea-runtime-page, raea-runtime-bundle, sdk/timeline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 14:58:27 -08:00
Zachary GuglinandClaude Opus 5.5 52a07b6239 layers spec, amended: text stays in the graphics layer, captions are the only layer split out of it
docs/layers.feature after working through the implementation:
- Text is part of the graphics layer. Pulling words apart from the graphics they're built into (kinetic type, words
  cut from a shape, a word behind a graphic) caused more problems than it solved; a text layer may come later, opt-in
  only (an element marked data-raea-role="text"), never guessed.
- Captions are the only layer split from the graphics: marked data-raea-role="caption", nothing guessed.
- One `raea export xml` for Premiere and Resolve; a command of an editor's own only if testing finds it reads the XML
  differently.
- Leaner: the layers composited back is a test of the method, not run on every export; an export always renders its
  own reference; no `raea check` heuristic for unmarked captions; no moving covered captions (captions go on top).
- What rendering the passes taught: the page keeps only the data-raea- props it names, it draws nothing inside a
  hidden element (so the captions pass clears what holds a caption), and 3D is Bevy's, so a layer without it leaves
  the 3D out of the scene and keeps its cameras.

Spec only; no code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 14:10:32 -08:00
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
shane d870159c46 @raea/task and docs/plan.feature: a project's plan.org as typed tasks, read and written by task id (#154)
sdk/task reads and writes a project's plan.org (Org mode) as typed tasks: keywords, properties, kinds and views a plugin can add, React hooks and components. docs/plan.feature files the plan work, landed for 0.1.4. The skills submodule moves to raea-skills e249001 (#75: section 0 step 5, open or start the project's plan).
2026-11-14 21:48:16 -05:00
shaneandshinyobjectz 4d7fa914cc Files dragged from the Finder reach the page in raea's window (app.drops) (#153)
The Source page takes files dropped anywhere on it (raea-feed's Source redesign, 0.1.4). In a browser the page's own
drop events carry them; raea's window draws the page natively, so winit's drag-and-drop never reached it. The window
keeps Bevy's FileDragAndDrop messages, whether files are over it and the paths dropped, and the page asks with
app.drops -> {over, dropped}: over while a drag is on the window, then each dropped path once. A drop is the person's
own act, so it is kept with or without --window's live calls.

Test: native::drop_tests (over while dragged, not over once it leaves, the paths handed once in order).

Co-authored-by: shinyobjectz <[email protected]>
2026-11-14 20:44:17 -05:00
shane a4bb6e5c1d raea show --project: ids, not titles (Shane 11-14: "when posting to a feed we should use feed ids or something i consistently see the agents getting them mixed up by name") (#152)
The help says what --project takes now: Workspace/id (ids as raea workspace --json lists them), a folder in the project, or a Copy reference from the app; a title only when it is the only one and the folder is not in another project. The resolving is the app host's (raea-feed host/show.ts placeOf, integration-014 de50fe7).

skills pinned to raea-skills c293caa (#74): SKILL.md section 0 names a project by WORKSPACE/ID everywhere, and the raea show paragraph passes --project WORKSPACE/ID or the pasted Copy reference.
2026-11-14 20:06:19 -05:00
shinyobjectz 5f65114ce5 docs: fingerprint and libraries run on your own computer, not only a Mac
raea ships for Mac, Windows and Linux, and the fingerprint's encoders run on ONNX Runtime on all three
(systems/columns), so the manual's index, fingerprint page and API guide say "your own computer" where they said
"your Mac". The get-started tutorial keeps its Mac wording until its narration is re-recorded, and the 0.1.2 notes
stay as they shipped. raea.io already serves this text (Pages deploy addc4fdc).
2026-11-14 16:08:16 -08:00
shinyobjectz 87bfda4ed2 skills pin: raea-skills #73 (7e59af0): SKILL.md section 0, settle the workspace and the project before making anything (Shane 11-14: agents start creating and forget to pick a workspace and a project) 2026-11-14 16:06:16 -08:00
shinyobjectz 3b61818eb9 Inline SVG painted by a class draws its colour in raea's window, not black: a fill or stroke a stylesheet or class sets (svg_css_paint, the #45 path) was written into the serialized SVG as its computed value, and a colour's computed syntax is its own (oklch(), lab(), color()), which usvg doesn't parse and draws black. The app's ink tokens are oklch, so a class like stroke-ink-4 or fill-[var(--ink-4)] (the timeline's curve handles, a test chart's labels) drew black on the dark ground; the window's log said "Failed to parse fill value: 'oklch(0.96 0 0)'. Fallback to black." Each such value is now sRGB rgba(), as attributes and currentColor already were; none, currentcolor, rgb() and url() are left as they are. Checked: blitz-dom svg_paint_tests (oklch and lab to rgba, the rest kept), cargo test -p blitz-dom --lib 90 of 90. 2026-11-14 15:43:35 -08:00
shinyobjectz 1680860ff4 raea-io-gen-fit: fit.rs moved out of raea-io-gen into its own crate, re-exported as raea_io_gen::fit so every path stays. raea-io-gen was at its 2000-line crate limit on main, and the picture fallback (Keys) put it at 2095; it is now 1930. route.rs's Keys comment no longer names raea's env file by its literal path, which made skills' files.md stale. Checked: cargo test -p raea-io-gen -p raea-io-gen-fit --lib, 26 and 1 (the same 27 as before). 2026-11-14 15:38:57 -08:00
shinyobjectz 74ce0ff737 raea gen: a picture step on a host with no made.app key goes to fal, then OpenRouter
The app's Images and video now offers made.app, OpenRouter and fal (Shane 11-14: "maybe add openrouter and fal as other image options"). made.app is a key only: its OAuth tokens open its MCP server, never the API raea gen calls. So a person who signs in to OpenRouter or adds a fal key there, and has no made.app key, needs raea gen to use it: before, every picture step that named no model went to made and failed asking for MADE_API_KEY.

route.rs: the policy knows which picture services this host has a key for (Keys::here: MADE_API_KEY, FAL_KEY, OPENROUTER_API_KEY, from the environment and ~/.raea/env; cli.rs fills it in). With no made.app key, image.generate goes to fal's fal-ai/nano-banana-2 (made's own default for pictures) and image.edit to its /edit endpoint, else to OpenRouter's google/gemini-3.1-flash-image, each with a note saying why. A made.app key here, a step that names its model, and every other op route as before; with none of the three keys a picture step still goes to made, which asks for its key. The fal and OpenRouter backends already made pictures (hosted.rs).

Tests: tests_keys.rs (made first when its key is here, fal then OpenRouter without it, an edit to fal's edit endpoint, video and named models unchanged); cargo test -p raea-io-gen --lib 27 of 27.
2026-11-14 15:34:27 -08:00
shinyobjectz 90891cc86f skills pin: raea-skills #72 (cd4cddb) for 0.1.4. SKILL.md's sources comments name only paths in the public tree: apps/site/public/install and docs/targets.feature are dropped, since the strict skills gate checks each one exists and failed in a clean export of main 2026-11-14 13:56:20 -08:00
shinyobjectz bb7dc3b79f #131: what an R3F scene throws is the composition's error, and three's PMREMGenerator no longer takes the scene with it. The scene renders under raea's own error boundary (sdk/r3f session.ts Caught): a throw while rendering, in an effect or a ref is thrown out of the <R3F> drawing it, the root ended, so the render is refused naming it as a throw outside R3F is ("REFUSED the composition threw at frame 0: Error: mesh threw", exit 1). R3F's own root only reported it (reportError, else a stack without its message), drew nothing and the render ended with 0 errors. PMREMGenerator (pmrem.ts): fromEquirectangular of a panorama raea loads is that panorama, lighting the scene as scene.environment; fromScene (RoomEnvironment) and fromCubemap are left out with a warning naming them, the scene drawn without them (it threw in _sceneToCubeUV inside the stand-in renderer). Checked: both of the issue's repros (the box now draws, the throw now refuses), sdk/r3f test/errors.test.tsx 4/4, the r3f suite 54/55 (the one failure is coverage.test's Skybox/Lightmap raea-web parity cases, unrelated and failing before). docs/r3f.feature R3F15 2026-11-14 13:44:37 -08:00
shinyobjectz d6d7a520a7 #151: a package that imports raea shares the composition's SDK. A package in the project's node_modules (or the person's plugins) importing "raea", "raea/<module>" or "@raea/<package>" resolves to the work folder's copy of that module, where the composition's own imports were pointed (engine/bundle edit.rs sdk_copy, by sdk/tsconfig.base.json's paths), so one SDK and one Clock. A package isn't rewritten as the edit's own files are, so its import resolved nothing and Rolldown left raea an outside global: 0.1.3 refused it before the first frame with "Can't find variable: raea" while the same file by a relative path drew. Checked: the issue's repro (vk-parts) refused with 0.1.3's shipped bundler, draws the bar at frame 29's width with this one; engine/bundle/tests/bundle.rs a_package_importing_the_sdk_gets_the_work_folders_copy (8/8 pass). docs/ecosystem.feature EC13 2026-11-14 13:42:16 -08:00
shinyobjectz c05dfc946e Ellipsis cuts only text that doesn't fit (0.1.4, Shane's test window: onboarding's face picker drew Frog as "Fr…" and Dog as "D…"). blitz-paint measured where an ellipsis goes against the box's rounded content width, which can be up to a pixel narrower than the text the box shrink-wraps, since each edge rounds on its own; past half a pixel over, a word that fits was cut. The ellipsis and a line clamp's end now use the unrounded content width the text was laid out in. bench/ellipsis-fit/check.sh renders shrink-wrapped labels with ellipsis and with clip and wants them byte-identical, and a word wider than its box to differ; it fails on the raea before this 2026-11-14 13:39:55 -08:00
shinyobjectz c3b2108412 release.yml: Windows builds openh264-sys2 every time instead of taking it from the cache volume's target/. v0.1.4-rc1's Windows job restored target/, compiled only raea-cli, and failed to link raea.exe on 135 of openh264's SIMD routines (WaverageChromaFilter8_sse2 and the rest), the failure 0.1.3-rc4's Chocolatey nasm left: a build whose assembly never reached the rlib stays fresh to cargo. Its C++ still comes from sccache 2026-11-14 13:18:02 -08:00
shinyobjectz 2fe9f13908 skills pin: raea-skills #71 for 0.1.4 (storage_status, storage_plan, storage_trash and footage_add taught, the SOP for old video, and cli.md, feed.md and files.md regenerated against main's help and the 0.1.4 feed app). sdk/guides/craft/motion/rendering.md takes the skill copy's text, so the copy check holds: keep a replaced version, never rm a render, name versions -vN, and send old video through storage_plan and the person's yes to storage_trash 2026-11-14 12:56:35 -08:00
shinyobjectz 1c93300361 raea.root is never ~/Studio by default: with none set, a workspace someone names goes in ~/Documents/raea (or ~/raea under iCloud), and ~/Studio, the root on raea's own Mac before 11-10, is no one else's (Shane 11-14: "no internal no studio, its up to the user to set their workspace"). raea-feed's host says the same (integration-014 c01686e); raea's own Mac keeps ~/Studio through raea.root. 2026-11-14 12:29:46 -08:00
shinyobjectz ef5761d300 dmg: a failed Finder layout stops the build. The osascript ran inside an echo's $(...), where set -e never sees it fail, so dmg.sh reported ok on an image with no picture and Finder's default places (the check found it by forcing the layout script to error) 2026-11-14 12:09:56 -08:00
shinyobjectz 37652ae571 dmg: raea's Mac installer window, drawn by raea
tools/release/dmg makes the Mac download as a disk image: raea.app beside an Applications link in a Finder window
laid out over raea's own picture. background.tsx is one WGSL shader (ShaderMesh) rendered by raea: paper, a pixel
falloff Bayer-dithered into the corners, the cat leaping from the app toward Applications as dithered onion skins,
the rest of its arc as dots with a pixel arrowhead, and a second cat asleep in the corner. render.sh renders it at
1x and 2x into one multi-resolution TIFF (tiffutil -cathidpicheck), committed as background.tiff; --loop renders
the same scene moving (the leap, 3 s at 60 fps), since Finder only ever shows a window's picture still.

dmg.sh APP OUT.dmg [--volname] [--sign ID [--keychain]] [--notarize ENV]: a writable HFS+ image, the app copied in
with ditto, layout.applescript has Finder set the window (680x440 content, icon view, no toolbar, 128 px icons,
the picture, each icon's place) so Finder writes the .DS_Store, then the app's icon as the volume's, then ULFO.
Finder on macOS 27 deletes a .VolumeIcon.icns and clears the custom-icon flag when it opens the volume, so the icon
goes in after the layout. Labels are drawn black over any picture in both appearances, so the window stays light.
check.sh mounts an image read-only and checks its files, the layout's picture and the window Finder reads back.
Built and checked here with a stand-in app; nothing signed or notarized.
2026-11-14 12:09:56 -08:00
shinyobjectz 0ed836095e SK13: raea-cli stays under its 2000 lines (origin/main had it at 1999). Where each agent reads skills moves to apps/tools agent_skills.rs (folder, agents, AGENTS), beside agent_mcp, agent_hooks and agent_grokbot; raea skills install and raea doctor read it there. Grok Bot's install step is agent_grokbot::stage: the preface in the staged SKILL.md, refused over the 256 KB Grok Bot's Add new skill takes (MAX_SKILL), and the links; its test moves with it, and raea-cli's skill test checks the shipped SKILL.md with its preface fits. The preface is written in with_preface, its one caller, and ask takes the folder (both were structural twins of other code: dupes). raea-cli 1975 lines; cargo check -p raea-app-tools -p raea-cli --tests passes; the unit tests weren't run here (a debug test build of apps/tools needs the whole engine, about 15 GB, and filled the disk) 2026-11-14 12:09:48 -08:00
shinyobjectz b1b47b7cfa SK13: the manual's raea skill and raea skills pages name grokbot among --agent's values, and say how its copy is staged (regenerated from raea's help with tools/manual-ref/cli.ts gen; L1's manual reference step failed on them) 2026-11-14 12:09:48 -08:00
shinyobjectz c939b27aee SK13: Grok Bot as a raea skills install target. Grok Bot (xAI's desktop agent, /Applications/Grok Bot.app 1.1.0) keeps its skills and MCP servers on a computer of its own in the cloud and has no hooks, CLI or ACP; what reaches this Mac is its Execution on this computer. So raea skills install --agent grokbot stages raea's skill in ~/.raea/grokbot/skills (RAEA_GROKBOT_HOME), stamped, with a preface after the front matter saying raea runs on the person's Mac and how to run it there, and prints Grok Bot's own links that finish it: grokbot://app/v1/settings?id=local-execution and a prompt link, filled in but not sent, asking the Bot to make the skill from the staged file (or Skills, Add new skill, Upload file). No MCP server: Grok Bot would run its command on its own computer. apps/tools agent_grokbot.rs holds the folder, the preface, the links (encoded as Grok Bot encodes its own, within its 1000 and 2048 character limits) and the closing text; engine/cli skill.rs adds the agent and splits install_into for a test. Not built here: cargo test -p raea-app-tools agent_grokbot and the engine/cli skill tests need the integrator's lane build. 2026-11-14 12:09:48 -08:00
shinyobjectz 0ef7287fde HW0a: raea-page-sound's layer (runtime, as raea-page-stage and raea-page-window: it builds on raea-runtime-js and the mixer) 2026-11-14 09:15:19 -08:00
shinyobjectz fce94e630b HW2b: the switches' thumbs centred, 2 px all round, in Chrome and in raea's window (Shane 11-14: "slightly off center"; a thumb has no skirt and its groove is shaded evenly, as a well's lit lip read a pixel low). Shane 11-14: the kit goes into 0.1.4 2026-11-14 09:10:41 -08:00
shinyobjectz 2a38cbc2df HW: docs/hardware.feature's status as built and measured (11-14): HW0 to HW4 built; HW0b 200 presses 0 late on the mixer and 40 presses 0 late in raea's window; HW1b loudest voice -22 dB; HW2b matched by eye, the ui-parity run to do; HW5 open 2026-11-14 08:52:54 -08:00
shinyobjectz 2ce68890b8 HW0b: a fired sound is heard within the mixer's head. systems/mix tests/fire.rs opens the real output device muted (RAEA_AUDIO_MUTE=1) with a tap, fires 200 presses 15 ms apart through Live::fire, the graph with the first only as raea/tone's fire() sends it: 0 of their events reached the audio thread late, and the tap (the limiter's output, before the mute) holds 200 presses. Ignored by default, as it opens a device: cargo test -p raea-sys-mix --release --test fire -- --ignored. Also raea/tone's Meter.getValue is number | Float32Array, so FFT and Waveform (bins) type-check: sdk/audio's tsc had two errors there 2026-11-14 08:44:33 -08:00
shinyobjectz 4c392f60d6 HW0a: a page plays a sound now, on raea's mixer. raea's window has no Web Audio graph (sdk/ui platform audio.ts leaves AudioContext out), so a page's interaction sounds had no way to be heard: only a composition reached the mixer, a frame at a time. Live::fire (systems/mix live/fire.rs) plays raea/tone events at the clock's now plus the head plus their own time, building the graph when it changes; raea-page-sound (engine/page/sound) is the page's sound.fire and sound.report calls, a mixer of the page's own on a thread that opens the device on the first fire and rests its stream after 10 s idle; raea/tone's fire(play) runs play as <Sfx> runs a game's one-shot and sends its events, and the graph when it changed, to sound.fire (a browser gets no sound and one console line). Spec: docs/hardware.feature (Shane 11-14: a dark kit of our own, SPEC-01's idiom, its sounds on raea/tone and Firewheel) 2026-11-14 08:27:12 -08:00
shinyobjectz b4e8310f1f TL13a: where the drag's frame goes with the fine restyle. docs/timeline.feature: RAEA_TWIN_SYNC_LIGHT again gained nothing in four interleaved rounds (drag over still 0.62-0.67 with it, 0.65-0.67 without); a macOS sample of the page host's main thread through a 4 s drag: the page's JavaScript for the pointer event 18%, paint 18%, the snapshot of every element's box 11%, the twins' boxes taken before each event 7% and each frame 5%, Stylo's restyle 2.5% (28% before). The drag adds about 2 ms to an 18-19 ms still frame, so an incremental snapshot and paint are what is left 2026-11-14 08:25:32 -08:00
shinyobjectz 9cffd0bf0a TL13a: raea-page-host restyles finely by default. Each attribute set or cleared restyles what Stylo's snapshot invalidation finds and each ancestor itself, not the element's parent's whole subtree; RAEA_FINE_RESTYLE=0 brings back Blitz's own way, and other binaries keep it off unless set. Proven before it was made the default: ui-parity full with it on is 269/271, the same two cases failing as with it off (p15-media canvas-text and img-downscale); the app's timeline suite in a headless raea window with it on passes 53 of 54 (TL10d skips itself there); the 400-clip drag in that window ran at 48-50 fps against 38-41 without, the window's still rate 52-55. The page host sets it in main before any thread starts, as --root's RAEA_PAGE_ROOT is. docs/timeline.feature TL13a has the numbers 2026-11-14 08:09:22 -08:00
shinyobjectz d190585622 TL13a: under RAEA_FINE_RESTYLE each ancestor of a changed element is matched again, itself only. Stylo's snapshot invalidation doesn't reach an ancestor whose :has() reads the changed element: basecoat's .field > label:has(input:checked) kept its unchecked look under the trial (ui-parity p18-dom/lib-basecoat, 268/271 against 269/271 off). Without the trial the parent's whole subtree restyle hid that. The mutator's set_attribute and clear_attribute now add RESTYLE_SELF to every ancestor under the trial, which re-matches :has() on any of them without restyling their subtrees (a track's every clip, TL13a). Unset, nothing changes 2026-11-14 07:50:17 -08:00
shinyobjectz 912c957c9f TL13a: the page's layout snapshot writes its numbers in place. snapshot.rs num made a String of each number with format! before pushing it; a frame writes every element's 17 numbers (about 50,000 with 400 timeline clips) for the JS's layout. write! into the snapshot gives the same bytes without an allocation each 2026-11-14 07:31:09 -08:00
shinyobjectz 2b9f1ad862 TL13a: under RAEA_FINE_RESTYLE the snapshot names the attribute that changed. blitz-dom's snapshot listed as changed only the attributes the element had when it was taken, so an attribute being added (data-state appearing) or a second one changed before the flush was never among them, and the trial's invalidation, which reads only what changed, left [data-state=open]'s elements unstyled: ui-parity 266/271 with the trial on against 269/271 off (p14-forms/select-keys, p18-dom/lib-basecoat, p18-dom/lib-radix). The mutator adds each set or cleared attribute's name to the snapshot under the trial; unset, nothing changes 2026-11-14 07:25:59 -08:00
shinyobjectz b1bfc9ba41 TL13a: RAEA_TWIN_SYNC_LIGHT read once per twins pass, at its top, in place of a cached closure of its own (the closure was a near copy of material clay.rs's, a new dupes group); the same answer, one env read per event's sync 2026-11-14 07:19:28 -08:00
shinyobjectz d5b8b9ab35 TL13a: a page's rects taken with less work. blitz-dom transformed_rect first walks the containing-block chain without matrix math and answers None at once when no node on it has a transform or projection (the full walk then never multiplies a non-identity in and returns None too, so every answer is the same); it was the busiest leaf of a 400-clip timeline drag in raea's window, as every element's rect is taken each frame for the twins' boxes and the JS layout snapshot. raea-runtime-twins: RAEA_TWIN_SYNC_LIGHT=1 (a trial, off by default) has an event's sync_twins keep a kept twin's box rather than take every element's rect again on each pointer move: layout has not run since the frame's own twins pass took them, and that pass takes them again after this frame's layout; a new twin still takes its box at once. Unset, the sync takes every box as before 2026-11-14 07:14:46 -08:00
shinyobjectz a10d64ab75 TL13a: RAEA_FINE_RESTYLE measured. docs/timeline.feature: the 400-clip drag in a headless raea window, three rounds alternating, 37, 47 and 49 fps with the trial on (median frame 25.0, 19.2, 18.9 ms) against 31, 34 and 38 off (34.6, 30.4, 27.9 ms), the window's still rate 51-57. Not yet the window's rate, and not the default until ui-parity passes with it on (no disk for its build). One profiled drag with it on points at the rect walk next 2026-11-14 07:08:59 -08:00
shinyobjectz 1f3a058ba0 TL9b: the timeline's Send followed to the agent. docs/timeline.feature status: in raea-feed PR #19 (faf00e2) a composition's cutout, on Send, finishes the version on the host and then posts the item's own session a prompt holding the cutout's words, with nothing sent before Send and no prompt when the composition's tell is skipped; live on Claude over ACP (d63098e, e2e/timeline-live.spec.ts), the agent's first act was a search for the v2 composition and its matte 2026-11-14 07:04:31 -08:00
shinyobjectz c4550ad6ba TL7l, TL7m: a composition's footage cut out. raea's <Video> takes a matte (sdk/video media.tsx, VideoMatte exported from raea/video): a folder of PNG mattes in the media folder (m00001.png on), the file's rate, one each every frames and how many; it wears the one its source time is on (data-source-time, so trims, playbackRate, speed curves and loops follow) as its mask-image, sized and placed as its objectFit and objectPosition place the picture, the last past the end, and refuses it with framing or punchIn (the engine places those). Blitz paints raster mask-images as it paints backgrounds, and raea's render loads each frame's: a 3 s face clip's Vision mattes worn this way kept on every frame what that frame's matte keeps (overlap 0.92 at least, 0.972 on average; the uncut composition 0.53). sdk/timeline copies.ts: a media row's cutout (the matte prop's numbers, data-matte, data-brush-at, data-brush-strokes) is its clip's matte props as a film's (matte, matted, and matteFps, matteEvery, matteCount), and a set of those is the host's new cutout edit (raea-feed 2c59ec6: the host mattes the whole of what the <Video> plays into its media folder's matte/ and writes the prop; Stabilise and Retouch are refused while it is on). Conformance: 4 new Video matte tests in cutout.test.tsx. The manual's video, raea, index and editor pages regenerated (pbr.md's drift left out) 2026-11-14 06:50:28 -08:00
shinyobjectz afe2150d19 TL7n: a composition's footage retouched. sdk/timeline's composition copies move into src/copies.ts (heard, steady and now retouch: Copied, CopyEdit, copyProps, copyEdits; read.ts extends and delegates to it, nothing new exported). A media row carries retouch (of and the amounts above 0) when its <Video> plays a retouched copy; its clip's props are its own file, the copy (retouched) and the four amounts, as a film's clip has them, and a set of those is the host's new retouch edit (raea-feed de9a67d: the host retouches the <Video>'s whole file into its media folder's retouch/ and the edit writes src={staticFile(copy)} data-retouch-of and data-retouch-<amount>, the src as it was when off). Held steady too, the retouch is made from the steadied copy and comes off to it, and the clip's steadied prop is that copy (the copy under the retouch); Stabilise is refused while Retouch is on. A real 3 s face clip retouched in 4.3 s, a face on all 90 frames, and raea's render of the edited composition is the copy's own frame (0 apart; the file's is 1.4). Copies, moves and mattes are read and made at the rate the frames' times sit on (a 30/1 clip probed 29.97 had made a copy that drew a frame behind). The manual's editor page regenerated (pbr.md's drift left out) 2026-11-14 06:35:06 -08:00
shinyobjectz a77d68ef93 TL7k: a composition's footage held steady. sdk/timeline: a media row carries steady (of, level) when its <Video> plays a steadied copy; its clip's props are its own file and the copy (file, stabilise, steadied), and a set of those on footage is the host's new steady edit (raea-feed 7600f78: the host reads the <Video>'s whole file, keeps the moves in its media folder's steady/ and has raea render a copy with each frame's move as the player wears it; the edit writes src={staticFile(copy)} data-steady-of data-steady, the src as it was when off). A 2 s clip shaken along a known path steadied for real in 3.4 s, its frame-to-frame shake 7.49 px to 2.12 at 320 px; a copy with no moves is its file's every frame. The manual's editor page regenerated (pbr.md's drift left out) 2026-11-14 06:17:39 -08:00
shinyobjectz fad2dbcbf4 TL8d: a composition's <Audio> has its noise reduced and its voice changed. sdk/timeline: a media row carries its file (its staticFile path) and, when it plays a copy, what the copy was made from and how (heard: of, denoise, voice); its clip's props are its own file and the copy (file, voiced, denoise, voice), as a film's sound clip has them; a set of those props on an <Audio> is the host's new heard edit (raea-feed 9094259 writes src={staticFile(copy)} data-voice-of data-denoise data-voice, and the src as it was when both are off). Each voice's copy is as loud as its source now (the voices had moved a line with pauses -12.5 to +8.6 dB). raea renders the result: a scratch composition's line at 105 Hz voiced, 140 its own. The manual's editor page regenerated (pbr.md's drift is the paint lane's, left out) 2026-11-14 06:05:51 -08:00
shinyobjectz f9129e758c TL13a: the stage clause measured: an edit on the scene's stage by 88 ms (median of 16, sound upper bounds that count a capture's read back; 81 to 113, 15 within 100), against about 1,050 ms when only the file opened again showed it; the playhead kept, a cut clip's length kept; the engine's two gaps (props on a paused stage, the reopen's second on the stage thread) filed 2026-11-14 05:48:42 -08:00
shinyobjectz b95a9fab63 TL13a: a sequence retimed live: the stage's props carry __raeaSequences (each named Sequence's from and length), which a Sequence takes over its own until the file it was written into opens again. domReads listens for raea-props in both runtimes (lite hands its bridge's addEventListener over as __raeaListen, since its entry gives domReads none). raea-feed b7e1514 sends them as an edit is let go and seeks a paused stage again so it draws them (set_props on a paused stage isn't drawn until something steps it, an engine gap); 16 edits on the stage in raea's window by 88 ms (median of sound upper bounds that each count a capture's ~78 ms read back), the playhead held through each reopening 2026-11-14 05:48:18 -08:00
shinyobjectz af752e3a27 TL13a: the window drag told apart: a carried clip lost the pointer's capture (fixed in raea-feed 957f292); what is left is the page host's frame after a step, Blitz's widened restyle first (RAEA_FINE_RESTYLE, not yet measured) 2026-11-14 04:41:00 -08:00
shinyobjectz 85d331898f TL13a: RAEA_FINE_RESTYLE, a trial (off by default): an attribute set or cleared restyles what Stylo's snapshot invalidation finds, not the element's and its parent's whole subtrees
blitz-dom's set_attribute and clear_attribute add restyle_subtree() to the element and to its parent (an upstream TODO: make it fine grained) on top of the snapshot they take, which Stylo's traversal already diffs against the selectors that read the attribute (siblings and ancestors included). So a style change restyled every sibling's whole subtree: in raea feed's timeline (TL13a), a clip dragged along a track restyled every clip on its track each step, and Stylo's restyle was 28% of raea's window's main thread through the drag (a macOS sample of raea-page-host, 400 clips on 12 tracks). With RAEA_FINE_RESTYLE=1 the two subtree hints are left out: the snapshot's invalidation decides, and a style attribute keeps its RESTYLE_STYLE_ATTRIBUTE (its own declarations replaced, as Servo does). Unset, nothing changes. Not yet measured with it on: the release build that would ran the disk out (3 GB free); it is measured, and run against ui-parity, before it is proposed as the default.

Checked: cargo check -p blitz-dom; L0 on the file passes but for three steps other lanes' applied work fails in the shared tree (dupes' repo-wide count, raea-runtime-segments' layer, pbr.md's manual reference).
2026-11-14 04:36:00 -08:00
shinyobjectz 8e5f1d449c TL7n: footage retouched (CapCut's Retouch) filed and built: four sliders applied, faces found by Vision and retouched by Core Image on the host into a copy with the part's own sound, which the player shows in the clip's place once it has the frame; counts 49 in Chrome, 47 of 49 in the window; Not yet emptied 2026-11-14 03:44:13 -08:00
shinyobjectz daa81ca944 TL7m: footage cut out by what is brushed over it (CapCut's Custom cutout): strokes on the picture, Vision's subject instances under them followed through the clip; Not yet is Retouch; 48 browser tests 2026-11-14 03:05:22 -08:00
shinyobjectz 03e3b77578 TL7l: footage cut out (CapCut's Auto cutout): Apple's Vision mattes each frame on the host, the player wears them over the clip's own mask; Not yet is brushed cutout and Retouch; 47 browser tests 2026-11-14 02:44:39 -08:00
shinyobjectz c486a7fe16 TL7k: footage held steady (CapCut's Stabilize), filed and marked built (raea-feed PR #19 d440e5e: the clip's shake read by the host from its own file, host/shake.ts phase correlation over a grid of blocks, the path smoothed by its level, each frame's move and one zoom kept under media/stabilise and worn by the player under the clip's placement). The inspector's Not yet is now auto and brushed cutout, and Retouch; 46 Chrome tests, 44 of 46 in the window 2026-11-14 02:22:24 -08:00
shinyobjectz 78cb452725 TL8d: a sound's noise reduced and its voice changed, filed and marked built (raea-feed PR #19 183c005: a copy of the clip's own sound made on the host by host/dsp.ts, kept under media/voice, which the clip plays; both off, its own again). The inspector's Not yet is now stabilise, auto and brushed cutout, and Retouch; 45 Chrome tests, 43 of 45 in the window 2026-11-14 02:02:20 -08:00
shinyobjectz 29a3763ecf TL7j: a text's words read aloud, filed and built in raea-feed PR #19 (raea gen speech on the host, kept by the words' hash, a sound clip from the text's start) 2026-11-14 01:39:32 -08:00
shinyobjectz e4a0552663 TL7i: a mask's handles dragged on the picture, filed and built in raea-feed PR #19; a file from Media over the film takes its own vignette (TL7g) and its key's colour from its own file (TL7h) 2026-11-14 01:27:15 -08:00
shinyobjectz 08c70a8318 TL7h: the key's colour picked from the picture, filed and built in raea-feed PR #19 (read by the host from the clip's file, since raea's window has no canvas to read); TL7g's built entry and its Send line corrected 2026-11-14 01:16:21 -08:00
shinyobjectz d3762acbf1 TL7g: FilterStep's tag and attrs described, the manual regenerated with them 2026-11-14 01:00:22 -08:00
shinyobjectz d0e99b0d46 TL7g: skills pin to raea-skills #70 (9739d8d), the raea/editor exports line naming the Adjust and key exports (ADJUSTS, ADJUST_PROPS, KEY_NAMES, KEYABLE, adjustOf, adjustLook, propsAt and the rest) 2026-11-14 00:59:08 -08:00
shinyobjectz 494b395442 TL7g: a clip's own Adjust in the timeline. sdk/timeline adjust.ts: a clip's Adjust as its props (adjustBrightness..adjustGrain, 0 as shot; ADJUST_PROPS), read as the kinds not 0 (adjustOf), written whole (adjustProps), its errors, and the preview's look (adjustLook: the filter's id and steps, the vignette's background). read.ts: a sequence's <Nudge adjust> read back as the clip's props and written by the set edit with the rest of its placement; each kind keyed as adjust.<kind>. The app (raea-feed PR #19 8cab9ce): the row's adjust panel of twelve sliders, keyed, with reset; the picture wearing it as one filter after the key and a vignette layer; the host reading and writing <Nudge adjust>; Send saying it. Tests: 106 timeline SDK; 40 browser tests in Chrome, 38 of 40 in raea's window, two skipping themselves; the manual regenerated; the inspector bullet's Not yet without Adjust 2026-11-14 00:48:11 -08:00
shinyobjectz fa884594a6 TL5a, TL7g: a mask's, a key's and a crop's numbers keyed, and a part's own Adjust in the SDK. sdk/video nudge.tsx: <Nudge keys> takes dotted names (NUDGE_KEYED: mask.x..mask.round, chroma.strength, chroma.shadow, crop.left..crop.bottom, adjust.<kind>), each set into its still mask, key or crop (a mask or key it keys must be given; an adjustment starts as shot), a curve that overshoots held inside the value's range. sdk/video adjust.ts: CapCut's Adjust (brightness, contrast, saturation, exposure, sharpen, highlights, shadows, temperature, tint, fade, vignette, grain) as one SVG filter (a tone table, saturate and a warmth matrix, a 3x3 sharpen, a fractal noise added about its middle, its seed the frame) and a vignette layer; <Nudge adjust> draws them after its chroma key. A probe in raea and in Chrome: tone, colour, sharpen and vignette within 0.4% RMSE, grain the same strength (sd 0.0307 against 0.0308), its noise pattern raea's own. sdk/timeline: KEY_NAMES and KEYABLE (a clip's prop to its <Nudge keys> name, maskFeather to mask.feather), read back and written by them; propsAt, a clip's props at a frame with its keyed ones there. Tests: 25 Nudge keys and cutout, 12 adjust conformance, 99 timeline SDK; the counts (39 browser tests in Chrome, 37 of 39 in raea's window, raea-feed PR #19 e2d005b); the manual regenerated 2026-11-14 00:37:58 -08:00
shinyobjectz 5b93a70f70 TL7f: the timeline's mask, blend and key in the app (raea-feed PR #19, 4af65e9: a slider of its own track, since raea's window doesn't move a range input), the counts (38 browser tests in Chrome; 36 of the 38 in raea's window, two skipping themselves), maskStyle's prefixed properties set first so Chrome's standard mask-composite wins, and the skills pin to raea-skills #69 (6eb2cf3), the raea/editor reference naming the cutout exports 2026-11-14 00:22:23 -08:00
shinyobjectz a36df13992 TL7f: a part's mask, blend and chroma key, CapCut's Mask, Basic's Blend and Cutout's Chroma key. sdk/video cutout.ts: a mask is an SVG mask image laid over the frame (line, mirror, circle, rect, heart, star; turned, feathered by a blur no larger than the frame and its reach, inverted by excluding it from a solid layer), a blend is CSS's mix-blend-mode (CapCut's modes CSS has, Add as plus-lighter, then difference and exclusion), a chroma key an SVG filter whose colour matrix makes the key's hue transparent (strength, and shadow letting the screen's darker parts through half seen). <Nudge mask blend chroma> draws them; a masked part is placed in a full-frame layer so the mask moves with it. raea's renderer draws all three as Chrome does (a probe of a keyed green panel, a feathered heart, an inverted turned star and a screen blend; an SVG <mask> for inverting overran Vello's buffers, so it is mask-composite). sdk/timeline cutout.ts: a clip's cutout as props (mask, maskX..maskInvert, blend, keyColor, keyStrength, keyShadow), taken off by their plain values, the preview's look (cutoutLook) and its errors; a sequence's <Nudge> read back with them and written whole by the nudge edit. 18 conformance tests, 97 SDK tests; the manual regenerated 2026-11-13 23:52:40 -08:00
shinyobjectz 1190ab6953 TL7e: skills pin to raea-skills #68 (1d6530e), the raea/editor exports line naming COMBOS and COMBO_KINDS 2026-11-13 23:38:52 -08:00
shinyobjectz 5ab9285ed3 FT3e: a session started outside raea opens as a chat in raea (FT3e), and its bubble says who is on what, folded until opened (FT3f), filed with their status: built for 0.1.4 in raea-feed #25, stacked on #24, neither merged 2026-11-13 23:38:12 -08:00
shinyobjectz 3185fa5adb TL7e: the timeline's counts after Combo: 37 browser tests in Chrome, all passing; in a headless raea window 35 pass and the voice test and TL10d skip themselves there with their reasons 2026-11-13 23:07:40 -08:00
shinyobjectz 9f553d6ecc TL7e: a clip's Combo animation, CapCut's third kind. sdk/video edges.ts gains COMBOS, seven waves (pulse, sway, float, shake, swing, spin, flicker), each a property's values over one cycle eased between, comboStyle and joinStyles; <Transition combo={{ kind, frames }}> moves the part throughout with its in and out. sdk/timeline: Clip.combo { kind, length } (a cycle's frames: the clip's length plays it once, fewer loop it), the set op's combo, animStyle drawing it from the palette's combos, a plugin's Combos as data (timeline.combos, checked), and a composition's <Transition combo> as an edge op with side combo, read back. fromSequences now reads a sequence's in and out that no cut's transition takes as the clip's own In and Out (TL7d), so they survive the host's re-read. 90 SDK tests, 5 Transition conformance tests; the manual regenerated 2026-11-13 23:03:35 -08:00
shinyobjectz acb4aa404d TL14b: a sound's own tracks (fromTracks, clipEdits) move from sdk/timeline read.ts to sounds.ts, which keeps read.ts under its 500 lines 2026-11-13 22:49:40 -08:00
shinyobjectz 26d094c341 TL7d: skills pin to raea-skills c98c9d6 (PR 67: reference/sdk.md lists raea/editor's animStyle) 2026-11-13 22:47:46 -08:00
shinyobjectz 773047de9e TL7d: the scenario (a clip's own In and Out, CapCut's Animation tab; Combo not built) and its status; the timeline's counts: 36 in Chrome, 33 of 35 in raea's window, the two left Chrome's alone 2026-11-13 22:47:15 -08:00
shinyobjectz 4a8ad49d60 TL7d: the manual's raea/editor page lists animStyle, Anim, EdgeStyle and a clip's enter and exit 2026-11-13 22:46:14 -08:00
shinyobjectz a393b366ac TL7d: a clip's own In and Out animations (CapCut's Animation tab): Clip.enter and Clip.exit (a kind and its frames), set and taken off by the set operation, never longer than the clip, each kept by its own half when split; in a composition the sequence's <Transition> edge. sdk/video edges.ts holds the kinds and their styles with no React (transitionAt, transitionStyle, edgesStyle), which <Transition> now draws from and sdk/timeline's animStyle previews a film's clip by; CODE_KINDS is its TRANSITION_KINDS. Four tests 2026-11-13 22:45:58 -08:00
shinyobjectz dc148cd3f7 TL7c: the manual's raea/editor page lists captionLines, heard, Said and LineRules (each Said field documented) 2026-11-13 22:36:31 -08:00
shinyobjectz 48c027313d TL7c: skills pin to raea-skills 4f55842 (PR 66: reference/sdk.md lists raea/timeline's captionLines and heard) 2026-11-13 22:35:16 -08:00
shinyobjectz b41c609a02 TL7c: captions made from what is said (CapCut's auto captions): sdk/timeline captions.ts heard() says a film's transcript where the edited cut plays it, captionLines() gathers the words into lines (a sentence's end, a 0.6 s pause, seven words or 42 characters), and the captions operation puts them as caption-style text clips on a Captions track of their own, one edit, undone whole; in a composition each line is a sequence of words (seqEdits). Five tests 2026-11-13 22:32:03 -08:00
shinyobjectz 90975148a0 TL1c, TL2f: the timeline's counts after the window runner's fixes: 34 in Chrome, 31 of 33 in raea's window (the two left Chrome's alone); its keys follow the pointer, since the window matches no :hover for a script 2026-11-13 22:22:34 -08:00
shinyobjectz e658ea89ea TL3j: the project's media added at the playhead, as CapCut's media panel adds it
sdk/timeline: an add carrying a project file (props.asset) maps to the host's new media edit, a sequence holding a <Video>, an <Img> or an <Audio> of it. On the main track with the magnet on, the clips after it move on first and the edit names the clip before it (or after it, at the start), so the host writes it beside that one and what is over the main track stays over it. The magnet now puts an added clip in at the cut nearest where it was put (before the clip it lands in when that is nearer its start), CapCut's insert at the playhead; a paste onto the main track, an add too, lands the same way, and a duplicate keeps its place after its clip. The scenario is filed as TL3j. 77 tests; each new one fails without its rule.
2026-11-13 21:24:59 -08:00
shinyobjectz 3fc0c43af0 TL4c: status (a clip's own sound taken out with Cmd+Shift+S: sdk/timeline's extract, landed in 173e39711; the host's edit and the film's playback in raea-feed PR #19), and the browser test counts: 28 in Chrome, 22 of 27 in a headless raea window 2026-11-13 21:02:37 -08:00
shinyobjectz 173e397113 TL4c: footage's own sound taken out onto a sound track (Cmd+Shift+S in CapCut). sdk/timeline gains the extract operation: a sound clip over the same span, from the same place in the file at the same speed, curve, direction, level and fades (props.of names the footage it came from), the footage marked muted with its level and fades moved to the sound; refused for sound, words, stills and footage already taken out. A clip's muted is read from a muted <Video> (SeqRow.muted), and seqEdits turns the operation into the host's extract edit (the <Video> muted, an <Audio> of its file in a new sequence from at for frames); a sequence holding footage is pointed at its <Video>. The frame cache's look says muted only when set, so kept ranges' keys are unchanged. Reference page regenerated (Clip.muted, SeqRow.muted). Tests: four for the operation and its inverse, one for the composition's edit and its reading back (75 pass) 2026-11-13 20:55:02 -08:00
shinyobjectz 17fa0e5f31 TL10e: status (built in raea-feed PR #19: drafts and a scene's ranges in the proxy store under its one limit, shown and cleared in Settings, a discarded version's frames gone at once) 2026-11-13 20:39:20 -08:00
shinyobjectz 8df1c72a44 TL5c, TL9c, TL10d: status (built in raea-feed PR #19)
A curve shaped by hand saved by name for the workspace (timeline/curves.json in its folder); an agent's editor_edit
made as raea/editor operations in the open timeline's history; play holding on Buffering where a scene's range isn't
kept yet while it is drawn (seen in a headless raea window), and a film saying Buffering when it runs out of data; a
scene's timeline as long as the scene. 25 browser tests in Chrome.
2026-11-13 20:24:03 -08:00
shinyobjectz e3f4c6980e skills pin: raea-skills #65 (the SDK reference follows export *) 2026-11-13 20:01:36 -08:00
shinyobjectz 7ed8faa7a6 TL11b: done (raea/editor, its reference page and example, the skills' SDK reference and the footage guide) 2026-11-13 20:01:21 -08:00
shinyobjectz 283b1ffb87 skills: the SDK reference follows export * (raea/editor, raea/audio, raea/3d and the rest were missing names)
tools/skills.sh gen_sdk listed each sdk/raea/src entry's own exports from Bun's transpiler scan, which gives nothing for
export * from "@raea/<package>". So raea/editor (all of it export *) had no row, raea/audio listed Audio, Tone and music
but not Mix, Speech, song and the rest, and raea/3d, raea/animation, raea/app, raea/math, raea/state, raea/text and
raea/ui were each short. The scan now follows export * through sdk/tsconfig.base.json's paths (and relative paths),
into what those modules re-export in turn, and fails naming the line when a re-export leads to no file.
2026-11-13 20:00:08 -08:00
shinyobjectz e060c09fe2 skills pin: raea-skills #64 (raea/editor in the footage guide) 2026-11-13 19:56:45 -08:00
shinyobjectz 9a93709831 TL11b: raea/editor taught in the footage guide (a composition recut as data: fromRender, applyAll, segmentsOf, and what segments can't say), its page's summary and intro written for a reader 2026-11-13 19:54:20 -08:00
shinyobjectz ca0a14e04c TL11b: mesh.md and sprite.md regenerated (a prop's row moves: raea/editor in the program changes the order the checker lists them in) 2026-11-13 19:53:11 -08:00
shinyobjectz 8fefa2922d TL11b: the timeline SDK as raea/editor, with its reference page. sdk/raea/src/editor.ts re-exports @raea/timeline (raea/timeline was already the Sequence module's), now in sdk/tsconfig.base.json so a bundle copies it; its import of the effect table is @raea/video/effects (a relative path across packages didn't survive a bundle). Every field of its types has a doc comment (85 had none), and docs/manual/examples/edits.tsx builds a timeline, splits it, keys a fade, speeds a half up with the magnet closing the gap, and undoes it all from the inverses 2026-11-13 19:51:33 -08:00
shinyobjectz 96f7e64580 PF4, TL13a notes: the draft scale pays where the GPU does the work (the light sample room's two-range redraw 9.4 s to 8.9 s, a ray-traced shot 1.7 times); the window's 400-clip drag can't be helped by drawing only what is in view, since all 400 are on screen at the timeline's opening fit 2026-11-13 19:42:45 -08:00
shinyobjectz d79c0b8cef timeline spec: 19 of the 21 window-runnable tests pass in a headless raea window, a plugin's snap grid among them 2026-11-13 19:36:59 -08:00
shinyobjectz 81cf2e0386 timeline spec: a snap to a plugin's grid is under a browser test (and each e2e run starts with no plugins installed); drafts and a scene's kept frames drawn at a draft scale 2026-11-13 19:34:01 -08:00
shinyobjectz eed69c7bb2 PF4: a draft drawn at a fraction of its size, laid out at its own. <Composition edit={{ scale }}> registers the smaller size and draws the composition in a box laid out at its width and height (useVideoConfig still says them), scaled down, so a 3D view, whole-frame or in a page element's box, traces fewer pixels and a 2D layout in px keeps every place. The same 61-frame ray-traced 1080p shot warm: 2.75 s at full size, 1.6 to 1.7 s at 0.5. The app's drafts and a scene's kept frames write it in their throwaway source; what ships is never scaled. Registry tests: the smaller size, the declared size inside, scale 1 unchanged, out of range refused 2026-11-13 19:27:08 -08:00
shinyobjectz 271376b898 timeline spec: a plugin's additions seen with a plugin installed, and the drafts' size and clear 2026-11-13 18:46:41 -08:00
shinyobjectz e31056b6ad TL11a, TL13: a plugin's tools and snap grids as data in the timeline SDK; the window's drag told apart (a hit test a step, now gone: 27 to 36 frames a second) and what is left 2026-11-13 18:38:29 -08:00
shinyobjectz 0b7a4203b8 TL13: the timeline measured in a headless raea window: a pick 45 to 59 ms, a split 59 to 64 ms, a drag 27 to 31 frames a second with 400 clips (56 with 48), and what that is and isn't 2026-11-13 18:29:44 -08:00
shinyobjectz 95725896a2 TL7c, TL11a: text styles as data in the timeline SDK (raea's four, a plugin's checked), carried by the writer; the spec's status with the 3D scene's frame store seen through an edit in a raea window 2026-11-13 18:21:37 -08:00
shinyobjectz b476ebb82b Specs: the timeline's tests in a headless raea window (16 of 19), and PF4's finding for drafts (a render can't draw a composition smaller than it says: a draft scale is the next lever) 2026-11-13 18:09:57 -08:00
shinyobjectz fd3a75ce72 skills pin: raea-skills #63 (Effect parts in the footage guide and reference/sdk.md) 2026-11-13 17:59:26 -08:00
shinyobjectz f14232a52e TL11a: a plugin's effects as data: <Effect parts> draws an effect from CSS filter functions (amount 0 to amount 1), the timeline's palette reads them from a plugin's manifest (timeline.effects) and its writer carries them to the composition 2026-11-13 17:58:39 -08:00
shinyobjectz 43cc233f99 TL13: the timeline's first measurements (400 clips on 12 tracks, in Chrome): a pick in 9 to 13 ms, a split in 24 to 27 ms, a drag at 63 to 65 frames a second 2026-11-13 17:51:54 -08:00
shinyobjectz 31f7961287 timeline spec: the status as it stands (copy and paste, an item's own timeline, a sequence's placement and a split under a speed curve are built) 2026-11-13 17:48:07 -08:00
shinyobjectz 1918b36f9e TL3h: a composition's sequence mirrored and cropped: <Nudge mirror crop>, and the timeline's writer for a sequence's still placement (its <Nudge>'s props as they now stand) 2026-11-13 17:43:53 -08:00
shinyobjectz 387f91017c TL8c: in progress: a recording made at the timeline is written as a sequence holding an <Audio> of its file (sdk/timeline's writer); the spec's status as it stands: effects, text, voice, mirror, rotate, crop and the 3D scene's frame store built in raea-feed 2026-11-13 17:40:33 -08:00
shinyobjectz d8b51396fa skills pin: raea-skills #62 (Effect in the footage guide and reference/sdk.md) 2026-11-13 17:30:09 -08:00
shinyobjectz 0a7c064b05 TL7b: in progress: an effect as a clip: <Effect kind amount in out> filters the picture under it for its sequence's frames (blur, mono, sepia, vivid, faded, contrast, bright, dark, invert, hue), one table for the engine and the timeline's preview; the timeline reads a sequence holding one as an effect clip and writes one added 2026-11-13 17:27:57 -08:00
shinyobjectz 3620aa1def TL7c: in progress: a composition's sequence of words is a text clip (renamed, its words change; words added are a new sequence), in the timeline's reader and writer 2026-11-13 17:24:02 -08:00
shinyobjectz b938833097 skills pin: raea-skills #61 (speedCurve in the footage guide and reference/sdk.md) 2026-11-13 17:08:31 -08:00
shinyobjectz 75c3b18c22 footage guide: speedCurve for a speed ramp, and speedLength for its Sequence 2026-11-13 17:07:13 -08:00
shinyobjectz 01076723f4 TL6b: a speed curve on a composition's footage: a <Video>'s or an <Audio>'s speedCurve ([place, speed] points over startFrom to endAt, speedLength the frames it takes), its sound carried through the changing rate as one voice (raea-sys-mix Ev::Rate), and the timeline's reader and writer for a sequence's curve 2026-11-13 17:03:07 -08:00
shinyobjectz bd670d9040 TL3h: in progress: a freeze frame and footage played backward (sdk/timeline)
freeze: a still of the frame under the playhead put into its clip there, the clip split around it and what follows
making room; set reverse: a clip's footage from its last source frame to its first. Playback's mapping gives a
still its one frame at rate 0 and reversed footage its frames going back, both stepped by the timeline's own
clock; a still is ready when its frame is. 63 tests.
2026-11-13 16:54:15 -08:00
shinyobjectz 5c7dac41c2 docs/manual/whats-new/0.1.3.md: raea 0.1.3's notes as the manual's What's new page (published 2026-11-14 00:15 UTC, promoted from v0.1.3-rc7 at f2d0e0335); raea.io serves it since the 0.1.3 site deploy 2026-11-13 16:40:47 -08:00
shinyobjectz f732061d9d TL11a: in progress: a plugin adds kinds of track (sdk/timeline registry.ts): its head's title and whether it stacks over the picture or under it with the sound; raea's five are listed the same way and can't be taken; 60 tests 2026-11-13 16:38:27 -08:00
shinyobjectz d7e3d8b2b2 TL7c: in progress: a film's captions are clips on a text track over its scenes (sdk/timeline fromRender): each line its words and its span, one line at a time, moved and removed with the scene it sits on; 60 tests 2026-11-13 16:36:10 -08:00
shinyobjectz c4d3900d68 TL0d: in progress: a timeline an item declares is read and checked (sdk/timeline readTimeline): tracks of clips over an item's own data, made whole (whole frames, a kind for each track), with why for what isn't well formed; 59 tests 2026-11-13 16:27:10 -08:00
shinyobjectz f130f35870 TL0: in progress: docs/timeline.feature's status after the day: what is built, what is a code edit, what plays live, what is only decided, what isn't built 2026-11-13 16:25:02 -08:00
shinyobjectz 2b7574de39 TL0c, TL8a: in progress: a composition's <Video> and <Audio> are clips of their own (sdk/timeline read.ts)
A row for a <Video> or an <Audio> is a clip on a footage or a sound track under the sequences, where its sequence
plays it, with its place in its file and its level; its level set on the timeline is a host edit of its own, and
a move, a trim or a speed there is refused with why (they are its sequence's). 57 tests.
2026-11-13 16:22:39 -08:00
shinyobjectz bbd658263e PF6, PF8: the 0.1.4 spec with a scene's frame rate while orbiting (57 to 58 a second on the sample room), the Source view's first visit as it really is (0.59 s, 0.29 s with raea-feed #17; the 2.4 to 3.8 s before was the measuring script), the host's project lookup (raea-feed #16) and library posters (raea-feed #15) 2026-11-13 16:18:33 -08:00
shinyobjectz 91731fab14 TL7a: in progress: Transition classed in the taxonomy as raea's own (the video timeline) 2026-11-13 16:10:14 -08:00
shinyobjectz f36ffb903f TL7a: in progress: skills pinned at raea-skills #60 (reference/sdk.md has Transition) 2026-11-13 16:09:03 -08:00
shinyobjectz 0173108f72 TL7a: in progress: <Transition> brings a part in and takes it out, and a transition on a cut is that code
sdk/video transition.tsx (exported from raea): <Transition in={{ kind, frames }} out={{ kind, frames }}> around
what a <Sequence> holds plays over the part's own first and last frames: fade (through black), slide, wipe, zoom.
Nothing outside the two parts changes and the film keeps its length; two parts that only touch have no frames of
each other to mix, so there is no dissolve. sdk/timeline: raea's transitions are those four; a sequence's row
carries how it comes in and goes out, a cut whose two parts match reads back as one transition, and a transition
put on a cut, changed or taken off is two host edits (the part before's out, the part after's in); a kind the
component doesn't draw is refused with why. Tests: conformance/transition.test.tsx (3), sdk/timeline 56. The SDK
reference has <Transition>.
2026-11-13 16:05:51 -08:00
shinyobjectz bb4402e45a Fingerprint's frozen encoders are named the Edit Embedding Zoo (Shane, 11-13: the standard name in the docs, the app and what we publish): SigLIP 2, CLAP, YAMNet, EmbeddingGemma 2 and Depth Anything 3, pinned, on-device and the same for every fingerprint; a fingerprint is what a person trains over it. docs/fingerprint.md says so under What a fingerprint is, and the manual's Fingerprint page names it, with Depth Anything 3 added to its list 2026-11-13 15:42:55 -08:00
shinyobjectz 661adee396 TL3g: in progress: compound clips in sdk/timeline: the picked clips made one clip that holds them (each with the kind of track it came from), moved and trimmed as one, and put back where the compound is; 55 tests 2026-11-13 15:34:24 -08:00
shinyobjectz 73c5c93e9b TL6a: in progress: a speed on a sequence is the host's edit to the footage it holds (sdk/timeline read.ts: a row's speed, the speed edit; another field is refused with why); 53 tests 2026-11-13 15:30:25 -08:00
shinyobjectz 2427d7c9ee TL0: in progress: docs/timeline.feature says what is built, decided and not built after the first day 2026-11-13 15:25:54 -08:00
shinyobjectz e3b048e2d9 TL4c: in progress: a film's scene is its picture and its sound together (fromRender has no separate sound clip), so a cut, a move or a speed takes both, as the player plays them from the one file; 53 tests 2026-11-13 15:23:04 -08:00
shinyobjectz 08f6f621d2 TL10a: in progress: an edited film plays from its own frames (sdk/timeline play.ts)
showing: the main-track clip over a timeline frame, the source frame it shows and the rate (a speed, a curve);
frameOf: the way back from the player's time; next: where the player goes when a clip ends; ready: the timeline
ranges ready to play given the file's buffered ranges. 53 tests. The app's player uses these to play cuts,
moves, trims and speeds at once, with no render.
2026-11-13 15:20:49 -08:00
shinyobjectz 7caf1bb596 TL14b: in progress: a sound's tracks as a timeline, and its clip edits (sdk/timeline read.ts)
fromTracks: the tracks a sound's host lists (clips, notes, lines) as sound tracks; a file clip keeps its place in
its file and its level, notes and lines are shown locked with where they are edited. clipEdits: the file clips
that differ between the timeline as read and as it stands, each span before and after in seconds and dB, as the
sound's hand edit carries them. 49 tests.
2026-11-13 15:17:16 -08:00
shinyobjectz 43bfbad61f TL11a: in progress: what the timeline offers by name, and what a plugin adds (sdk/timeline registry.ts)
raea's transitions (dissolve, fade, wipe, slide) beside its easings and speed curves; readAdds checks a plugin's
additions as its manifest writes them (eases, curves, transitions) and leaves out what isn't well formed or takes
one of raea's names, with why; palette gives everything offered, raea's first. 47 tests.
2026-11-13 15:13:22 -08:00
shinyobjectz beb4ce1200 TL5d: in progress: the SDK reference page with <Nudge>'s keys prop 2026-11-13 15:09:06 -08:00
shinyobjectz 7bfa7f392c TL5d: in progress: <Nudge keys> plays a placed part's properties over time, and a key on a sequence is that edit
sdk/video nudge.tsx: keys={{ scale: [[0, 1], [45, 1.15, [0.2, 0, 0, 1]]] }} on <Nudge>: each property's keys as
[frame, value, ease?], in frames from where the part's time starts (its <Sequence>), eased linear, hold or by a
cubic bezier (sdk/math's); a keyed property wins over its still value; with no keys it is the Nudge it was.
sdk/timeline read.ts: a sequence's row carries its keys, and a key made, moved, eased or removed on it is one
host edit that writes the wrapper's keys whole (x, y, scale, rotate, opacity; another property is refused).
Tests: sdk/raea conformance/nudge-keys.test.tsx (4), sdk/timeline 45.
2026-11-13 15:07:42 -08:00
shinyobjectz 47cf338cd6 TL10: in progress: what the frame store decides, in sdk/timeline cache.ts
changed(before, after): the frames whose picture or sound differ between two states, by what is drawn over each
frame (a clip moved gives its old span and its new one; a split of footage gives none; a name, a lock or a marker
gives none). keyOf: what a kept range is kept under, the same for two states that draw it the same, so an undo
finds its frames again. evict: a closed version's frames first, then the least recently played, never what is
under the playhead while anything else can go. ahead: what to draw next, from the playhead on. 44 tests. The
stage that draws and the store that holds frames aren't built.
2026-11-13 14:52:34 -08:00
shinyobjectz b2a52f6cc1 TL6b: in progress: a clip under a speed curve keeps how many source frames it shows, so the curve taken off gives its exact length back (every preset, tested); a trimmed or split curve clip keeps its share 2026-11-13 14:47:44 -08:00
shinyobjectz c78ded29e8 TL4a: in progress: a dragged main-track clip swaps by the edge it leads with (past its neighbour's middle), as CapCut's does; 37 tests 2026-11-13 14:36:12 -08:00
shinyobjectz 1c3cb953bd TL0c: in progress: a timeline read from a composition's sequences or a film's scenes (sdk/timeline read.ts); seqEdits maps move, trim, split and remove to the host's sequence edits; a move past the film's first frame stops there; 37 tests 2026-11-13 14:29:37 -08:00
shinyobjectz 53a5cc9ca7 TL0: in progress: sdk/timeline, the timeline's model and every edit as an operation
The package (TypeScript, no React, no DOM): tracks, clips, keys, markers and transitions in whole frames (model.ts);
each edit as a pure operation, refused with its reason or answered with its inverse (ops.ts: move, trim, split,
remove and ripple, delete left and right, duplicate, add, speed and curves, keys and their easing, markers, track
heads, transitions, the magnet, snapping and linkage switches); a keyed property's value at a frame through a cubic
bezier (keys.ts); speed curves with CapCut's presets, their length and source time in closed form (speed.ts); what
an edge snaps to (snap.ts). After each operation the timeline is settled: the main track closed while its magnet is
on, what sits over a main clip carried with it while linkage is on, transitions kept only on cuts that still exist.

34 tests (bun test test) for TL0a, TL0b, TL3c to TL3f, TL4a to TL4c, TL5a, TL5c, TL6a and TL6b's model. Not yet:
reading a timeline from a composition (read.ts) and an operation as code edits (edits.ts), groups and compound
clips, and the app's strip drawing this model.
2026-11-13 14:29:37 -08:00
shinyobjectz 3b670e79a5 TL0: the timeline SDK for 0.1.5 filed as scenarios (CapCut's timeline on the composition, edits sent to the agent, keys and curves, the frame store, TL0 to TL14) 2026-11-13 14:29:37 -08:00
shinyobjectz 530ff8e3de A ray-traced mesh gets MikkTSpace tangents only when its material has a normal map
Solari traces a mesh in one layout, tangents included, so every traced mesh without its own had MikkTSpace's made for
it, in one system on one thread. Solari's shader reads a tangent for one thing, a normal map (vendor/bevy_solari
scene/bindings.wesl). A mesh whose material has none now gets a unit vector across each normal, which costs nothing.

A sample of a ray-traced render of a 2.5 s shot (Sticky Feet s04-stoop, 61 frames) had MikkTSpace as 182 of the 402
samples the first frame waited for its models. Before: the models' wait 744 ms, frame 0's sync 1093 ms. After, six
runs: the wait 529 to 632 ms, frame 0's sync 656 to 802 ms. Its steady frames are unchanged (23 ms).
2026-11-13 14:29:33 -08:00
shane f2d0e0335c Merge pull request #150 from shinyobjectz/win-vulkan-loader
Release: install the Vulkan loader on a Windows runner without one
2026-11-13 17:27:53 -05:00
shinyobjectz b4fa9ae676 Release: the Windows render check installs the Vulkan loader when the runner has none
Namespace's Windows image has no vulkan-1.dll, so rc6's check found no adapter ("vulkan drivers/libraries could not
be loaded") although lavapipe was registered. lavapipe.sh now fetches LunarG's runtime components 1.4.328.1
(checksum pinned), copies the loader into System32 when it's missing, and fails at once unless vulkaninfo lists
lavapipe.
2026-11-13 14:19:45 -08:00
shane 5aa6c4cd36 Merge pull request #149 from shinyobjectz/win-nasm-check
Release: the Windows nasm step checks its version without /dev/stderr
2026-11-13 16:19:32 -05:00
shinyobjectz ad8187aefd Release: the Windows nasm step checks its version without /dev/stderr
rc5's Windows job stopped in the nasm step: Git Bash on the runner has no /dev/stderr, so the tee that printed
nasm -v failed. The output is now captured, printed, and matched against the pinned version.
2026-11-13 13:12:11 -08:00
shinyobjectz 1bfd0388b0 docs/lightspeed.feature: 0.1.4's rule with what landed and what was measured since (PF1-PF8) 2026-11-13 13:09:18 -08:00
shane cbd7649e02 Merge pull request #148 from shinyobjectz/win-nasm-pin
Release: Windows takes NASM 2.16.03, never Chocolatey's newest
2026-11-13 15:31:42 -05:00
shinyobjectz fc83cf7446 Release: Windows always takes NASM 2.16.03 from its own zip, never Chocolatey's newest
rc4 on Namespace's Windows image installed Chocolatey's NASM, and raea.exe failed to link: 135 of openh264's
SIMD routines (WelsSampleSad16x8_sse2 and the rest) unresolved, though openh264's C++ was built to call them.
GitHub's image, where rc3 linked, ships NASM 2.16. The step now always unpacks the 2.16.03 zip, puts it first
on PATH and fails if nasm -v names another version.
2026-11-13 12:24:03 -08:00
shane 2bbf0179fc Merge pull request #143 from shinyobjectz/render-quality-guide
Guides: which render quality to ask for (review versions take none)
2026-11-13 14:58:33 -05:00
shinyobjectz dcd1107a9f skills: pin raea-skills at 16ed215 (#59, render quality guidance) 2026-11-13 11:47:39 -08:00
shinyobjectz bf07a473ae Guides: a version made for notes takes no --quality flag, a film delivers at high, master is for delivered motion graphics and type 2026-11-13 11:46:08 -08:00
shinyobjectz f9b6f22ecf media: a quarter second of frames waits ahead; a video drawn small sends only the halving it is drawn from 2026-11-13 11:43:31 -08:00
shinyobjectz fcd6e12c03 media: the halvings' loop reads its last level without a closure (dupes) 2026-11-13 11:43:31 -08:00
shinyobjectz d7a755c08b Video plays smoothly at 4K and at 60 fps: frames decoded ahead and shown when due, a faster BGRA conversion, halvings from the decoder's thread, no relayout for a same-size frame 2026-11-13 11:43:31 -08:00
shinyobjectz b776edd026 RAEA_MODELS_TRACE=1: a wait for a scene's models says how many updates it ran and for which models 2026-11-13 11:42:00 -08:00
shinyobjectz 9a289e072c bundle: the copies' lookup is one closure, shorter notes (dupes, size) 2026-11-13 11:42:00 -08:00
shinyobjectz 4bc503d81d A render starts in a fraction of the time in a real project: the export cache and the bundler no longer read or stat every file under the edit's folder 2026-11-13 11:42:00 -08:00
shinyobjectz 4e252226a6 A deferred camera's MSAA is left off: msaa_for_3d turned it on again each frame, Bevy turned it off and warned, once a frame in every ray-traced render's log 2026-11-13 11:40:56 -08:00
shinyobjectz ca184a08c9 docs/lightspeed.feature: 0.1.4, the performance release (PF1-PF8): each area's measured baseline, what is fixed, what is open 2026-11-13 11:30:27 -08:00
shane cceec65c38 Merge pull request #146 from shinyobjectz/win-nasm
release.yml: nasm on Windows runners that lack it
2026-11-13 14:27:18 -05:00
shinyobjectz fac78b331b release.yml: the Windows job installs nasm when the image lacks it (Chocolatey, else NASM's zip). rav1d's build script runs nasm; GitHub's Windows image has it and Namespace's doesn't, so rc3's dry run on Namespace stopped there after 3 minutes. An inventory of Namespace's windows-2022 image found nasm the only missing tool the build uses 2026-11-13 11:19:32 -08:00
shane ae49b9f3c9 Merge pull request #142 from shinyobjectz/runner-cache-guard
release.yml: cache volume steps only on Namespace runners
2026-11-13 14:07:58 -05:00
shinyobjectz edf25e43c0 release.yml: the cache volume's steps follow the runner (a Namespace runner, nsc-*), not a repo variable: the Namespace plan has no Windows runners (not allowed to create windows/amd64 instances), so Windows builds on GitHub's runner with the R2 compile cache while the Mac and Linux keep their build folders on Namespace's volumes 2026-11-13 10:56:45 -08:00
shane 4a563b9cf6 Merge pull request #139 from shinyobjectz/cache-inline
release.yml: the cache script from the workflow's commit, and faster runners by repo variable
2026-11-13 13:55:50 -05:00
shane ea5e9015e7 Merge pull request #141 from shinyobjectz/play-tsconfig
raea play works in a folder with its own tsconfig.json
2026-11-13 13:55:45 -05:00
shane d8c392b69a Merge pull request #140 from shinyobjectz/yamnet-fetch
Fingerprint's YAMNet is fetched once on every machine (for 0.1.3)
2026-11-13 13:48:14 -05:00
shinyobjectz 035783ae0c raea play works in a folder with its own tsconfig.json: the work copy leaves it out (it shadowed the live runtime's paths; play, the stage and played stills threw __at is not a function) 2026-11-13 10:46:25 -08:00
shinyobjectz 08a3904127 release.yml: Namespace runners for the release build, by repo variable: RELEASE_*_RUNNER hold runs-on label lists (a machine and a cache volume), RELEASE_RUNNER_CACHE=1 keeps the build folder and cargo's downloads on the volume between runs (nscloud-cache-action, after the tag's checkout), so a candidate rebuilds what changed and links. The cleanup that deletes target/ is skipped there (a bind mount on Linux), and the Mac's Xcode pruning runs only on GitHub's runner. sccache on R2 stays for the workspace's own crates, which a fresh checkout's file times mark as changed 2026-11-13 10:43:48 -08:00
shinyobjectz cae6d2201c release.yml: the build jobs run on a faster runner when the repo names one (vars RELEASE_MAC_RUNNER, RELEASE_LINUX_RUNNER, RELEASE_WINDOWS_RUNNER; a third party's), else GitHub's own as before. GitHub's macOS runner is a 3-core M1 with 7 GB: a cold release build took 183 minutes there, Linux 105 and Windows 142 (0.1.2-rc5) 2026-11-13 10:37:07 -08:00
shinyobjectz b8d38aa2c0 Fingerprint's YAMNet is fetched once where perception's copy isn't (systems/columns models.rs), from the public repo's models-1 release (Google's model, Apache-2.0, as ONNX; perception's copy, sha256 8e4e21d5) and checked against that sha256, so every machine has the same encoders. Before, only machines with perception's copy had YAMNet: a fingerprint trained on one (Shane's) refused a fresh install's columns ('trained on other encoders'), so a fingerprint kept with a project didn't judge on a teammate's machine. A fingerprint trained without YAMNet takes it as an encoder added since. raea-sys-ml models.rs gains ensure_url, a file from a URL of its own 2026-11-13 10:29:16 -08:00
shinyobjectz d685762382 release.yml: the compile cache's script comes from the workflow's own commit (a sparse checkout into .workflow), not the tag's tree: a dispatched dry run that fills the cache builds an older tag (v0.1.3-rc3), whose tree has no tools/release/compile-cache.sh, so its Linux and Windows jobs stopped at 'Use the compile cache' with exit 127 2026-11-13 10:25:44 -08:00
shane c96de52402 Merge pull request #138 from shinyobjectz/release-cache
release.yml: a compile cache for release builds (sccache on R2)
2026-11-13 13:17:01 -05:00
shinyobjectz b4e6f54d55 release.yml: a compile cache for release builds, sccache on an R2 bucket (raea-build-cache), so a candidate after a small change compiles only what changed instead of three cold hours. GitHub's own cache can't carry it: a tag's run reads only its own tag's caches and the default branch's, so rc3's would never reach rc4, and the repo's 10 GB are CI's. tools/release/compile-cache.sh turns it on when the job has the bucket's key (secrets RELEASE_CACHE_ENDPOINT, RELEASE_CACHE_KEY_ID, RELEASE_CACHE_SECRET), each OS and architecture under its own prefix, C and C++ in build scripts through cc-rs and CMake's launchers; when the bucket can't be reached or written the build runs uncached, as before. Each cargo call's minutes are a notice on the run, and sccache's hits and misses are printed after the build. Linking (thin LTO) and build scripts' runs aren't cached 2026-11-13 10:07:28 -08:00
shane d145985058 Merge pull request #136 from shinyobjectz/feed-tasks-spec
docs/feed-tasks.feature: the feed-tasks spec (FT1-FT3)
2026-11-13 12:47:29 -05:00
shinyobjectz 03685d6139 docs/feed-tasks.feature: the feed-tasks lane's spec (FT1-FT3), for 0.1.3. FT1, the graph view never taking a press outside its own box in the window, is in rc3 (engine 37846080a) and raea-feed #11. FT2, the agents button as a checkbox that opens an editable to-do list built on the brief's tasks and sent edits, and FT3, a session started outside the app as a bubble in its project's feed while it is open, are raea-feed #12. Each rule's status says what was built, the decisions taken, what was checked and how, and what is left 2026-11-13 09:38:34 -08:00
shinyobjectz 620c796095 docs/scene-feed.feature SF8e: done. raea-feed #10 merged with raea-skills #58 (collaborate.md's row, reference/feed.md regenerated) and raea pins it (#133); the strict skills check passes against raea-feed main. The scene feed ships in 0.1.3 2026-11-13 12:14:09 -05:00
shinyobjectz 37846080a7 A box that clips its overflow takes no pointer for what it cuts away, in both of the window's hit tests. A card zoomed past the edge of a canvas (React Flow at scale 2) was drawn clipped but took the presses on the sidebar and the header around the canvas. blitz-dom's hit_inner tested children wherever they overflowed to: it now skips a clipping box's children when the point is outside its padding box, and a hoisted (z-index) child is under its stacking-context root's clip and the clips of the boxes between along its containing blocks, the ones blitz-paint's hoisted_clips draws it under; a box painted from above (#39) is under none. sdk/ui's hit dropped the inherited clip at a child with its own z-index and replaced it at a child that clips: both now cut the child's clip to the one it is under; a fixed box is exempt. Proved by the app's e2e/canvas-layer.spec.ts in a headless window (fails with either half alone) and a unit test in sdk/ui/test/dom.test.tsx that fails on the old hit 2026-11-13 09:03:49 -08:00
shinyobjectz e24034ee10 docs/manual/reference/sdk: raea.md and time.md regenerated for #126 (a Sequence's length in useVideoConfig); main's L1 failed on them for every lane 2026-11-13 09:03:44 -08:00
shinyobjectz 9f4990cd90 stage: the hold and wireframe are a crate of their own (raea-sys-hold); the stage's new calls share one send 2026-11-13 09:03:44 -08:00
shinyobjectz 7026280df3 docs/scene-feed.feature: the open items built and checked (SF2e the view's toolbar, SF3e wireframe, SF4c the part follows the drag, SF4d a part inside a group, the timeline's film); only the skills teaching is open 2026-11-13 09:03:44 -08:00
shinyobjectz df9d1d11d5 media: a playing video's frames leave its decoder when they fall due; RAEA_MEDIA_STATS says how play goes (measured: raea-feed d55df57) 2026-11-13 09:03:44 -08:00
shinyobjectz e60a8bc5fe stage: hold a part, say where it stands, wireframe (docs/scene-feed.feature SF4c, SF4d, SF3e) 2026-11-13 09:03:44 -08:00
shinyobjectz 1496780fa4 docs/scene-feed.feature: the scene feed item's spec (SF1-SF10), for 0.1.4: raea 3D looked at from inside in the feed, as one scene or a board of them; looking around with the watch view's timeline, comments pinned in the scene's space, parts moved, drawn and re-keyed in the scene's own code, a procedural part's props, quality that steps down under memory pressure, and what is open (SF8). Built on raea-feed branch scene (549b321); each rule's status says what was checked and how 2026-11-13 09:03:44 -08:00
shinyobjectz 2cb2136348 raea pins raea-skills main faa9938 (#58): feed_post's scene item (raea 3D looked at from inside in the feed) in collaborate.md and reference/feed.md, with the app at raea-feed 24b2eb5 (#10). SKILLS_STRICT=1 tools/skills.sh check passes against that app 2026-11-13 11:52:05 -05:00
shinyobjectz e368a5dbcb Inside a Sequence, useVideoConfig().durationInFrames is the Sequence's length (#126): a subtree's LocalTime carries its length, the composition's at the root, a Sequence's own cut where its parent's ends (unbounded, what's left of its parent's), a Loop's one pass, and a Freeze keeps its parent's; useVideoConfig reports it as it reports a Sequence's width and height, and a Sequence's time is still the same object frame to frame. Written from the spec line and its conformance test (#128): conformance 615 pass, the same five failing as on main 2026-11-13 11:33:49 -05:00
Ragulsundaram e3dfcb96d1 Spec: inside a Sequence, useVideoConfig().durationInFrames is the Sequence's length (its own, cut short where its parent's ends; a Loop's children get one pass), as Remotion's public docs for useVideoConfig say, and its conformance test (#126, from #128) 2026-11-13 11:33:49 -05:00
shinyobjectz f845ef0add raea pins raea-skills main d71042f (#57): the fingerprint page says what each axis reads (pictures, sound, motion, text, each on its own encoder) and that no shipped axis judges recorded against generated sound. SKILLS_STRICT=1 tools/skills.sh check passes 2026-11-13 10:56:43 -05:00
shinyobjectz cb01f542c0 Fingerprint gets its own section of the docs (docs/manual/fingerprint): what it is and the Fingerprint page, training one (renders, notes, marks, a box on the part of a sound you mean, the post-mortem), checking a cut (score, --was, scripts and stills, things, profiles), and projects and teams, with the judged-by chip's Keep with this project and Keep with the workspace (FP14e) written up for the first time. The guide it replaces (guides/fingerprint.md) is split into those pages; the manual's index lists them. raea pins raea-skills main f40ca31 (#56): the skill gains fingerprint.md, how an agent uses the person's fingerprint, routed from SKILL.md. SKILLS_STRICT=1 tools/skills.sh check passes 2026-11-13 10:56:43 -05:00
shinyobjectz 054738329d Skills for 0.1.3: raea pins raea-skills main e58e2a2 (#55, Solari's traced-sun limits as of raea 0.1.2; Solari is unchanged since 0.1.1), and sdk/guides/craft/bevy/solari.md, the source the skill's 3d/solari.md is copied from, says the same, so tools/skills.sh check's copy test passes. With the 0.1.3 app (raea-feed afb8074) as RAEA_APP, SKILLS_STRICT=1 tools/skills.sh check passes: the feed and files references need no change 2026-11-13 10:18:37 -05:00
shinyobjectz e85de83289 FP11c: a note's Reading, the readings' agreement and a label's span move to raea-sys-fingerprint-use (reading.rs), keeping raea-app-fingerprint under its 2,000 lines; sound_band finds its box without a copied closure 2026-11-13 06:13:08 -08:00
shinyobjectz 06090e06cd FP11c: done. A box drawn on the sound's spectrogram is a note's mark: learn-notes labels its span and keeps its pitch band in the evidence row
raea-feed #9 draws the spectrogram on the timeline and in Listen, and stores a box as a time pin over its span with a
mark on: "sound" ([time, mel] in 0-1). Here: grow::marked skips sound boxes (they are no place in the frame),
grow::sound_band reads the band, Reading and evidence::Row gain band, and learn-notes keeps a defect's band in its row,
widening a span shorter than half a second about its middle. The manual's fingerprint guide says how to draw one and
that the sound heads, per window, keep the band but don't learn from it yet.
2026-11-13 06:09:01 -08:00
shinyobjectz 7729997d96 FP14e: done. A project's judged-by is a menu that keeps one of the person's fingerprints with the project or its workspace (raea-feed #8: share, use and a commit of the folder) 2026-11-13 05:52:49 -08:00
shinyobjectz 8818eaa2ec Install guide: how the desktop app updates, checking by hand (Settings, General), and the Mac's Downloads pitfall: opened from Downloads, raea 0.1.1 and 0.1.2 run from a read-only copy and can't replace themselves, so install it into Applications once 2026-11-13 05:41:45 -08:00
shinyobjectz b715d70366 fingerprint.feature FP7a: archiving runs the postmortem in the 0.1.2 app (raea-feed #5 is merged) 2026-11-13 05:14:02 -08:00
shinyobjectz 2c6132a460 docs/manual/whats-new/0.1.2.md: raea 0.1.2's notes as the manual's What's new page (published 2026-11-13, promoted from v0.1.2-rc5 at 1be8199c8) 2026-11-13 02:26:31 -08:00
shinyobjectz 1be8199c85 FP1b, FP14d, FP10a: tagged done. FP14d's every clause is built (teach, approve, pair, read and learn-notes label the one that judges; move takes rows up). FP1b's scripts, briefs and pages are EmbeddingGemma 2 rows and its stills and sounds go through the encoders picture and sound axes already read, as its status says; FP10a's one stuck axis (glow) holds out 0.90 on another on-device encoder, so no adapter or trainer was needed 2026-11-12 23:11:04 -08:00
shinyobjectz 3599e18b6f FP13a: a render's camera path is its own and a thing's vector is its patch tokens. things.rs moved(): from the AOV pass's motion vectors (NAME.aov/motion), the median move of every pixel as the pan and the median move out from the middle after the pan as the zoom, eight times a second, with no model run; footage keeps raea-perceive flow. On the lurch red-team render it reads -0.063 then -0.190 frames a second (the scene trucks 0.02 then 0.06 a frame), where flow read -0.015 then -0.066, and 0 on the two renders whose camera holds still. pooled(): a thing's one vector is its frame's SigLIP 2 patch tokens averaged over the cells its mask covers half of or more, in place of the box pooled; fingerprint-things no longer needs image. Not yet: footage's camera path from Depth Anything 3 (the port gives depth only). 2026-11-12 23:11:04 -08:00
shinyobjectz 923163e7b9 FP5a: a reading keeps the layers under its pin. On a render with a layer pass, pinned() reads the layer-pass names under the pin's x,y at its moment (located.rs layers, now public) into the reading, and the reader's prompt says "pinned on NAME". On the things red-team render a pin on a block reads Box and one on the empty sky none (ignored test layers_under_a_pin). FP5a is tagged done with its status: read, readings, learn-notes 2026-11-12 22:34:25 -08:00
shinyobjectz 691673f616 FP11b: a mark on a defect note is followed through its whole shot. grow.rs through: the shot around the note from raea-perceive cuts (at most 8 s either side), EdgeTAM forward and back at 4 frames a second, and one region for each 2 s window where it kept the thing on half its frames or more, the box around it there; the note's own window always, at the mark. learn-notes makes one row a kept window (one row over the label's span without raea-perceive). cuts() moves from things.rs to grow.rs for both. On the things red-team renders a mark on a still block kept both windows at its layer-pass box (overlap 0.97) and one on a moving block followed it across the frame (0.41) 2026-11-12 22:29:45 -08:00
shinyobjectz edd00ee9ca CI installs cargo-shear 1.14.0 and cargo-dupes 0.2.1, the versions L0 runs, not whatever is newest: cargo-shear 1.14.1 (out 11-13) calls engine/cli's ignores for its feature-only dependencies on raea-runtime-bake and raea-runtime-sound redundant, which 1.14.0 needs, so main's gates went red from 43cfe8712 on 2026-11-12 22:25:18 -08:00
shinyobjectz 23f5a5ce53 Skills: raea-skills 7c835cc (release-012) for 0.1.2: fingerprint-where 9cad448 (score names where in the frame and the layers there; cli.md from raea's help after FP12a) merged with raea-skills main (#52, #53: the plugin's directory edition), the directory edition rebuilt from the skill, and reference/files.md from the app 0.1.2 ships (~/.raea/fingerprints, the storage files). skillcheck --strict and tools/skills.sh check with SKILLS_STRICT=1 pass 2026-11-12 22:19:06 -08:00
shinyobjectz a5a81f22b8 The manual's raea fingerprint page from raea's help after FP12a: bootstrap also trains patch heads that say where in the frame a picture defect is, and score's first moments say where and the layers there 2026-11-12 22:15:11 -08:00
shinyobjectz e05cee0c73 Windows app launch (#124): bytes become a string a 32 KB slice at a time, not String.fromCharCode(...bytes), which passed every byte as an argument and overflowed the stack on a blob of a few hundred KB (FileReader's readAsDataURL and readAsBinaryString, fetch's request body, a WebSocket's binary send, and the node shim's Buffer toString latin1); @raea/ui's platform has one latin1() for all of them, with a test of a 4 MB buffer. A frame's root-absolute script (/artifact.js) is found under the page's roots on Windows too: against a page at file:///C:/... it is C:\artifact.js, which only a leading / was taken for 2026-11-12 22:11:45 -08:00
shinyobjectz 50a695f0fb FP3b, FP5b, FP5c, FP12b, FP13b: decided for 0.1.2. FP3b closes on its first clause and its second moves to FP5c; FP5b's gate stays (no readings are checked yet, so notes train nothing); FP5c isn't measured on unchecked readings; FP12b and FP13b wait on Shane's own marks, so no grounder ships 2026-11-12 22:08:25 -08:00
shinyobjectz c65baf2c81 FP12a: patch heads say where in the frame a picture defect is. raea fingerprint bootstrap also puts FP0f's local defects in a random box of up to 6 frames a source (a blurred patch, a black hole, heavy grain, flat grey, a local glow; one that changes its box by under 6 levels is left out) and fits a logistic on SigLIP 2's 196 patch tokens per axis. Held out by source from 8 frames on 27 real renders: barren 0.92, glitch 0.90, blur 0.88 (0.79 before the visible rule), glow 0.49; an axis says where only at 0.85. score gives a flagged moment its place and the layers under it, by name (raea-sys-layers reads names); --json has at, the sheet boxes it in amber 2026-11-12 22:08:25 -08:00
shinyobjectz d679fa1cc4 LR10, LR11: done. LR0 lists the gap left after LR1-LR10 (23 of 33 pass; the 10 still off are LR10's list, each with its cause); #54 is closed with the harness's before and after and the cost per read, and #13 is answered with what now matches Chrome; the skills' motion router (raea-skills #50) merges into raea-skills main when 0.1.2 is published 2026-11-12 22:06:32 -08:00
shinyobjectz bf74492d50 docs/sdk-coverage.md retaken from main: 1557 of 1671 things reached (1548 before), the 3D camera's Hdr and feathers' theme components now typed in sdk/render, and seven more CSS longhands Blitz draws; the floor rises to 1557 2026-11-12 22:02:44 -08:00
shinyobjectz 43cfe87121 The SDK reference names the manual's examples where they use a component (hello, title, turntable), regenerated from main and these pages; the names check leaves a release's published notes as they were (docs/manual/whats-new: 0.1.0's canaries name the motion package by its name then) 2026-11-12 21:54:52 -08:00
shinyobjectz a2477cd71e Install page: raea skills install's hooks and Blender MCP server for every agent (and --no-hooks, --no-mcp), the Claude plugin from raea-skills with RAEA_NO_SKILLS=1 beside it, and the ALSA and fontconfig libraries Linux needs 2026-11-12 21:54:09 -08:00
shinyobjectz 33896c4518 The manual's install page says which GPUs raea draws on, and what runs without one (#110): a Windows PC with no DirectX 12 or Vulkan GPU (3rd-generation Intel graphics, for one) can't open the app's window or draw 3D; 2D video still renders on the CPU 2026-11-12 21:54:09 -08:00
shinyobjectz c7d7b59dfb The manual's install page for v0.1.1: pinning shows 0.1.1, and it says the desktop app comes from raea.io for the Mac, Windows and Linux and tells you when a new version is out 2026-11-12 21:54:09 -08:00
shinyobjectz 33380411d8 The manual's pages that raea.io/docs has served since 11-08 but no repository held until now (start/, concepts/, guides/3d|apps|words, examples/, whats-new/, index.md, and docs/manual.feature): written 11-08 by a session that has since ended and deployed from a working tree, they were parked on a branch so they couldn't be lost, and land for 0.1.2 so main's manual and the site are the same pages (16 links on main went to pages only the site had). It also holds the What's new pages for 0.1.0 and 0.1.1, made from their release notes by the release folder's whats-new.sh 2026-11-12 21:54:09 -08:00
shinyobjectz b537bcfffd The tour says how to consolidate the Inbox or a feed into a summary on its timeline, and that a working agent has a stop button beside it in the Agents list, the Feed's chat and the Inbox (raea-feed PR #1: c43ff66, 8fe9953) 2026-11-12 21:48:09 -08:00
shinyobjectz af293fcc35 Agents docs: each AI's own settings (agents.feature A7). Settings → Agents lists the AIs signed in on this Mac, each with what its ACP session reports it can be set to (thinking, mode, its own switches such as Claude's fast mode) plus environment and extra arguments; an agent on that AI shows the same settings, each defaulting to the AI's; they layer AI default, the Mac's defaults, the agent's, then the chat's model, and one that no longer applies becomes a notice 2026-11-12 21:48:09 -08:00
shinyobjectz e81d06dd8b Agents docs: no Director. The workspace has one primary, the harness at its root that takes whatever nothing else was picked for (a connected AI on a model, or one of the person's agents); New chat's menu picks a connected AI's model or an agent; an agent is a provider with more on top, kept in the workspace's folder (agents.feature A1c, A6) 2026-11-12 21:48:09 -08:00
shinyobjectz 96d2820589 A ShaderMaterial's shader is its colour pass's only: a prepass keeps Bevy's own fragment, which writes the normals and motion the prepass targets expect. Under Solari the camera has a normal and motion prepass, and the colour shader in it failed validation ("Error matching ShaderStages(FRAGMENT) ... prepass_pipeline") and Stay's fern dropped out. The three.js host draws <Instances> at each placement its data-at gives (sdk/render instances.tsx), as one InstancedMesh, instead of one mesh at the origin (sdk/r3f test/instances.test.tsx). docs/linux.feature is Shane's 11-11 plan for a faster Linux engine in the cloud: where a frame's time goes on Modal's GPUs, and the scenarios to test, validate and improve it (none started) 2026-11-12 21:46:51 -08:00
shinyobjectz 09eeb21fe9 LR10: getBoundingClientRect through a perspective is the box of the four corners as drawn, as Chrome's is. blitz-dom's transformed_bounds took each node's affine transform only, so a card turned under a perspective (its Projection) read at its flat size and place; one in a preserve-3d context maps from its context root's parent. A blitz-dom test holds Chrome's numbers for a 400x200 card under a 1000px perspective, rotateY(60deg), flat (379.05, 379.05, 206.19, 241.90) and in a world turned rotateX(10deg). transformed_rect maps any rect in a node's box, and a render manifest text's ink goes through it. snapcn 21 -> 23 of 33: card-rail 161.4 px off -> 0.6, announce-title 11504 -> 43.5, punch-lines and text-rewrite pass; P26 unchanged (185 of 215, every frame at the same SSIM) 2026-11-12 21:45:09 -08:00
shinyobjectz ea5fc2e5ef MX1, MX2: raea-sys-mlx, MLX on Apple silicon's GPU beside raea-sys-ml's ONNX Runtime (docs/mlx.feature)
On mlx-rs =0.34.0 (MIT OR Apache-2.0), which builds MLX v0.32.2 from source with cmake at build time. The dependency
is macOS-only, so the crate is empty on Linux and Windows. A model's MLX path is plain functions over its safetensors,
read by the checkpoint's own tensor names (weights.rs), with f32 tensors in and out (tensor.rs) and layers that do
PyTorch's maths (nn.rs): a Linear runs in its weight's dtype; LayerNorm, GELU and SiLU run in f32; attention is MLX's
fused kernel. Tests check each layer against the same maths in plain Rust on the CPU. f32 matmuls run in TF32 on the
GPU by default (within 3e-3; 1e-5 with MLX_ENABLE_TF32=0). use_metallib points MLX at a fetched metallib (MX4). No
model uses it yet: IDOL, which was to be first, is held.
2026-11-12 21:28:48 -08:00
shinyobjectz d415e0c59d Skills: raea-skills d5100dc (fingerprint-docs, on component-name 278f4ff): the skill teaches raea fingerprint things with raea check --things on a 3D shot (and its copy of the scenes guide), the post-mortem when a project is finished, and that a script scores on text axes only; cli.md gains check --things and fingerprint things (merged to raea-skills main when 0.1.3 is published) 2026-11-12 21:28:00 -08:00
shinyobjectz 7452b0d90c FP13: the scene guide's motion step runs raea fingerprint things and raea check --things on a moving shot (lands with raea-skills d5100dc, the guide's copy) 2026-11-12 21:25:42 -08:00
shinyobjectz d6d97c3b8d FP13, FP2f, FP1b: the manual and the scene guide teach fingerprint things with raea check --things, the post-mortem and scripts; docs/fingerprint.md says realness was measured and not shipped, and what FP1b's text column and FP13's things read 2026-11-12 21:24:34 -08:00
shinyobjectz 6c106fb8f4 FP1b: an axis judges only what a file has. A script scored with raea's own taxonomy came back blurry, glowing and frozen, because picture heads scored its empty picture columns; now each axis needs rows of its own modality, and a script's windows say nothing until an axis reads text (tested) 2026-11-12 21:22:19 -08:00
shinyobjectz 869318073a LR10: a family raea/text's loadFont asked for gets Google's faces in the page even where raea bundles faces of that name, as a linked stylesheet's @font-face shadows a local font in Chrome. Inter is bundled (static 400 and 700), so it was never a missing family and Google's never came: 300, 400 and 500 drew alike ("snapcn" at 100px 345.45 px; Chrome 340.39, 345.47, 350.45) and 600 as 700. Now 340.33, 345.45, 350.48, 355.38, 360.45. snapcn 18 -> 21 of 33 (wordmark-cut, text-select, hero-launch pass; punch-lines 18.1 -> 0.9, text-rewrite 7.4 -> 0.2); P26 unchanged (185 of 215, every frame at the same SSIM). LR10 records the read cost: the first read in a frame about 0.39 ms, each further one about 0.01 ms (300 frames, median of 6), and karaoke-captions' reads under the run's noise 2026-11-12 21:21:05 -08:00
shinyobjectz cd268ef764 FP7a: archiving a project runs the post-mortem in the background (raea-feed PR #5) 2026-11-12 21:11:27 -08:00
shinyobjectz b8d21bf712 FP2f: raea-sys-fingerprint-things holds things and geometry (the camera-speed, floating, passing-through and empty-frame reads), split from raea-sys-fingerprint-use to keep each crate under 2,000 lines 2026-11-12 21:09:35 -08:00
shinyobjectz e652168202 FP2f: realness measured, not shipped. A head on a sound's CLAP and YAMNet means, labels by construction: raea's SAO foley, TokenSynth notes and Fish narration against recorded foley, instrument notes and speech under CC0 and CC BY (Clotho, NSynth, LibriSpeech). Held out by generator it scores TokenSynth 0.90, Fish 0.80 and SAO 0.57, under the 0.85 it needs on all three, so it isn't an axis 2026-11-12 21:06:06 -08:00
shinyobjectz 6abeb6ed43 LR10: a Google family from raea/text's loadFont is fetched when loadFont is called, and a canvas's measureText and svg text have it. The page fetched it at the first layout that named it, after a component's first effect had measured (its canvas found the fallback), and a family the page fetched first was cached without ever reaching usvg's font database, so document.fonts.load found it already known and gave the canvas nothing. Figtree's "scene" at 600 64px measured 145.72 (the fallback) against Chrome's 171.25; now 171.26. blitz-dom leaves out an app-bundled svg face of a family the page already gave (Geist fetched at import came before the bundled Geist, and both stayed; tested). snapcn 17 -> 18 of 33: bloom-lockup passes (40.8 px off before), word-gather 25.5 -> 1.2; P26 unchanged (185 of 215, every frame at the same SSIM) 2026-11-12 21:04:41 -08:00
shinyobjectz 3dc3096963 Skills: raea-skills 278f4ff (component-name, on fingerprint-fix 6047418): the graphics router teaches raea component list, add and --shared, and the motion guides' copies say raea component add (merged to raea-skills main when 0.1.3 is published) 2026-11-12 21:00:01 -08:00
shinyobjectz 55d9eeaa50 raea component, raea part's new name in 0.1.3 (Layout LY1-LY4), in what teaches it: each ready component's header (examples/parts, the registry the CLI copies from), the edit template, the craft guides (motion.md, motion/parts.md, motion/footage.md) and the manual's raea part page, now the old name of raea component. The graphics router in raea-skills teaches component list, add and --shared (raea-skills component-name 278f4ff); the skills check's coverage no longer finds raea component untaught 2026-11-12 20:36:08 -08:00
shinyobjectz bf984d4656 Skills: raea-skills 6047418 (fingerprint-fix): SKILL.md tells an agent to check a fix with raea fingerprint score NEW --was OLD, and reference/cli.md is regenerated 2026-11-12 20:34:49 -08:00
shinyobjectz 0902d43201 FP10a: glow, stuck under the gate on its look columns (held out 0.79 on 580 labels in the 'me' fingerprint), holds out 0.90 on SigLIP 2's picture columns, an encoder already on the device, so raea's base taxonomy reads glow from pictures, as FP4b's bootstrap already measured it; no adapter was needed 2026-11-12 20:32:56 -08:00
shinyobjectz 5189132ef8 LR10: a canvas's system-ui and BlinkMacSystemFont are macOS's SF ("System Font", variable in weight and optical size), as Chrome's canvas takes them. fontdb knew neither name, so a font list headed by them (snapcn's '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif') was measured and drawn in Helvetica, about 10% wider at 72px, and 600 measured as 700. -apple-system alone stays as it is: Chrome's canvas finds no face for it either. text-build, which places its words from measureText, goes from 9 px off Chrome to 1.3; the rest is SF's trak table, which CoreText applies and usvg doesn't 2026-11-12 20:30:01 -08:00
shinyobjectz 0f9da00368 LR10: kerning across spans, hidden inline words, and a render manifest read as Chrome draws. blitz-dom gave every composition span a border edge (with border-style none a border's computed width is still medium, and inline_edges read the width alone), so each plain span got a spacer box at both ends and parley split the shaping there: a line set a letter a span lost its kerning (AVAWATAVAWAT 632 px, Chrome 578; snapcn's word-flip 5.6 px wide). sdk/ui/parity's p13-text/kerning-spans holds it. blitz-paint doesn't draw a visibility: hidden inline element's glyph runs, though they keep their place (#13: word-flip's strut drew as a fake word). A still drawn again after an all-black first draw replaces its manifest entry instead of adding one (every later frame was listed a place late), and check.sh finds frames by number. A manifest text's ink spans its glyph runs and inline-blocks, not the padding at a line's ends. snapcn 12 -> 17 of 33 (word-flip, text-reveal, text-swell, karaoke-captions, word-captions); P26 unchanged (185 of 215, the same frames at the same SSIM). The web-components guide lists innerHTML and outerHTML as missing 2026-11-12 20:30:01 -08:00
shinyobjectz 9632d542cd LR10: the 2D context's roundRect and arcTo geometry move to paths.ts beside the Path they draw on (context.ts was 517 lines with letterSpacing and wordSpacing, over the 500 limit); the motion guide's rule 2 (sdk/guides/craft/motion.md, which raea-skills copies) says what a composition's DOM answers 2026-11-12 20:30:01 -08:00
shinyobjectz d9a5296796 Skills: raea-skills 1a321b5 (on fingerprint-ref), the motion router's rule 2 names the web APIs a composition's DOM answers and the raea modules that install them (raea-skills #50, merged to raea-skills main when 0.1.3 is published) 2026-11-12 20:30:01 -08:00
shinyobjectz 53d5f94888 LR2: every host that runs a composition answers its layout reads. Live play (preview, raea play, the app's stage, an exported game) answers from its live page, synced mid-settle as a render's is. Live play's lite runtime set no refs (a ref was null, a canvas drawn through one drew nothing): its hosts now keep bevy-react's BevyElement, BevyCanvasElement and BevyTextNode linked as React's tree is and set and clear refs, and entry_lite installs canvas2d and the DOM reads. raea world answers from the page it lays its frames out with; a baked timeline (raea play --baked) refuses a read plainly instead of baking it as 0. #54's repro played live puts "here" at x 342 (x 0 before); every layout-reads probe played live is its render's frame (SSIM 1.000), and the games replay (pong, platformer, lite against React) stays 1.000. A read costs a live frame about 1.5 ms (step p50 0.4 -> 1.9 ms, one read a frame on a 40-line page) 2026-11-12 20:30:01 -08:00
shinyobjectz a504787ad3 LR11: where the docs stand (the manual's web-components guide, raea-skills #50 held until 0.1.3 is published) and what's open (#54, #13) 2026-11-12 20:30:01 -08:00
shinyobjectz 05fb89ab72 LR11: the manual's guide to web components that measure (docs/manual/guides/web-components.md): what a ref, document and window answer as Chrome does, the frame held until a measure lands, and what a composition's DOM lacks (MutationObserver and IntersectionObserver never call back, an img's onError never fires, one rect for a wrapped Range) 2026-11-12 20:30:01 -08:00
shinyobjectz 44ca3f16d6 LR10: a page's fonts as Chrome finds them, in svg and canvas text. An @font-face face is found by its own weight and style, not its file's (Google serves one variable Inter as every weight, whose file says 400, so 500 drew as 400 and 600 as raea's bundled 700); a face given twice (document.fonts.load and the page's @font-face) is added once; a page's faces of a family shadow the app's bundled ones, as @font-face shadows a local font (raea's static Inter 400 beside Google's 400 read to canvas text as a family split by unicode-range); and a character's advance is read at the weight asked for (a space's moves with a variable face). The canvas has letterSpacing and wordSpacing, shaped by the host. snapcn: title-sweep 3.7 -> 0.3, spec-sweep 4.4 -> 0.3, sky-lockup 15.7 -> 0.3; the corpus 12 of 33 (7 before LR10) 2026-11-12 20:30:01 -08:00
shinyobjectz 8a51aa0433 LR10: svg text spaces its last letter as Chrome does. usvg 0.48.1 left letter-spacing off a text chunk's last cluster, so an svg <text> with letter-spacing and a middle or end anchor was drawn half or a whole spacing off where Chrome draws it, and its box was a spacing short. vendor/usvg patches apply_letter_spacing (marked raea:), canvas.svgText's length drops the tracking it added to make up for it, and the layout-reads box reader skips an svg's <title> and <desc>, which are never drawn. snapcn: drop-line 1.3 -> 0.2 and hello-zoom pass; P26 unchanged (the six fixtures under the bar fail the same frames at the same SSIM on a binary without the patch) 2026-11-12 20:30:01 -08:00
shinyobjectz 677ca278ba FP13a, FP13c, FP10a: raea fingerprint things FILE finds a piece's shots, its things with their depth and the ground under them every half second and a SigLIP 2 vector each (a render's things from its layer pass, NAME.layers, and its depth from its AOV pass when beside it, with no model run; footage's from the marks on its notes, followed by EdgeTAM, on Depth Anything 3 Small), and the camera's path (Lucas-Kanade flow); geometry.rs measures floating, passing through, a camera that changes speed mid-move and an empty frame, each with red-team cases, and raea check --things reports them as findings, never heads. The layers file reader moves from runtime/world into raea-sys-layers so both read it, and raea-perceive depth-values takes many frames to one model load. report names the axes stuck under the gate with 300 labels or more, the only ones that may try another encoder or an adapter 2026-11-12 20:28:09 -08:00
shinyobjectz 9eb649bf98 FP1b: scripts, briefs and pages get EmbeddingGemma 2 rows, a passage a step on their timeline (raea-sys-columns gemma.rs on ort with the q8 export the app's library keeps in ~/.raea/models, the same vectors transformers.js gives), and an axis with modality "text" scores its words as EmbeddingGemma 2 queries against 24 ordinary passages; a still or storyboard frame is one frame through SigLIP 2. Evidence written before the text column reads as the same rows with no text, and a fingerprint pinned before EmbeddingGemma 2 was on the machine keeps working 2026-11-12 20:28:08 -08:00
shinyobjectz 1e8c404738 FP11b: grow.rs's union widens a box in a loop 2026-11-12 19:24:22 -08:00
shinyobjectz 535acb5a4f FP11b: a mark's region and a matte's box share one union (grow.rs), and raea-perceive is looked for beside raea, then on PATH, in a loop of its own 2026-11-12 19:23:25 -08:00
shinyobjectz 8579b43228 FP9a, FP7a: the CLI reference describes score --was and postmortem's --ask and --tally, regenerated from raea help 2026-11-12 19:22:18 -08:00
shinyobjectz e367fe8190 FP9a, FP7a: a fix checked against the flag it claims to fix, and a postmortem. raea fingerprint score NEW --was OLD says whether each of OLD's gating flags is fixed, still there, or looks disguised (nearer the axis's disguised defects than its clean work), and exits 1 unless all are fixed (fixed.rs). raea fingerprint postmortem [PROJECT] [--ask N] [--tally] scores every version in the project's feed, asks at most ten yes/no questions in the app where a head goes against the person's labels or is least sure, each with its moment as a clip, and --tally makes the answers evidence and prints each head's held-out AUC before and after (postmortem.rs) 2026-11-12 19:20:35 -08:00
shinyobjectz c6acc16633 FP11a, FP11b: a note's marks teach. learn-notes makes a defect note's mark, box and lasso its row's region, grown and tracked over the label's span by EdgeTAM (raea-perceive track, from the note's frame forward and back; frames it loses dropped; grow.rs in raea-sys-fingerprint-use), and a span pin the row's time. The review player's marks and the agent's reading of arrows and strikes are in raea-feed 2026-11-12 19:20:35 -08:00
shinyobjectz 6c7889dbf7 Claude plugin: raea's marketplace installs raea-skills' plugin (its skills/ folder: the raea skill and its two hooks) instead of a second raea plugin of its own, whose manifest said 0.1.0 and carried no hooks. The README says how to install it 2026-11-12 19:03:08 -08:00
shinyobjectz 620ccb4093 Email plan (docs/email.feature): sign-in by emailed code, invites and review links by email, two-factor, notices, and raea news, the list people opt into and out of (EM10). Status 11-12: raea.io verified in Resend, DNS added, sign-in by email and the list live 2026-11-12 19:01:15 -08:00
shinyobjectz aca025d343 FP14d: the CLI reference describes move's flags (--to, --source, and --project's meaning with move), regenerated from raea help 2026-11-12 18:57:32 -08:00
shinyobjectz e4b607e7f8 FP14d: a note or mark teaches the fingerprint that judged the piece. teach, approve and pair already label the one which picks for the file; read, readings and learn-notes now keep a project's notes in the one that judges the project ([PROJECT] on readings and learn-notes), and learning again remakes only those notes' rows. raea fingerprint move [--fp CHILD] [--to PARENT] --axis/--source/--project takes a child's own matching rows up into a fingerprint it extends and retrains both; rows on an axis the parent lacks or the child overrides stay 2026-11-12 18:53:03 -08:00
shinyobjectz 0226baca9a FP14a: raea/brief's reference page lists the fingerprint types brief.ts exports (Fingerprint, Axis, Applies, Modality and fingerprint()) 2026-11-12 18:43:27 -08:00
shinyobjectz 760fcc9ec8 FP2c: raea-sys-fingerprint is a facility: raea-sys-fingerprint-use scores, compares and picks with its taxonomy, evidence and heads 2026-11-12 18:39:11 -08:00
shinyobjectz 4dcfa760b1 FP2c: Cargo.lock without half in raea-sys-fingerprint and serde_json in raea-sys-fingerprint-use, which neither uses now 2026-11-12 18:35:52 -08:00
shinyobjectz 85b877f06b skills pin: raea-skills fingerprint-ref (c5bfd05), on its main (cb8904f, #51), held off main until 0.1.3 ships: the skill scores a cut with the person's fingerprint before posting it and names raea/fingerprint, and reference/sdk.md lists raea/fingerprint 2026-11-12 18:34:47 -08:00
shinyobjectz 28fd448ea2 FP2c: fingerprint folded into what it copied, as L1's duplicate check asks. The ledger says its rows' labels, counts and projects once for training, inheritance, pairs and the bootstrap; one half-float codec serves the column cache and a fingerprint's words and evidence; a verb's files and a list's lines are read once; raea check's defects and its sound rules share their level in dB and their moments as issues; Encoders::pins is a map; the bootstrap names its own rows and each sense's defects once 2026-11-12 18:33:37 -08:00
shinyobjectz db58ead2c9 FP14a: room for fingerprint in L1's checks. raea/fingerprint gets its SDK reference page under Tools, every field of a fingerprint.ts described; the four crates have their layers; raea-sys-fingerprint-use drops serde_json, which it never used; and raea-cli's hook and check dispatch are one line each, as world, findings and notes are, keeping the crate at its 2000 lines with raea fingerprint in it 2026-11-12 18:21:27 -08:00
shinyobjectz 6f253b3fe5 FP5a, FP6b, FP6c, FP6e, FP8c, FP14c, FP14e: raea fingerprint pair WORSE BETTER records a pick or a hand edit as a pair, fit Bradley-Terry and held out by project, and an axis with pairs and no labels is ranked by them alone; versions makes weak pairs of noted moments the next version changed and nobody noted again; profile takes the ranges work you admire spans (loudness, tilt, cut rate, motion, brightness, contrast, saturation, sharpness), checked leave-one-out, and score --profile says what falls outside, where and which way; read has a fresh session read a project's pinned notes into kinds and axes, readings puts them to you in the app and tallies your answers, and learn-notes trains on them only once you've agreed with 45 kinds and 40 axes in 50; reembed moves evidence to this machine's encoders where its media is found, each row keeping the pin it was embedded on; new --kinds --tags writes where a fingerprint applies; bootstrap leaves gaps and clipping out of windows too quiet for them to change. Scoring, the sheet, which, diff and profiles move to raea-sys-fingerprint-use, keeping raea-sys-fingerprint under its size. The guide (docs/manual/guides/fingerprint.md) and every new flag in the CLI reference 2026-11-12 18:14:51 -08:00
shinyobjectz 64dfd63cd7 FP2e, FP4b, FP6a, FP6d, FP8a, FP8b, FP14b, FP14c: a test that word heads score the spike's noise and clipping from words alone (0.987, 0.975); every mechanical axis carries a cheat (darkened half as much, a white flash, a gap a third as long, clipping a third as hard, beside the de-rez sharpened after, half glow, quiet noise and a zoomed freeze); raea fingerprint approve makes approved work clean on every axis away from its notes; another eye's readings teach a head but never count toward its gate; a project's or workspace's fingerprint keeps its evidence a folder a person and each machine trains its own heads (raea fingerprint share); raea fingerprint diff A B lists the axes two tastes rank the same evidence most differently on; a fingerprint that extends another inherits its axes and evidence, its own labels counted twice and measured against each alone, an override learning from its own only and the parent never from the child; raea fingerprint which PATH and use NAME --in project|workspace pick the one that judges a piece (the project's that applies to its kind, its default, the workspace's, then the person's) 2026-11-12 18:14:51 -08:00
shinyobjectz fb11b58f6f FP1-FP4, FP14a: raea fingerprint. raea-sys-columns turns a video into one-second windows read by encoders that run on this Mac (SigLIP 2 for pictures, CLAP for sound, YAMNet for sound events, on ort; SigLIP never on Core ML's GPU), cached by content hash. raea-sys-fingerprint holds the taxonomy (each axis with its words, a fingerprint saying what it's for and what it builds on), the evidence ledger, small heads trained held out by source, scoring and the contact sheet. apps/fingerprint is the verb: new, bootstrap (known defects put into windows of real work), teach, score (--json, --sheet, --timeline), report, and a service that keeps the encoders loaded. raea check finds clipping, dropouts and flash frames as its own findings. sdk/raea types a fingerprint. 2026-11-12 18:14:51 -08:00
shinyobjectz f89873c1df FP14a: raea fingerprint in the CLI reference: its page under Check, each flag described, and the pages after it renumbered 2026-11-12 18:14:51 -08:00
shinyobjectz 853b6ab3dc FP0: Fingerprint, the plan and its spec: a taxonomy of axes with small heads over frozen on-device encoders (SigLIP 2, CLAP, YAMNet on ort; SigLIP on MLX once MX5 lands), trained from notes, marks, approvals and reference profiles, shared as evidence. FP0a-g hold the 11-12 measurements; FP1-FP13 are the build, with earshot (MIT) as the reference design 2026-11-12 18:14:51 -08:00
shaneandshinyobjectz a983349265 Release: ship only raea-skills' skill folders into share/raea/skills (#123)
raea-skills' skills/ is becoming its Claude plugin too (skills/.claude-plugin/plugin.json, hooks/, README.md,
icon.png), and release.sh copied that folder whole, so the installer, which copies every entry of
share/raea/skills into ~/.claude/skills, would have put the plugin's README, icon and hooks folder there beside the
skill. Now only folders holding a SKILL.md are staged, and _-prefixed ones (raea-skills' _template) stay out as
before. Tested on a mock skills/ with the plugin's files: raea/ alone is staged.

Co-authored-by: shinyobjectz <[email protected]>
2026-11-12 21:11:42 -05:00
Luke, I am your fatherandshinyobjectz ea741f6bef Page: give Blitz its viewport in device pixels (a Retina window's interface sits in a quarter of it) (#120)
* Page: Blitz's viewport is in device pixels, so a page at scale 2 fills its image (#119)

a78fb95 gives the app window's page the display's scale. With a scale other than 1, raea-sys-page still gave
Blitz a viewport whose window_size was the page's size in points. Blitz's window_size is in device pixels (it
divides by hidpi_scale for the CSS viewport), as the page's image and paint_scene already are, so on a Retina
display the interface was sharp but laid out in the top-left quarter of the window.

Page::px is the page's size in device pixels, used for the image, the paint and the viewport.

Nothing changes at scale 1.

* Page: the page's JS and its element list read the viewport in CSS px, and devicePixelRatio is the page's scale

With Blitz's viewport in device pixels, two readers of window_size in runtime/dom still took it for CSS px.
snapshot sent it as vw and vh with dpr 1, so at scale 2 innerWidth and matchMedia answered twice the width the
page is laid out at; elements tested boxes against a window twice the size, so elements up to a window's width
off screen were listed as visible. Both read the viewport's logical size now, and dpr is its scale.

tests/viewport.rs: a page at scale 2 lays a 100vw x 100vh element out at its size in CSS px; scale 1 is as it
was; a fractional scale rounds the image up.

Rebased onto main at 6da2995: main's LR1 (7fb2194) moved the layout snapshot into raea-sys-page (systems/page/src/snapshot.rs, snapshot_by, which a composition's page.layout answers too), so the vw, vh and dpr change is made there, and elements.rs re-exports it.

* Page tests: q and attr live in tests/common, which vars.rs and viewport.rs both use, not one copy each (dupes back to 293)

---------

Co-authored-by: shinyobjectz <[email protected]>
2026-11-12 19:48:36 -05:00
shinyobjectz 5d181dae28 Skills: raea-skills 803dd07, files.md says the default workspace folder as raea picks it (~/Studio where workspaces already are, else ~/Documents/raea, or ~/raea when iCloud keeps Documents), as SKILL.md does (raea-skills #29) 2026-11-12 16:40:16 -08:00
shinyobjectz bb7e6716b4 raea's own commits name their author when git has no user.name: a Linux account with no full name (CI's runner, a container) failed every one with "empty ident name ... not allowed", so a new workspace was never made there (main's CI: workspace tests' a_new_workspace_and_project_have_the_layout on ubuntu-24.04). As git_cmd gives a fresh Mac an EMAIL, it names the author and committer for the account, only when no user.name is set 2026-11-12 16:35:10 -08:00
shinyobjectz 6cb250a531 Tutorials: Libraries and Share work for review name their tutorial in their front matter, as the other eight tutorials do, so raea.io's docs show each one's walkthrough player (its voiced script is already made) and step to it in the tutorials' order 2026-11-12 16:32:02 -08:00
shinyobjectz 99e3fe0751 Tutorials: Publish and the tour name YouTube, LinkedIn or Bluesky, the networks anyone can connect today
Shane, 11-11: "sync all publishing to the current status state". TikTok and Instagram wait on their app reviews
(raea-api's CONNECTIONS_LIVE), so the pages name live ones; the narration was re-voiced to match in the private repo,
and raea.io's v0.1.1 build lays these two pages over the release's docs until main carries them.
2026-11-12 16:32:02 -08:00
shinyobjectz ebff73dbc6 LR6, LR7: the canvas's text natives (measure, advances, svgText) are each a function of the fonts (raea_sys_canvas::TextNative), registered from one table and given the page's fonts by with_page_fonts, instead of three wrappers that did it alike; canvas.read's rectangle and svgText's tracking read without closures that copied raea-runtime-sound's (dupes back to 293/59)
Skills: SKILL.md's 7. Deliver (sources: runtime/export/src) checked, still true: the export's change only passes page.layout's request through.
2026-11-12 16:26:53 -08:00
shinyobjectz 734b172d34 LR8: done, 11-12: ResizeObserver from the page's layout, the silent observers, holds in passes that draw nothing, and the harness's Chrome that renders 2026-11-12 16:16:09 -08:00
shinyobjectz b30eb6aa88 LR7: done, 11-12: document, createElement, ranges, svg text measures and URL faces, as built and measured 2026-11-12 16:16:09 -08:00
shinyobjectz fb4572f284 LR6: done, 11-12: measureText and getImageData from the page's fonts and pixels, as built and measured 2026-11-12 16:16:09 -08:00
shinyobjectz eb8d3ad795 LR5: done, 11-12: el.style's writes and getComputedStyle's page values, as built 2026-11-12 16:16:09 -08:00
shinyobjectz 203c26621c LR10: the harness: the runs both sides make, and a Chrome that renders. An inline <svg>'s words are runs of their own, one per <text>, in the render manifest (from the svg's usvg tree, mapped onto the page) and in boxes.ts, where they had fallen into the nearest html box: drop-line's 'then ships the film t h e n t h e n'. Words hidden by visibility, a measuring copy, are skipped on Chrome's side as the manifest skips them. Chrome renders each frame in real time through Playwright (bench/layout-reads/chrome.ts, the same pinned Chrome for Testing): a headless --dump-dom under --virtual-time-budget runs no rendering step, so a component's requestAnimationFrame and ResizeObserver never ran on Chrome's side. probes/document.tsx (getComputedStyle, svg text, a Range, a node made and measured, word- and letter-spacing) and probes/observe.tsx (ResizeObserver) are new 2026-11-12 16:16:09 -08:00
shinyobjectz a5d89e95c1 LR7: a composition's document, with LR5's style and LR8's observers. LR5: el.style reads and writes the element's style (writes send an update op; React's next commit to the property wins), and getComputedStyle answers from the page's computed style: page.layout takes { styles: [ids] } and the snapshot carries s: {id: {property: value}} for them, as stylo serializes it (engine/page read.rs computed_style), kept until the next commit (page-layout.ts computedOf). LR7: document has body (the composition's surface, the element the page draws from), documentElement, getElementById, querySelector(All), createElement (appended into the composition it's laid out and measurable, removed it's gone; a canvas is an OffscreenCanvas), createTextNode and createRange: a Range over a text node is its characters laid out in the parent's computed font, placed where the parent's line starts. An svg <text> has getComputedTextLength, getNumberOfChars, getStartPositionOfChar, getEndPositionOfChar and getSubStringLength, laid out by usvg in the element's computed font (canvas.svgText: family, size, weight, letter- and word-spacing, font-variation-settings). document.fonts loads a family the composition asked for (fonts.load), and a FontFace given by URL is fetched through raea's cache into the faces an svg's and a canvas's text are set in (fonts.face). window is globalThis with innerWidth, innerHeight, devicePixelRatio and getComputedStyle. LR8: ResizeObserver calls back after a commit whose layout changed an observed element's size, and once on observe, with contentRect, borderBoxSize and contentBoxSize; while a delayRender hold is open it checks every 16 ms, as a browser renders while a page waits. MutationObserver and IntersectionObserver exist and never call back. A pass that draws no page (the sound pass, the 3D rows' pre-pass) answers reads with a 0 x 0 page, and its holds are released (page-layout.ts noPage): a hold waiting on a measure could never end there. probes/document.tsx and probes/observe.tsx match Chrome within 1 px 2026-11-12 16:16:09 -08:00
shinyobjectz 37fc50782d LR9: holds released as Chrome releases them. A composition holding its frame until an <img>'s onLoad is released: the load is told on the turn after the img is made or its src changes (sdk/raea dom-load.ts), through the host's events, as Chrome fires it once the picture is in (the page holds the frame for the picture itself). A hold released from requestAnimationFrame (two rAFs after a ref lands) is released: while a delayRender hold is open, rAF's callbacks run every 16 ms with the held frame's time (frame-globals.ts), as a browser keeps rendering while a page waits; <R3F>'s own hold doesn't pump. channel-thread, logo-collapse and pulsing-border, which LR9's real holds had stopped, pass again. settle.rs's held flag is set once per turn (no dead initial value) 2026-11-12 16:03:05 -08:00
shinyobjectz 34629d33b8 LR6: a composition's 2D context measures and reads back. measureText is the text shaped by usvg as the canvas draws it, in the page's fonts (canvas.measure: width, actualBoundingBox*, fontBoundingBox*, from the alignment point), and getImageData reads back what was drawn (canvas.read); raea-runtime-canvas serves both as natives, which @raea/ui's wire reaches through the composition's __ui_sync (sdk/raea canvas2d.ts). putImageData writes its pixels as they are (a put op). OffscreenCanvas is a canvas no page shows. raea's bundled faces (Inter and the rest) now reach usvg's font database too, so a canvas measures and draws them, not a fallback. probes/measure.tsx matches Chrome: width exact, ink and font box within 0.8 px, pixels read back equal 2026-11-12 16:02:32 -08:00
shinyobjectz 6da2995575 Layout L1: lint.rs's outside-import hint formats the shared path where it says it, so no closure copies direction/world.rs's (dupes back to 293/59) 2026-11-12 15:31:36 -08:00
shinyobjectz c7e857b243 Layout L1: the CLI crate back to 2000 lines (component and part's checks in one), workspace_of is shared_of (the loader only wanted shared/, and it duplicated godot_run's nearest_project), and the manual's raea component page (Projects group, --shared and --force described) 2026-11-12 15:19:50 -08:00
shinyobjectz 657664d7d9 Skills: raea-skills 8c6225c, the reference and SKILL.md for LY1-LY4 (project new's folders, @shared/); also brings in #46 (findings) and #47 (hold) already on raea-skills main 2026-11-12 15:13:33 -08:00
shinyobjectz cb87e0cd59 Layout LY1-LY4: a project's compositions/, components/, controllers/, assets/ and artifacts/, and the workspace's shared/ (docs/layout.feature)
Shane 11-12: reorganize the default project around compositions, components, controllers, assets and artifacts, with a workspace library any project can call on. It's named shared/ and @shared/ so it isn't confused with raea's media libraries.
- LY1: raea project new makes the five folders (each with a .gitkeep), out/, brief.ts, AGENTS.md and a tsconfig mapping @shared/* to the workspace's shared/. raea workspace init makes shared/ with the same five, and .gitattributes keeps assets/** and out/** in LFS.
- LY2: the engine's loader resolves @shared/<kind>/<name> by walking up to .raea/workspace, with a relative import's extensions and index files; outside a workspace it's refused with what to do. PJ8's lint takes @shared/ imports and names @shared/ as the fix for a climb into shared/.
- LY3: the scan reads compositions from compositions/ and components from components/ (and from shared/), lints a composition elsewhere as misplaced, says once that a project is in the old layout, and reads controllers as the project's over shared/controllers/ by id.
- LY4: raea component list/add [--shared] replaces raea part, which still answers this release.
2026-11-12 15:07:16 -08:00
shinyobjectz b3fe2699d0 LR9: "raea" exports delayRender(label?, { timeoutInMilliseconds }), continueRender(handle) and cancelRender(error) on the frame hold <R3F> already uses: the frame isn't marked done while a hold is open, and the last release draws it, so a composition that measures after a font, a fetch or a timer has that frame taken, not the one before. A hold not continued within its timeout (30 s) fails the render naming its label; cancelRender fails it at once, as a throw does. Settle lets a held frame wait up to HOLD_SECS (120 s) instead of failing it at its 20 s stall guard, so the hold's own named failure comes first. probes/hold.tsx sets its words after a timer under a hold and matches Chrome; a never-continued hold fails in 2.6 s naming it. The manual has its page (reference/sdk/hold.md) 2026-11-12 14:45:00 -08:00
shinyobjectz 8a2f9c78ab LR4: a composition's refs have the tree a web component walks and queries: children and childNodes, the first, last and sibling nodes, parentElement, tagName, nodeName and nodeType, id, className, classList, dataset, getAttribute, textContent, contains, matches, closest, querySelector and querySelectorAll, answered in JS from bevy-react's committed instances (sdk/raea's dom-tree, installed from the entry with dom-reads). Selectors cover tag, *, #id, .class, attributes, descendant and child, comma lists, :first-child, :last-child, :only-child, :nth-child and :not; anything else throws a SyntaxError, as Chrome's does. el.id is the id attribute as on the web: the bevy-react patch renames its reconciler id to nodeId, and canvas2d, dom-reads and useEntity read that. probes/tree.tsx prints every answer and matches Chrome's words 2026-11-12 14:26:20 -08:00
shinyobjectz 2d869d719b LR3: a composition's refs have the geometry a web component reads, from the page that draws the frame: getBoundingClientRect (a DOMRect, transforms included), getClientRects, offset* and offsetParent (untransformed, whole px, from the positioned ancestor's padding edge), client* and scroll*, each as Chrome answers it. bevy-react 0.8.1 gets a patch (sdk/react/js/patches, applied by bun install) that makes its instances a tree, BevyElement and BevyTextNode with their parent, children and committed props; sdk/raea's dom-reads puts the reads on BevyElement from the entry. #54's repro now puts "here" where Chrome does (x 342, was 0), and probes/geometry.tsx prints every read and matches Chrome's words. The bundle crate's stylesheet url() rewriter moves to raea-runtime-cssurls to leave it under 2000 lines 2026-11-12 14:18:19 -08:00
shinyobjectz 272b94e765 LR1: a pass with no page answers through layout::nothing_drawn() (one closure, not one per caller), and the two new crates have their layer (runtime) 2026-11-12 14:13:01 -08:00
shinyobjectz ee171c4f85 LR1: room for the layout reads in crates at their 2000-line limit. Matchmove (raea track, matchmove.solve) moves out of raea-runtime-react into raea-runtime-track, which react re-exports as scene::track; the frame pages' asset writer (store_page, store_clear, the writer pool) moves out of raea-runtime-export into raea-runtime-pagestore. page-layout installs itself on import, so the entry adds one line. A pass with no page answers NOTHING_DRAWN, and wait_flush takes the runtime's ask. page-layout and dom-reads are installed by the entry, so the manual's and the skill's references skip them as they skip canvas2d 2026-11-12 14:09:19 -08:00
shinyobjectz 7fb2194503 LR1: A composition reads its layout synchronously from the page that draws its frame (#54). Its JS asks page.layout and blocks; settle wakes on the ask as on a flush, applies the commits already sent, and the host lays its page out at the frame's time and answers every element's boxes at once, keyed by React id: raea-sys-page's snapshot (now runtime/dom's too), with offsets from blitz-dom's offset_rect and offsetParent. settle_with takes the host's answer; plain settle says the host lays no page out. Each runtime has its own ask (a render's 3D pre-pass and a bake's workers run beside it). The still, 3D and fed renders answer from their page; the sound pass and the 3D rows' pre-pass answer no boxes. sdk/raea's page-layout keeps the answer until the next commit or frame, so a composition that never reads makes no snapshot 2026-11-12 13:54:53 -08:00
shinyobjectz fc7bfa3a0c LR0: bench/layout-reads, compositions that measure their text and layout against headless Chrome: check.sh runs a corpus (modules exporting Comp, conf and props) at its first, middle and last frames in raea and in Chrome (React DOM in raea's Clock, mounted once its fonts are in), and compare.jq pairs their text runs by words (raea's manifest against boxes.ts, made the same way), box and ink within 1 px. probes/ is raea's own corpus, #54's repro first ("here" at x 0 where Chrome puts it at 342); snapcn's 33 run through the private tree's adapter. The baseline, recorded in docs/layout-reads.feature: 3 of snapcn's 33 pass (all hold-only); 13 of the 27 that measure throw and the rest drift up to 87 px 2026-11-12 13:42:42 -08:00
shinyobjectz 593ebb5226 LR0: Layout reads, the plan (docs/layout-reads.feature): compositions measure text and layout as Chrome does (#54), answered synchronously from the Blitz page that draws the frame; LR0 the snapcn harness against headless Chrome, LR1-LR2 the layout call and every host, LR3-LR8 the DOM on refs and document, LR9 delayRender, LR10-LR11 the bar, docs and the issues 2026-11-12 13:42:42 -08:00
shinyobjectz 97e03e7447 The black-frame warning reads only elements' boxes: asking a text node for its bounding rect panicked in blitz-dom (transform on a text node), so a render whose frame drew black twice crashed whenever near-black words came before anything with a colour of its own (snapcn's text-build and text-swell, 11-12). bench/black-frame gains RAEA_BLACK_FAULT=3 (every draw black, the canary healthy: the render warns, naming what the page shows) and a text-first case that panicked before this; regression from 559d8274e (#96), which isn't in 0.1.2's rc3 2026-11-12 13:21:04 -08:00
shinyobjectz 559d8274e0 A frame that comes out all black though its page shows something is a warning, said once over its run of frames (#96)
A frame black on two draws whose GPU passes its canary was kept as the scene's black with one stderr line, and every
later black frame was let through silently: #96's 4K handover lost frames 22-29 that way, the render reporting
success. Now, when such a frame's page shows something that isn't black, the render warns "black-frame" naming it
and where it's written ("frames 22-29: drew all black on two draws, though the page shows a rgb(34, 34, 34)
background (handover.tsx:31:3)"), in the run's findings: stderr, the manifest, the summary's count and raea check's.
A page that is black (a black background, nothing on it) says nothing, as before.

raea-page's visible_paint finds it: the first element shown on screen, not a video's holder, whose background or own
words' colour isn't black, with its source stamp; it shares the manifest's opacity and stamp walks, now functions of
their own. raea-core-facts' said_frame joins a frame's finding to the same one running on the frames just before it,
so a run prints one line and counts once. Both black checks of the page path call it (bevy_frame.rs's still and video
frames, render.rs's page over 3D). Left out, as on the issue: a fed MP4's frames, which never come back to the CPU.

RAEA_BLACK_FAULT=3 draws every frame black with the canary passing (a draw dropped whole, as #96's was), to test it.
Checked: a #222 page under that fault warns once over frames 0-5, the manifest holding one finding with frames [0, 6];
a black page under it says nothing. Test: said_frame merges a run and starts another after a gap (the two tests that
say and take findings hold one lock).

Skills (SK4): SKILL.md's "7. Deliver" names runtime/export/src and says nothing of black frames: checked, still true.
2026-11-12 12:49:42 -08:00
shinyobjectz 645b0853cc Compositions get the web's canvas 2D context, requestAnimationFrame and Image (#55, #56)
A <canvas> ref's getContext("2d") in a composition was bevy-react's recording context, whose API isn't the web's
(no fillRect, setTransform or createImageData) and whose draws nothing in raea reads: snapcn's dot-bloom and
orb-swarm threw, and a canvas drew nothing. sdk/raea's canvas2d.ts gives it @raea/ui's CanvasRenderingContext2D, the one
an app page has, whose display list goes to the element as its __canvas2d prop, which the page already draws into
the canvas's bitmap (systems/canvas). The context sends through the host's own _send when it has one (sdk/ui
paths.ts, context.ts). bevy-react's handle keeps no props, so a canvas's width and height (300 x 150 unset) are read
from the batches the bridge sends through the host's op_flush; set on the ref, they go to the element and clear the
bitmap, as in a browser. getImageData reads zeros in a composition (no host to read back from).

frame-globals.ts installs requestAnimationFrame, cancelAnimationFrame and Image where they're missing (#56). A callback
runs once, at the frame after it was asked for, given that frame's time (f * 1000 / fps), so a frame drawn again gets
the same calls: from the React entry's frame step and the live entry's draw. Image's load fires on the next microtask
once its src is set, so a preload resolves; it reports no pixel size.

The bundle pointed @raea/<package> imports only at packages listed whole; a module listed alone (@raea/ui/canvas, as
@raea/ui/plugin is) now resolves too (rewrite.rs point_sdks).

Checked: a composition drawing red, then lime under setTransform(1,0,0,1,50,50), draws both where Chrome would;
canvas.width reads its width prop (200), createImageData(2,2) is 2x2, rAF's time at frame 5 is 166.67 ms and an
Image's onload fires, across a 10-frame MP4. Tests: conformance/frame-globals.test.ts; point_sdks with @raea/ui/canvas.
2026-11-12 12:37:09 -08:00
shinyobjectz e165d0c4a8 Video with alpha (#113): a VP9 WebM's transparency and a ProRes 4444's are drawn, not refused or made opaque
A <Video> on the page was opened by the platform's decoder alone (Apple's on a Mac), which reads no WebM: a VP9 WebM
with alpha was refused, "no video track". The page now asks the backends in raea-io-media's order (RAEA_MEDIA's, the
platform's, the portable one, the ffmpeg CLI), as the other readers of video do, and says what each answered when
none opens it.

The ffmpeg CLI decoder read nothing under FFmpeg 8 and later, which took out -vsync: raea-io-ffmpeg's passthrough()
gives -fps_mode from 5.1 on (apps/check's flash test had that rule; it calls this one now). A VP8 or VP9 stream tagged
alpha_mode=1 is decoded with libvpx, named before the input (FFmpeg's own VP9 decoder drops the alpha WebM keeps beside
the picture), where this FFmpeg has it. ffmpeg's stderr is kept for a read that fails and out of the run's output.

Apple's decoder made every pixel's alpha 255. A track whose format description says it carries alpha (ProRes 4444 at
depth 32, HEVC with alpha) keeps VideoToolbox's: straight, as checked on a ramp from 0 to 255 over blue (63/192,
127/128, 190/65 at a quarter, half and three quarters).

Checked on the issue's files, a red circle on nothing over a blue page: WebM and ProRes give a blue corner and a red
centre (were refused and red); a 30-frame MP4 from the WebM holds that on every frame read; a plain H.264 is unchanged.
Test: raea-io-ffmpeg's vp9_webm_keeps_its_alpha (skips without ffmpeg and libvpx), now in CI's list.
2026-11-12 12:14:24 -08:00
shinyobjectz d1e61bee2b render --alpha: a frame with 3D is transparent where nothing is drawn, as a 2D page is (#114)
The 3D camera already cleared to #00000000 under --alpha (program.rs), but bevy_over_3d, which lays the page over the
3D for PNGs and transparent movies, set every pixel's alpha to 255 (the 3D taken as over black), so an <R3F> or a
native 3D scene came out opaque black around it and setClearColor(x, 0) had nothing to reach. Under --alpha the 3D's
own alpha is now laid under the page's by the same SrcOver as its colour and the premultiplied result made straight
(scene_straight); the page alone, a 3D slot and a camera in a page element keep their alpha too. program.rs's note
that frames with 3D come out opaque is gone. Checked on the binary at 320x320: the report's <R3F> box with
setClearColor('#000', 0), a native Camera3d box and a camera inside a positioned element all write alpha 0 in empty
corners and 255 on the box, a transparent .mov likewise, and a render without --alpha is unchanged (Bevy's 43, 44, 47
clear, opaque).

Skills (SK4): SKILL.md's "7. Deliver" names runtime/export/src; neither it nor the 3D pages say 3D is opaque under
--alpha: checked, still true.
2026-11-12 11:58:27 -08:00
Ragul Sundaram 875006089f r3f: three peer range >= 0.180.0 (HDRLoader first ships in 0.180) (#118)
src/three/scene.ts imports three/examples/jsm/loaders/HDRLoader.js, added in three 0.180; with three 0.170-0.179,
inside the old range, every <R3F> scene fails to bundle.
2026-11-12 14:45:59 -05:00
Ragul Sundaram 163f0b9e00 R3F: an opacity outside [0, 1] is clamped, as three draws it, instead of throwing (#117)
An easing that overshoots (bezier(0.34, 1.4, 0.64, 1)) gives a material opacity of 1.03; three clamps it when it
draws, but the bridge handed it straight to raea's MeshBasicMaterial, whose check threw RangeError. The bridge now
clamps opacity before converting.
2026-11-12 14:45:55 -05:00
shinyobjectz 76a4ef7885 A still no longer prints 54 CommandQueue warnings: the last frame's extract commands are applied before the engine goes (#89 item 7)
Bevy applies the extract schedule's commands in the next frame's render schedule. A still draws one frame and drops
the Engine, so each extract system went with its queue unapplied and bevy_ecs warned "CommandQueue has un-applied
commands being dropped" 54 times (lldb on the warning: the extract systems' FunctionSystemState, dropped with the
render sub-app's schedules from render_with). Engine's Drop now runs the extract schedule's apply_deferred on the
render world, as Bevy's apply_extract_commands does each frame. Checked on the binary: a still of the starter edit
prints no CommandQueue line, and a video renders with 0 findings. forward_render_diagnostics is written shorter to
keep raea-render within 2,000 lines.
2026-11-12 11:40:06 -08:00
shinyobjectz a185361869 A fresh raea init renders again: an <Audio> behind a condition isn't one the render must hear
The starter edit plays a sound-only cut with <Audio> (09ee78513, #89 item 2) on a branch that runs only when there is
one (`c.kind === "audio" ? <Audio /> : <Video />`). The render's silence check refused any edit whose bundle has an
<Audio> call and no sound, so `raea init` then `raea render edit.tsx` was refused before the edit had any cuts. The
check (raea_runtime_sound::always_plays_audio, its own file with a test) now counts only an <Audio> that always plays:
one behind `?` or `&&` is silent when its condition is false, as meant, while one in a wrapper's children
(`children: jsx(Audio, …)`, the <Mix> that dropped them on 10-18) is still refused. Checked on the binary: the starter
edit renders 90 frames with 0 findings, and an <Audio> inside a component that returns null is still refused.

Skills (SK4): SKILL.md's "7. Deliver" names runtime/export/src and says nothing of the silence check: checked, still true.
2026-11-12 11:32:27 -08:00
e90d70f0dc check: a card that shares one word with a line isn't held to it as a caption (#102, #89 item 3)
The cue rule anchored on any one word of weight within 2 s, so a card
sharing a single word with another line ("Wirestock x OpenAI Sora" against
"At Wirestock, I worked on...") was held to that word's time. A text now
counts as a caption only when at least half its words match the spoken run
in order, and a one-word card only within 0.75 s of its word. Words are
compared by the shared word_key, as the rest of the rule does. A caption is
still timed from its first word, so a card whose first word was said earlier
is still flagged, by design.

Part of #89

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: shinyobjectz <[email protected]>
2026-11-12 14:26:07 -05:00
shinyobjectz 6d8623ca9b Node's import.meta.url is written into each module, as import.meta.main is: macOS 15's JavaScriptCore left it undefined
createRequire(import.meta.url) then resolved packages from ".", so a tool requiring a package that way failed on
macOS 15 with "Cannot find package" (a newer JavaScriptCore gives the module's key, which is why it passed here).
raea-native's node test found it as soon as CI's unit tests ran it: the crates #90 added switch on raea-native's
modules feature, and before that the test compiled to nothing in CI. Each module's text now has import.meta.url as
its file's own file:// URL, the way node.rs already writes import.meta.main in.
2026-11-12 10:59:23 -08:00
shinyobjectz 2b8b43a420 raea check's flashing screen is a crate of its own, raea-app-check-flash, so the check has room for #89's fixes
apps/check was at its 2,000-line limit (tools/size.sh) with three of #89's items still to come. The screen itself
(Px, Swings, FlashScreen: WCAG 2.3.1's opposing swings in a frame's windows, from decoded RGB) is pure pixel maths
with nothing of the check's, so it moves to apps/check/flash with its six tests, unchanged; the FFmpeg side (the
decode, showinfo's exact times, the log's severities, the findings) stays in flash.rs. apps/check goes to 1,680
lines. CI's unit tests take the new crate too. And raea-render's log-filter comment is folded a line shorter: the
merge of #104 left the crate at 2,001.
2026-11-12 10:55:50 -08:00
Mattias HjemgaardandClaude Opus 5.5 ab0babcce7 log: the 3D camera is the shadow LOD origin, and bevy_time's warning is filtered (#104, #89 item 7)
* fix(log): a 3D camera that is the shadow LOD origin, and bevy_time's warning filtered

Every 3D run with a point or spot light warned that no entity has
ShadowLodOrigin (the scene camera draws into an image, so Bevy picked one
arbitrarily): the scene camera now carries the marker. bevy_time's "did not
receive the time from the render world" (raea drives Time by frame, with the
render world in step) is filtered out of stderr, in Bevy's log filter and in
raea_io_trace's logger; the event log keeps every record.

Measured on main 5b2c7731: a 3D still with a point light printed the
ShadowLodOrigin warning, now nothing; a 2D still printed bevy_time's line,
now not. The 54 dropped bevy_ecs CommandQueue lines on a 2D still are left as
they are: their source still needs finding.

Part of #89

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* check: keep raea-render under the size cap

The two new comments said in five lines what fits in three; raea-render
was 2 lines over tools/size.sh's 2,000-line crate limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-12 13:43:33 -05:00
shinyobjectz 09ee785138 raea cut takes a sound-only take (#89, item 2)
A take under media/ with sound alone (wav, mp3, m4a, aac, flac, aif, aiff, ogg, opus) was no take at all: `raea cut
take.wav --at 0-1` refused it, and a video's shot detection would have opened it as a picture. Such a take is listed
with the videos, cut on its words or spans as a video is, with no jump cuts to keep off and the edit's 30 fps grid; its
clips carry kind "audio" in cuts.ts (and no face is looked for in perception.json), and the project template plays
them as <Audio> under whatever the edit puts in their place. Found and shaped by SirSicard's report; items 3, 5, 6
and 7 stay open.
2026-11-12 10:32:22 -08:00
shinyobjectz 6f88437dc1 raea check: the safe-area rule tests a text's letters, not its box, and a missing taste file is a note (#89, items 1 and 4)
A centred line in a left: 0; right: 0 box was flagged in the left zone, since the rule tested the layout box, which
starts at x = 0. The render's manifest now records each text's ink (the lines' own extent, each laid by its alignment,
as a box beside the element's), and a run's per-frame boxes are its ink where that's recorded, its box on an older
manifest, so the clipped, safe-area and face rules measure the letters; the safe-area finding names the edge crossed
and prints what it measured. And --taste naming a file under the person's taste folder (RAEA_TASTE, else
~/.raea/taste) that isn't there yet prints a note and checks without it, as the skill's standing
`--taste ~/.raea/taste/taste.ts` does on a machine with no taste file; any other missing path still refuses.
findings_of and Probe::of are written shorter to keep the crate within 2,000 lines. Item 2 is the next commit; 3, 5
and 7 stay open (6 is in the docs already). Diagnosis and shape from SirSicard's report.
2026-11-12 10:32:22 -08:00
shinyobjectz 6e79971b12 CI runs the tests of the crates that need no GPU or media device, and two of their tests hold on any build (#90)
ci.yml's unit-test step tested three crates; the brief, K, bundle, check, workspace, tools and targets crates join it,
with debug info off for the test binaries (with it they filled 27 GB of a runner's disk). Two tests only passed by
accident of the build: the bundle test's fake SDK sat where the resolver no longer looks (it reads sdk/tsconfig.base
.json's paths since S1d), so it's laid out as the real one with that file; and the workspace's literal test depended
on serde_json's key order, which a crate built alongside (raea-cli) turns into insertion order through preserve_order,
so its lines are held as a set. Found and shaped by SirSicard's report.

Skills (SK4): SKILL.md's "2. The workspace and its projects" and "3. Read before you make" name apps/workspace/src,
where only its tests changed: checked, still true.
2026-11-12 10:32:04 -08:00
shinyobjectz 11dab02b51 Page: getBoundingClientRect stops at a freed containing-block link and answers a zero rect under display: none (#108)
A containing-block link is what the last construction and layout left, and freeing a node doesn't clear links to it:
after a display: none clip's anonymous blocks were freed, measuring one of its descendants panicked on the stale key
(invalid SlotMap key), which an HTML composition hit through its script's getBoundingClientRect. The two geometry
walks and inline_root_ancestor now stop at a missing node, as the paint tree's walk does, and an element in a display:
none subtree answers Chrome's zero rect rather than a rect measured up to the stale link. Cause read by Razepriv in
#108; the same family as #24.
2026-11-12 09:55:56 -08:00
shinyobjectz 6177e27d51 Encode: the RGB to NV12 step dithers through a 4x4 Bayer threshold, so dark gradients stop banding in 8-bit H.264 (#87)
nv12.k and nv12buf.k rounded half up into limited range (220 levels of 256), so a slow dark gradient merged into
bands and blotches that raea check flagged on every sampled frame of a 1080p60 fog shot. Each sample now rounds
through the Bayer threshold of its pixel (a chroma pair's, of its block's top-left), fixed by position, so play and
render agree and nv12_cpu (the CPU render) stays bit-equal: core/k/tests/nv12_dither.rs runs both kernels through the
interpreter against it, and holds a flat dark grey's mean. Samples are clamped to the nominal range (luma 16..235,
chroma 16..240), since 220/256 overshoots 219/255 and the dither would have put some white on 236. The report's
dark-gradient repro goes from a blotching error on 2 of 2 frames to clean, at 2.98 MB instead of 0.64 MB for its
4 s: the encoder keeps the gradient it used to flatten. Diagnosis and shape from SirSicard's report.
2026-11-12 09:55:54 -08:00
shinyobjectz a78fb95e75 raea's window: the page is painted at the display's scale, so a Retina window is sharp
v0.1.1 laid the window's page out at scale 1 and stretched its image over the window: on a Retina display every
glyph and hairline was drawn at half the pixels (a bug report of 11-12: "UI renders at 1x on Retina", the blur and
pixelation people noticed). page.rs size() now gives the page the window's scale factor along with its size in
points, read each frame so a window moved to another display follows; headless, the image target's scale stands.
RAEA_WINDOW_SCALE=2 opens the window at that scale on any display, to check it on a 1x Mac. tests/retina.rs covers
the scaled window and the headless case.
2026-11-12 09:47:09 -08:00
shinyobjectz be220a6064 Page paint: a filter of opacity() functions alone is drawn as the layer's alpha, not as an atlas image (#96)
Every filtered element is an image the size of its box in Vello's atlas (8192 px a side). Two overlapping scenes that
each stacked six full-frame <Freeze> layers under filter: opacity() (a motion blur) at 2160x3840 asked for twelve such
images, more than the atlas holds, so the frame was drawn without them: on 0.1.0 silently, on main as a refusal. An
opacity() filter scales the group's alpha exactly as the opacity property does, so it now folds into the layer's
alpha and needs no image. The report's composition draws its frame 26 at 4K; the filter-functions, opacity and
backdrop-filters parity cases match Chrome as before.
2026-11-12 09:07:31 -08:00
shinyobjectz 7fb6251bf9 Page layout: an inline box is laid out in full while its line is only measured, so a relayout keeps its baseline (#109)
Taffy's measure cache keeps a box's size without its baseline. On a fresh layout every inline-block missed the cache
and its baseline came along; once one span's transform changed, the title's other spans came back from the cache
baseline-less during the measure pass, sat on the line by their bottom margin edge, and the line measured taller by
the font's descent: a per-character spring title jumped 24 px and the block under it 25 px on the frames one span's
value left zero. Blitz already asked for a full layout of inline flex and grid boxes for the same reason; now every
inline box gets one. Checked with the report's composition: the accent line stays at the same row on every frame,
in either render order. The parity case p12-css/inline-block-transform-relayout toggles one span's transform and
holds the block under the title against Chrome.
2026-11-12 09:07:30 -08:00
shinyobjectz 5d320bc96e Live 3D: a mesh's emissive colour is sent the frame it changes, with its strength (#106)
A video draws its 3D live, and a mesh's row keyed only the emissive strength, and only where the first frame glowed:
a part dark on its first frame stayed black for the whole video, and a change of hue was ignored (stills were
right, since their first frame is the frame). The full path now sends the colour whenever it differs from what was
sent (none is black), with the strength (0 once black); the fast path hands such a frame to the full one, and its
strength rule reads the sent colour, not the first frame's. runtime/live/tests/live_emissive.rs steps a ball from
dark to blue to orange to dark, under RAEA_LIVE3D_CHECK.
2026-11-12 09:07:30 -08:00
shinyobjectz 3de2c63bab 3D: a Cone's picking bounds span its height, not twice it (#98)
boundsOf passed the cone's full height to box(), which takes half extents; the cone is drawn centred on its origin.
Found and diagnosed in #98. events3d.test.tsx checks a radius 0.5, height 2 cone's bounds.
2026-11-12 08:32:11 -08:00
shinyobjectz c89de2a778 canvas: arcTo draws the corner's short arc, as a browser does (#97)
Its ccw flag was inverted, so a right-angle corner drew three quarters of the circle through the far side. Found and
diagnosed in #97. sdk/ui/test/canvas-arcto.test.ts checks both turning directions and a four-corner rounded rectangle.
2026-11-12 08:32:06 -08:00
shinyobjectz d70c8e6604 Windows: every executable links with an 8 MB main-thread stack, not raea.exe alone (#112)
The desktop app's raea-page-host.exe kept Windows' 1 MB default and overflowed it inside a window callback
(0xc000041d) right after opening an MP4. .cargo/config.toml now passes /STACK:8388608 for both Windows MSVC targets,
so raea-page-host, raea-rune-host and raea-perceive match raea.exe.
2026-11-12 08:30:03 -08:00
shinyobjectz dfca0bcf12 Docs: raea's own servers index nothing for customers (docs/libraries.feature LB6b), so storage-and-search says indexing runs on your own computers again, and the API guide says a cloud upload is indexed by one of your linked computers 2026-11-11 19:46:40 -08:00
shinyobjectz 14870df064 Docs: sharing for review, libraries and the storage API. Two tutorials (share-for-review: a link anyone can watch and comment on, notes back to the agent, the next version on the same link, Review links, several files on one link, agents sharing; libraries: this Mac or the cloud, making one, search by what's in a shot, statuses, sharing from a cloud library, projects beside their code) and a guide to the API (who may call it: anyone on Pro or Team; agent keys and their scopes; libraries, search by meaning or by words, files, uploads, the trash, review links). storage-and-search says libraries stay on the Mac unless made in the cloud, and where indexing runs 2026-11-11 19:18:57 -08:00
shinyobjectz 6ba881cf0f R6e, R6f, R6g, R6h: the Library's review work is built. R6h: the projects saved to raea are listed under Projects in the Library's column, each its own cloud library over the project's folder (search, statuses, review links), with where its code stands above it (its GitHub repo and Pushed, or commits to push and to pull and changes in its folder) and one press to make the library; R6e to R6g take their @done tags 2026-11-11 19:01:47 -08:00
shinyobjectz de994972cd R6g: several files on one review link is built (a cloud library's picked tiles shared from a bar at the grid's foot; the set's page lists each item's own link; Review links lists the sets with Copy link and Stop sharing); R6h keeps what isn't: a library of a workspace's projects' cloud copies and synced code 2026-11-11 18:46:17 -08:00
shinyobjectz 13daeb9976 R6e, R6f: a file's own status and sharing a cloud library's file are built in the feed (statuses as reserved tags with the grid filtered by them; Share for review in a cloud library file's panel, Mac-only libraries never sharing); R6g keeps what isn't: links of several items and a library of projects' cloud copies and synced code 2026-11-11 18:33:34 -08:00
1391 changed files with 116200 additions and 6778 deletions

No files matched your search

+9
View File
@@ -3,6 +3,15 @@
[target.aarch64-apple-darwin]
linker = "tools/link-jit.sh"
# every Windows executable's main thread gets 8 MB of stack, as on macOS and Linux (Windows' default is 1 MB). The
# desktop app's raea-page-host overflowed 1 MB inside a window callback (#112); engine/cli/build.rs did this for raea
# alone. A DLL's link ignores /STACK.
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/STACK:8388608"]
[target.aarch64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/STACK:8388608"]
# no strip after linking: rustc's strip pass re-signs the binary and drops the entitlement (release has no debug info
# of its own; std's stays)
[profile.release]
+6 -3
View File
@@ -1,11 +1,14 @@
{
"name": "raea",
"owner": { "name": "Shane Murphy", "url": "https://raea.io" },
"owner": { "name": "raea", "url": "https://raea.io" },
"metadata": {
"description": "raea's plugin for Claude, from the skills/ folder of shinyobjectz/raea-skills: the raea skill and its hooks."
},
"plugins": [
{
"name": "raea",
"source": "./",
"description": "Make video, motion graphics, games and 3D with raea, the Render Anything Engine."
"source": { "source": "git-subdir", "url": "https://github.com/shinyobjectz/raea-skills.git", "path": "skills" },
"description": "Make video, motion graphics, games and 3D scenes with raea, the Render Anything Engine: the raea skill, and hooks that run raea's quick check on a composition after it's saved and show media in the raea app instead of the Mac's viewer."
}
]
}
-11
View File
@@ -1,11 +0,0 @@
{
"name": "raea",
"version": "0.1.0",
"description": "Make video, motion graphics, games and 3D with raea, the Render Anything Engine: write raea compositions, render them on the GPU, check the frames.",
"author": { "name": "Shane Murphy", "url": "https://raea.io" },
"homepage": "https://raea.io",
"repository": "https://github.com/shinyobjectz/raea",
"license": "FSL-1.1-ALv2",
"skills": ["./skills/skills/raea"],
"keywords": ["video", "motion-graphics", "game-development", "rendering", "bevy", "react", "agent-skills"]
}
+19 -2
View File
@@ -61,7 +61,9 @@ jobs:
run: |
rustup show active-toolchain
sudo apt-get update && sudo apt-get install -y ripgrep
cargo install --locked cargo-shear cargo-dupes
# the versions L0 runs on the Mac, so a new release can't change the verdict (cargo-shear 1.14.1 calls
# engine/cli's feature-only ignores redundant, which 1.14.0 needs; both ran red on main 11-13)
cargo install --locked [email protected] [email protected]
- name: layers
run: bash tools/layers.sh
- name: names
@@ -113,4 +115,19 @@ jobs:
- name: cargo check
run: cargo check --locked -p raea-cli --tests
- name: unit tests (the crates with no GPU or media device)
run: cargo test --locked -p raea-io-media -p raea-core-fonts -p raea-native
# debug info off: with it the test binaries of the app crates filled 27 GB of a runner's disk (#90)
env:
CARGO_PROFILE_TEST_DEBUG: "0"
run: cargo test --locked -p raea-runtime-plugins -p raea-io-media -p raea-core-fonts -p raea-native -p raea-core-brief -p raea-core-k -p raea-bundle -p raea-app-check -p raea-app-check-flash -p raea-io-ffmpeg -p raea-app-workspace -p raea-app-tools -p raea-app-targets
- name: Windows' and Linux's own (#169)
# what a Windows or Linux user meets that no other step ran: QuickJS's Intl (raea-runtime-jsengine's
# quickjs_formats_as_javascriptcore_does, on Linux), openh264 at --quality master (raea-io-soft), git found or
# fetched (raea-io-assets), and raea's Node core under the agent shell (raea-native's tests/node.rs: Node's names
# for the system, Windows' paths); tests/node.rs needs raea-native's modules feature and tests/quality.rs
# raea-io-soft's h264
env:
CARGO_PROFILE_TEST_DEBUG: "0"
run: |
cargo test --locked -p raea-native --features modules --test node
cargo test --locked -p raea-io-soft --features h264
cargo test --locked -p raea-runtime-jsengine -p raea-io-assets
+126 -18
View File
@@ -60,9 +60,17 @@ jobs:
- os: ubuntu-24.04
lib: libraea_bundle.so
extra: raea-perceive
runs-on: ${{ matrix.os }}
# a faster runner when the repo names one: vars RELEASE_MAC_RUNNER, RELEASE_LINUX_RUNNER, RELEASE_WINDOWS_RUNNER hold
# a JSON list of runs-on labels (Namespace's: a machine and a cache volume); else GitHub's
# own, a 3-core M1 with 7 GB on the Mac, where a cold build took 3 hours
runs-on: ${{ (matrix.os == 'macos-15' && vars.RELEASE_MAC_RUNNER && fromJSON(vars.RELEASE_MAC_RUNNER)) || (matrix.os == 'ubuntu-24.04' && vars.RELEASE_LINUX_RUNNER && fromJSON(vars.RELEASE_LINUX_RUNNER)) || matrix.os }}
# a cold thin-LTO build of raea-cli with the plugin catalog is the long part; GitHub's own limit is 6 hours
timeout-minutes: 340
env:
# the compile cache (the "Compile cache" step): an R2 bucket, read and written by every build
RELEASE_CACHE_ENDPOINT: ${{ secrets.RELEASE_CACHE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_CACHE_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_CACHE_SECRET }}
steps:
- uses: actions/checkout@v4
with:
@@ -95,7 +103,7 @@ jobs:
# rc3's build left 576 MB of macos-15's 320 GB free, and rc4's dSYMs (#88) ran it out linking raea-page-host
# (ld: write() failed, errno=28): the image's other Xcodes and the Android and .NET SDKs go first
- name: Room for the build
if: runner.os == 'macOS' && env.RAEA_PROMOTED_FROM == ''
if: runner.os == 'macOS' && env.RAEA_PROMOTED_FROM == '' && vars.RELEASE_MAC_RUNNER == ''
run: |
df -h . | tail -1
keep=$(cd "$(xcode-select -p)/../.." && pwd -P)
@@ -104,14 +112,48 @@ jobs:
wait
echo "kept $keep"
df -h . | tail -1
# The compile cache: sccache on an R2 bucket. GitHub's own cache can't carry a release build: a tag's run reads
# only its own tag's caches and the default branch's (so rc3's never reached rc4), and the repo's 10 GB are CI's.
# A bucket is read by every tag. A cold build fills it; a candidate after a small change compiles only the crates
# that changed and the ones above them. Linking (thin LTO) and build scripts' runs aren't cached. With no secrets
# (a fork) the build runs as before, uncached.
# the build folder and cargo's downloads kept between runs on the runner's cache volume (a Namespace runner,
# whose labels attach one), so a candidate rebuilds only what changed and links;
# sccache below still serves the workspace's own crates, which a fresh checkout's file times mark as changed
- name: The build folder, kept on the runner's cache volume
if: env.RAEA_PROMOTED_FROM == '' && startsWith(runner.name, 'nsc-')
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
${{ github.workspace }}/target
~/.cargo/registry
~/.cargo/git
- name: Compile cache (sccache)
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: mozilla-actions/[email protected]
# the script from this workflow's own commit: a dispatched run (a dry run that fills the cache) builds an older
# tag, whose tree may not have it
- name: The compile cache's script
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .workflow
sparse-checkout: tools/release/compile-cache.sh
sparse-checkout-cone-mode: false
- name: Use the compile cache
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
run: bash .workflow/tools/release/compile-cache.sh
- name: Build
if: env.RAEA_PROMOTED_FROM == ''
run: |
feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
cargo build --profile dist --locked -p raea-rune-host
cargo build --profile dist --locked -p raea-page-host --features window
if [ -n "${{ matrix.extra }}" ]; then cargo build --profile dist --locked -p ${{ matrix.extra }}; fi
t() { s=$SECONDS; "$@"; echo "::notice::${{ runner.os }} $(( (SECONDS - s) / 60 )) min: ${*:7}"; }
t cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
t cargo build --profile dist --locked -p raea-rune-host
t cargo build --profile dist --locked -p raea-page-host --features window
if [ -n "${{ matrix.extra }}" ]; then t cargo build --profile dist --locked -p ${{ matrix.extra }}; fi
if [ -n "${RUSTC_WRAPPER:-}" ]; then sccache --show-stats; fi
mkdir ship
cp target/dist/raea target/dist/${{ matrix.lib }} target/dist/raea-rune-host target/dist/raea-page-host ship/
if [ -n "${{ matrix.extra }}" ]; then cp target/dist/${{ matrix.extra }} ship/; fi
@@ -124,6 +166,8 @@ jobs:
run: bash tools/release/promoted-bins.sh "$RAEA_PROMOTED_FROM" ship
# the packing and its checks need only ship/, and macos-15's disk ran out packing rc1 with target/ kept
- name: Free the build's disk
# not the cache volume's build folder, which the next candidate starts from (a bind mount on Linux)
if: ${{ !startsWith(runner.name, 'nsc-') }}
run: |
df -h . | tail -1
rm -rf target
@@ -173,12 +217,18 @@ jobs:
retention-days: 3
compression-level: 0
# Windows in Git's bash on GitHub's runner, with the Visual Studio Build Tools in its image (their image terms; we
# accept no licence and download no Microsoft files). The C runtime is the DLL one (the VC++ redistributable): ort's
# prebuilt ONNX Runtime is built against it, so crt-static doesn't link (LNK2019 on __imp_ symbols, 10-29).
# Windows in Git's bash on GitHub's runner, with Visual Studio in its image. The C runtime is the DLL one: ONNX
# Runtime is built against it (crt-static didn't link: LNK2019 on __imp_ symbols, 10-29), and Microsoft's
# onnxruntime.dll imports it too, so the VC++ runtime's DLLs ship beside raea.exe from this image's Visual Studio
# (tools/release/win-bundle.sh), as Microsoft documents for app-local deployment.
windows:
runs-on: windows-latest
runs-on: ${{ (vars.RELEASE_WINDOWS_RUNNER && fromJSON(vars.RELEASE_WINDOWS_RUNNER)) || 'windows-latest' }}
timeout-minutes: 350
env:
# the compile cache, as build's
RELEASE_CACHE_ENDPOINT: ${{ secrets.RELEASE_CACHE_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.RELEASE_CACHE_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.RELEASE_CACHE_SECRET }}
defaults:
run:
shell: bash
@@ -195,6 +245,21 @@ jobs:
- name: Toolchain (rust-toolchain.toml's pin)
if: env.RAEA_PROMOTED_FROM == ''
run: rustup show active-toolchain || rustup toolchain install
# nasm, which rav1d's and openh264-sys2's build scripts run: GitHub's Windows image has 2.16, Namespace's has none
# (rc3's dry run there stopped at "Unable to run nasm: program not found"). Always NASM's own 2.16.03 zip, never
# Chocolatey's: rc4 took Chocolatey's newest, and raea.exe failed to link 135 of openh264's SIMD routines
# (WelsSampleSad16x8_sse2 and the rest unresolved) though openh264's C++ was built to call them
- name: nasm
if: env.RAEA_PROMOTED_FROM == ''
run: |
v=2.16.03
curl -fsSL --retry 3 -o "$RUNNER_TEMP/nasm.zip" "https://www.nasm.us/pub/nasm/releasebuilds/$v/win64/nasm-$v-win64.zip"
unzip -q "$RUNNER_TEMP/nasm.zip" -d "$RUNNER_TEMP"
# Git Bash on Windows has no /dev/stderr (rc5 stopped here): capture, print, then match
out=$("$RUNNER_TEMP/nasm-$v/nasm.exe" -v)
echo "$out"
case $out in *"version $v"*) ;; *) echo "::error::expected NASM $v, got: $out"; exit 1 ;; esac
echo "$RUNNER_TEMP/nasm-$v" >> "$GITHUB_PATH"
# jq for Windows ends -r lines with CRLF, so tools/bevy-plugins.sh read "ahoy\r" and lost its Bevy 0.20 block
# (feature `ahoy` not found, 11-04); -b writes LF
- name: jq that writes LF
@@ -219,25 +284,66 @@ jobs:
done < <(tr -d '\r' < tools/release/models.tsv)
# the app targets' hosts a cargo call each: with raea-cli's crates in one call taffy's features unify and
# rune-taffy doesn't build; raea-perceive (`raea song`'s map, #43) a call of its own too
- name: The build folder, kept on the runner's cache volume (as build's)
if: env.RAEA_PROMOTED_FROM == '' && startsWith(runner.name, 'nsc-')
uses: namespacelabs/nscloud-cache-action@v1
with:
path: |
${{ github.workspace }}/target
~/.cargo/registry
~/.cargo/git
- name: Compile cache (sccache, as build's)
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: mozilla-actions/[email protected]
# the script from this workflow's own commit: a dispatched run (a dry run that fills the cache) builds an older
# tag, whose tree may not have it
- name: The compile cache's script
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
path: .workflow
sparse-checkout: tools/release/compile-cache.sh
sparse-checkout-cone-mode: false
- name: Use the compile cache
if: env.RAEA_PROMOTED_FROM == '' && env.AWS_ACCESS_KEY_ID != ''
run: bash .workflow/tools/release/compile-cache.sh
# openh264-sys2 is built here every time, never taken whole from the cache volume's target/: a build of it whose
# assembly didn't make it into the rlib (0.1.3-rc4's Chocolatey nasm) stays fresh to cargo on a restored target/,
# and every link after it fails on the same 135 SIMD routines (v0.1.4-rc1, 11-14: only raea-cli compiled, then
# WaverageChromaFilter8_sse2 and the rest unresolved). Its C++ comes back from sccache; the assembly is seconds
- name: openh264 built here, not restored
if: env.RAEA_PROMOTED_FROM == ''
run: rm -rf target/dist/build/openh264-sys2-* target/dist/deps/libopenh264_sys2-* target/dist/.fingerprint/openh264-sys2-*
- name: Build
if: env.RAEA_PROMOTED_FROM == ''
run: |
feat=$(bash tools/bevy-plugins.sh features sdk/raea/bench/bevy-plugins)
cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
cargo build --profile dist --locked -p raea-rune-host
cargo build --profile dist --locked -p raea-page-host --features window
cargo build --profile dist --locked -p raea-perceive
t() { s=$SECONDS; "$@"; echo "::notice::Windows $(( (SECONDS - s) / 60 )) min: ${*:7}"; }
t cargo build --profile dist --locked -p raea-cli --bin raea --no-default-features --features "$feat"
t cargo build --profile dist --locked -p raea-rune-host
t cargo build --profile dist --locked -p raea-page-host --features window
t cargo build --profile dist --locked -p raea-perceive
if [ -n "${RUSTC_WRAPPER:-}" ]; then sccache --show-stats; fi
- name: The candidate's binaries (tools/release/promoted-bins.sh)
if: env.RAEA_PROMOTED_FROM != ''
env:
GH_TOKEN: ${{ github.token }}
run: bash tools/release/promoted-bins.sh "$RAEA_PROMOTED_FROM" target/dist
# which DLLs raea needs from the machine (the CRT's come from the VC++ redistributable)
# ONNX Runtime as Microsoft builds it (MIT), beside raea.exe, which loads it when a model first runs (#110): the
# static runtime ort links by default is built for AVX2 and stopped raea.exe at start on CPUs without it
- name: ONNX Runtime (tools/release/onnxruntime.sh)
run: bash tools/release/onnxruntime.sh target/dist
# and what a PC with nothing installed and no downloads needs beside raea.exe: the VC++ runtime (from this
# runner's Visual Studio), FFmpeg (raea's LGPL build) and uv, each with its licence
- name: The Windows bundle (tools/release/win-bundle.sh)
run: bash tools/release/win-bundle.sh target/dist
# which DLLs raea needs from the machine (the CRT's now ship beside it: win-bundle.sh)
- name: What raea.exe imports
run: |
{ echo '### what raea.exe, raea_bundle.dll and raea-perceive.exe import'; echo '```'
{ echo '### what raea.exe, raea_bundle.dll, raea-perceive.exe and onnxruntime.dll import'; echo '```'
dumpbin=$(ls "/c/Program Files/Microsoft Visual Studio"/*/*/VC/Tools/MSVC/*/bin/HostX64/x64/dumpbin.exe | head -1)
"$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
"$dumpbin" -nologo -dependents target/dist/raea.exe target/dist/raea_bundle.dll target/dist/raea-perceive.exe target/dist/onnxruntime.dll target/dist/ffmpeg.exe | grep -iE '\.dll$|Dump of' | sed 's/^ *//'
echo '```'; } | tee -a "$GITHUB_STEP_SUMMARY" || true
# release.sh's checks render on Mesa's lavapipe (software Vulkan, MIT; on the runner only, never in the zip): the
# runner has no GPU, and WARP, Windows' own software DX12, crashes compiling one of Bevy's compute shaders there
@@ -318,6 +424,7 @@ jobs:
lfs: false
sparse-checkout: |
tools/release-check.sh
tools/release/win-bundle.files
tools/release/lavapipe.sh
sparse-checkout-cone-mode: false
path: check
@@ -331,7 +438,8 @@ jobs:
run: |
set -e
v=${TAG#v}
cp check/tools/release-check.sh "$RUNNER_TEMP/"
# and the list of what bin\ must carry, where release-check.sh looks for it (release/ beside it)
cp check/tools/release-check.sh "$RUNNER_TEMP/" && mkdir -p "$RUNNER_TEMP/release" && cp check/tools/release/win-bundle.files "$RUNNER_TEMP/release/"
rm -rf check
cd "$RUNNER_TEMP/zip"
sha256sum -c "raea-$v-windows-x86_64.zip.sha256"
+49
View File
@@ -0,0 +1,49 @@
# FFmpeg for Windows as raea ships it (tools/release/ffmpeg-win.sh): built on Linux with mingw-w64 and published once
# as the prerelease tools-ffmpeg-<version>-lgpl, with FFmpeg's source tarball, its signature and the script, which are
# its complete source (LGPL 2.1 or later). io/assets/src/setup.rs pins the zip by its
# sha256, so a published zip is never replaced: a run whose release already holds one only builds it and says
# whether its own sha256 differs.
name: tools-ffmpeg
on:
workflow_dispatch:
push:
paths: [tools/release/ffmpeg-win.sh, .github/workflows/tools-ffmpeg.yml]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
lfs: false
# the x86_64 cross compiler only, and non-interactive: an install that asks (needrestart, debconf) waits forever.
# The runner's own EC2 mirror has trickled (35 MB in 11 minutes, 11-19), so apt reads Ubuntu's archive first
# and Azure's mirror after it, gives up on a stalled request and retries.
- name: mingw-w64
env:
DEBIAN_FRONTEND: noninteractive
NEEDRESTART_MODE: a
run: |
printf 'http://archive.ubuntu.com/ubuntu/\tpriority:1\nhttp://azure.archive.ubuntu.com/ubuntu/\tpriority:2\n' | sudo tee /etc/apt/apt-mirrors.txt
o="-o Acquire::Retries=5 -o Acquire::http::Timeout=30"
sudo -E apt-get $o update -q
sudo -E apt-get $o install -y -q --no-install-recommends gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 libz-mingw-w64-dev nasm make pkg-config xz-utils zip
timeout-minutes: 25
- name: build
run: bash tools/release/ffmpeg-win.sh out
- name: publish (once)
env:
GH_TOKEN: ${{ github.token }}
run: |
v=$(sed -n 's/^v=//p' tools/release/ffmpeg-win.sh)
tag=tools-ffmpeg-$v-lgpl; zip=ffmpeg-$v-lgpl-win64.zip
if gh release view "$tag" --json assets -q '.assets[].name' 2>/dev/null | grep -qx "$zip"; then
echo "$tag already has $zip (never replaced); this run's: $(cat out/$zip.sha256)"; exit 0
fi
curl -fsSL -o "out/ffmpeg-$v.tar.xz.asc" "https://ffmpeg.org/releases/ffmpeg-$v.tar.xz.asc"
cp tools/release/ffmpeg-win.sh out/
gh release view "$tag" >/dev/null 2>&1 || gh release create "$tag" --prerelease --title "FFmpeg $v for Windows (LGPL), as raea ships it" \
--notes "FFmpeg $v cross-built for Windows x64 by tools/release/ffmpeg-win.sh: static, FFmpeg's own code, zlib and libvpx's decoders (BSD), LGPL 2.1 or later; its H.264 encoder is Windows' own (Media Foundation). Its complete source is ffmpeg-$v.tar.xz (with FFmpeg's signature), the libvpx tarball and ffmpeg-win.sh, attached here. raea ships it beside raea.exe on Windows and fetches it where it isn't."
gh release upload "$tag" "out/$zip" "out/$zip.sha256" "out/ffmpeg-$v.tar.xz" "out/ffmpeg-$v.tar.xz.asc" out/libvpx-*.tar.gz out/ffmpeg-win.sh
+34
View File
@@ -0,0 +1,34 @@
# The complete corresponding source of the Git for Windows the Windows app ships (tools/release/git-sources.sh),
# published once as the prerelease tools-git-<tag>-sources, which the app's git\SOURCE.txt names: GPLv2 section 3
# asks whoever distributes Git to make it available, and dugite-native's own repository isn't all of it (Git for
# Windows' MSYS2 runtime, bash, curl and the rest are built from their own source packages). A run whose release
# already holds the archive changes nothing.
name: tools-git-sources
on:
workflow_dispatch:
push:
paths: [tools/release/git-sources.sh, .github/workflows/tools-git-sources.yml]
permissions:
contents: write
jobs:
sources:
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
lfs: false
- name: publish (once)
run: |
t=$(sed -n 's/^tag=//p' tools/release/git-sources.sh)
tag=tools-git-$t-sources; tar=git-for-windows-$t-sources.tar
if gh release view "$tag" --json assets -q '.assets[].name' 2>/dev/null | grep -qx "$tar"; then
echo "$tag already has $tar"; exit 0
fi
bash tools/release/git-sources.sh out
cp tools/release/git-sources.sh out/
gh release view "$tag" >/dev/null 2>&1 || gh release create "$tag" --prerelease --title "Git for Windows ($t) sources, as raea's Windows app ships it" \
--notes "The complete corresponding source of the Git for Windows (dugite-native $t) that raea's Windows app ships in its git folder: each package of its etc/package-versions.txt as the source package it was built from, from Git for Windows' pacman repository or MSYS2's source mirror (SOURCES.tsv inside says which), collected by git-sources.sh, attached here. raea runs Git as a separate program."
gh release upload "$tag" "out/$tar" "out/$tar.sha256" out/git-sources.sh
+7 -1
View File
@@ -5,7 +5,10 @@ target/
meaning/bench/temporal/out/*.npz
__pycache__/
# every package's installed dependencies, wherever bun or npm puts them
node_modules/
# a package folder, or a link to one (sdk/blender and sdk/godot link sdk/raea's)
node_modules
# TypeScript's incremental build record
*.tsbuildinfo
engine/media/golden/
# tools/release.sh writes releases here
@@ -101,5 +104,8 @@ sdk/raea/.scratch-*/
# the Tripo CLI writes its last task id into the directory it runs in
.tripo/
# examples/materials/wear: its house is made by make-house.ts (media/) and baked at render time (assets/wear/)
/examples/materials/wear/media/
/examples/materials/wear/assets/
# tools/bevy-parity links each example folder's assets/ to Bevy's checkout at run time (an absolute, per-machine path)
/sdk/raea/bench/bevy-parity/**/assets
Generated
+710 -172
View File
File diff suppressed because it is too large. Load diff
+44 -1
View File
@@ -39,6 +39,7 @@ members = [
"engine/bundle",
"engine/cli",
"engine/neural",
"engine/light",
"engine/modules",
"engine/native",
"io/npm",
@@ -53,6 +54,7 @@ members = [
"engine/rune/js",
"engine/rune/layer",
"engine/rune/slots",
"engine/page/sound",
"engine/page/stage",
"engine/page/window",
"io/trace",
@@ -62,6 +64,7 @@ members = [
"io/gen",
"io/gen-comfy",
"io/gen-core",
"io/gen-fit",
"io/home",
"io/soft",
"io/av1",
@@ -77,10 +80,18 @@ members = [
"systems/k",
"systems/tone",
"systems/mix",
"systems/mix/level",
"systems/ml",
"systems/mlx",
"systems/kimodo",
"systems/speech",
"systems/layout",
"systems/vision",
"systems/columns",
"systems/index",
"systems/fingerprint",
"systems/fingerprint-use",
"systems/fingerprint-things",
"systems/song",
"systems/perceive",
"systems/footage",
@@ -92,12 +103,21 @@ members = [
"systems/canvas",
"systems/tweak",
"systems/filters",
"systems/wear",
"systems/weathering",
"systems/runoff",
"systems/touch",
"systems/exposure",
"systems/damage",
"systems/glb",
"systems/procmat",
"systems/page",
"systems/page-net",
"systems/page-ops",
"systems/frame",
"systems/shots",
"systems/hold",
"systems/body",
"systems/grab",
"systems/layers",
"systems/splat",
"systems/sprite",
@@ -105,9 +125,14 @@ members = [
"systems/text3d",
"runtime/gpuframe",
"runtime/scene3d",
"systems/copies",
"systems/screen",
"systems/matchmove",
"systems/grid",
"systems/lod",
"systems/foliage",
"systems/viewbox",
"systems/rendermap",
"systems/meshseq",
"systems/environment",
"systems/look",
@@ -128,6 +153,7 @@ members = [
"runtime/view",
"runtime/world",
"runtime/encode",
"runtime/segments",
"runtime/plugins",
"runtime/input",
"tools/perceive",
@@ -136,6 +162,9 @@ members = [
"engine/seedling",
"engine/web",
"runtime/react",
"runtime/track",
"runtime/pagestore",
"runtime/cssurls",
"bench/bridge",
"bench/bevy-parity",
"bench/bridge/swatch",
@@ -147,22 +176,32 @@ members = [
"engine/shape-web",
"runtime/calls",
"runtime/shots",
"runtime/wear",
"runtime/canvas",
"runtime/export",
"runtime/live",
"runtime/page",
"runtime/appscreen",
"runtime/sound",
"runtime/look",
"runtime/scene",
"runtime/scene2d",
"runtime/shared",
"apps/check",
"apps/check/cause",
"apps/check/flash",
"apps/check/inbox",
"apps/check/read",
"apps/check/text",
"apps/direction",
"apps/notes",
"apps/fingerprint",
"apps/sound",
"apps/workspace",
"apps/workspace/registry",
"apps/ci",
"apps/tools",
"apps/motion",
"apps/engines",
"apps/interchange",
"apps/judge",
@@ -171,8 +210,10 @@ members = [
"apps/targets",
"apps/game",
"apps/capcut",
"apps/layers",
"apps/play",
"tools/sdk-props",
"tools/hands-audit",
]
exclude = [
"engine/sandbox/rtools",
@@ -279,6 +320,8 @@ split-debuginfo = "packed"
[patch.crates-io]
# the MP4 muxer, vendored
muxide = { path = "vendor/muxide" }
# usvg 0.48.1 spacing a chunk's last letter as Chrome does (changes marked "raea:", docs/layout-reads.feature LR10)
usvg = { path = "vendor/usvg" }
# bevy_seedling 0.8.0 without its cpal 0.18 paths, ported to Bevy 0.20 (changes marked "raea:")
bevy_seedling = { path = "vendor/bevy_seedling" }
# bevy_text 0.20.0 on parley 0.12, so one parley builds (changes marked "raea:", docs/bevy-upgrade.md)
-37
View File
@@ -1,37 +0,0 @@
ctt 0.5.0 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0 OR Zlib, by The ctt developers.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
Copyright (c) The ctt developers
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.
---- Zlib ----
Copyright (c) The ctt developers
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter
it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If
you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
software.
3. This notice may not be removed or altered from any source distribution.
@@ -1,178 +0,0 @@
Copyright (C) 2018-2021 Binomial LLC
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
@@ -1,20 +0,0 @@
ctt-bc7enc-rdo-prebuilt 0.5.0 ships no licence file of its own. Its Cargo.toml declares (MIT OR Apache-2.0) AND Apache-2.0, by The ctt developers, Rich Geldreich <[email protected]>.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
Copyright (c) The ctt developers, Rich Geldreich <[email protected]>
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,19 +0,0 @@
Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
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,26 +0,0 @@
etcpak, an extremely fast ETC compression utility (https://github.com/wolfpld/etcpak)
Copyright (c) 2013-2026, Bartosz Taudul <wolf@nereid.pl>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -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
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2019 Graham Wihlidal
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,19 +0,0 @@
Copyright 2017 Intel Corporation
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,20 +0,0 @@
ctt-intel-texture-compressor-prebuilt 0.5.0 ships no licence file of its own. Its Cargo.toml declares (MIT OR Apache-2.0) AND MIT, by The ctt developers, Traverse Research <[email protected]>, Graham Wihlidal <[email protected]>, Intel Corporation.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
Copyright (c) The ctt developers, Traverse Research <[email protected]>, Graham Wihlidal <[email protected]>, Intel Corporation
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.
-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
@@ -1,201 +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
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright (c) 2021 Kirill Kuzminykh
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2021 Kirill Kuzminykh
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,201 +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
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Andrew Straw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,25 +0,0 @@
Copyright (c) 2020 Andrew D. Straw
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,201 +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
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Andrew Straw
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -1,25 +0,0 @@
Copyright (c) 2020 Andrew D. Straw
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,37 +0,0 @@
ispc-build-utils 0.5.0 ships no licence file of its own. Its Cargo.toml declares MIT OR Apache-2.0 OR Zlib, by The ctt developers.
---- Apache-2.0: the text is LICENSES/texts/Apache-2.0.txt ----
---- MIT ----
Copyright (c) The ctt developers
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.
---- Zlib ----
Copyright (c) The ctt developers
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter
it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If
you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not
required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original
software.
3. This notice may not be removed or altered from any source distribution.
-28
View File
@@ -1,28 +0,0 @@
BSD 3-Clause License
Copyright (c) 2026, Alexandre Bury
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-28
View File
@@ -1,28 +0,0 @@
BSD 3-Clause License
Copyright (c) 2026, Alexandre Bury
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,28 +0,0 @@
BSD 3-Clause License
Copyright (c) 2026, Alexandre Bury
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
The auto-generated bindings are under the 3-clause BSD license:
BSD License
For Zstandard software
Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook, nor Meta, nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+14 -18
View File
@@ -20,8 +20,20 @@ animato (MIT OR Apache-2.0), usvg and resvg (Apache-2.0 OR MIT), mediabunny (MPL
The Windows build (docs/ports.feature PT20) adds: junction 1.4.2 (MIT, node_modules' links in io/npm) and windows-sys
0.61.2 (Microsoft, MIT OR Apache-2.0, in io/trace); every build has dunce 1.0.5 (CC0-1.0 OR MIT-0 OR Apache-2.0, plain
paths for Windows in runtime/bundle). It ships none of Microsoft's C runtime or SDK files: the runtime comes from the
Microsoft Visual C++ Redistributable, installed on the machine.
paths for Windows in runtime/bundle). Its bin\ also carries, each with its licence beside it (tools/release/win-bundle.sh):
Microsoft's Visual C++ runtime (vcruntime140.dll, vcruntime140_1.dll, msvcp140.dll, msvcp140_1.dll), redistributed
under Microsoft's Visual Studio licence terms; ONNX Runtime's onnxruntime.dll (Microsoft, MIT);
FFmpeg 9.0.2 (ffmpeg.exe, ffprobe.exe; LGPL-2.1-or-later), built from FFmpeg's release with FFmpeg's own code, zlib
and libvpx 1.17.0's decoders (BSD-3-Clause with the WebM project's patent grant: libvpx-LICENSE.txt,
libvpx-PATENTS.txt) by tools/release/ffmpeg-win.sh, its H.264 encoder Windows' own (Media Foundation), its source
published as the release tools-ffmpeg-9.0.2-lgpl;
uv (uv.exe; Astral, MIT OR Apache-2.0).
The Windows app adds Git for Windows with Git LFS (dugite-native; GPLv2 and its parts' licences, in git\), which raea
runs as a separate program; its complete corresponding source is published as the release tools-git-<tag>-sources.
raea.exe, on a PC with no Git, fetches the same build once into its tools cache (io/assets git()).
The Windows and Linux builds' JavaScript engine, QuickJS (rquickjs, MIT), carries FormatJS's Intl polyfills (MIT,
Copyright FormatJS) and the Unicode CLDR locale data they're made with (Unicode-3.0), packed in
runtime/jsengine/js/intl.pack; both licences are in runtime/jsengine/js/intl/LICENSE-FormatJS.md and in the pack.
The native target (engine/rune, docs/targets.feature) builds on Rune (https://github.com/anomalyco/rune, Copyright
2026 Anomaly, MIT; LICENSES/rune-0.0.1/repository-LICENSE): rune, rune-kit and their crates, by a pinned rev.
@@ -155,14 +167,6 @@ LICENSES/<crate>-<version>/.
cssparser 0.37.0: MPL-2.0
csv-core 0.1.13: Unlicense/MIT
csv 1.4.0: Unlicense/MIT
ctt-astcenc 0.5.0: (MIT OR Apache-2.0 OR Zlib) AND Apache-2.0
ctt-bc7enc-rdo-prebuilt 0.5.0: (MIT OR Apache-2.0) AND Apache-2.0
ctt-bc7enc-rdo 0.5.0: (MIT OR Apache-2.0 OR Zlib) AND Apache-2.0
ctt-compressonator 0.5.0: (MIT OR Apache-2.0 OR Zlib) AND MIT
ctt-etcpak 0.5.0: (MIT OR Apache-2.0 OR Zlib) AND BSD-3-Clause
ctt-intel-texture-compressor-prebuilt 0.5.0: (MIT OR Apache-2.0) AND MIT
ctt-intel-texture-compressor 0.5.0: (MIT OR Apache-2.0) AND MIT
ctt 0.5.0: MIT OR Apache-2.0 OR Zlib
dashmap 6.2.1: MIT
default-struct-builder 0.5.1: MIT OR Apache-2.0
deluxe-core 0.5.0: MIT
@@ -175,7 +179,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
@@ -189,7 +192,6 @@ LICENSES/<crate>-<version>/.
enumflags2 0.7.12: MIT OR Apache-2.0
epaint_default_fonts 0.36.2: (MIT OR Apache-2.0) AND OFL-1.1 AND Ubuntu-font-1.0
epaint 0.36.2: MIT OR Apache-2.0
fast_image_resize 6.1.0: MIT OR Apache-2.0
fastbloom 0.17.0: MIT OR Apache-2.0
fastnoise-lite 1.1.1: MIT
fid-rs 0.2.0: MIT OR Apache-2.0
@@ -220,14 +222,11 @@ LICENSES/<crate>-<version>/.
i_overlay 4.5.2: MIT OR Apache-2.0
i_shape 1.18.0: MIT
i_tree 0.18.0: MIT
iana-time-zone-haiku 0.1.2: MIT OR Apache-2.0
iana-time-zone 0.1.65: MIT OR Apache-2.0
ilattice 0.1.0: MIT OR Apache-2.0
imagesize 0.13.0: MIT
inout 0.1.4: MIT OR Apache-2.0
interpolation 0.3.0: MIT
is-terminal 0.4.17: MIT
ispc-build-utils 0.5.0: MIT OR Apache-2.0 OR Zlib
itertools 0.10.5: MIT/Apache-2.0
iyes_progress 0.18.0: MIT OR Apache-2.0
jzon 0.12.5: MIT/Apache-2.0
@@ -429,9 +428,6 @@ LICENSES/<crate>-<version>/.
zbus 6.2.1: MIT
zcheapstr 1.1.0: MIT
zruntime 0.2.2: MIT
zstd-safe 7.4.0: BSD-3-Clause
zstd-sys 2.1.2+zstd.1.5.7: BSD-3-Clause
zstd 0.13.4: BSD-3-Clause
zvariant_derive 5.15.0: MIT
zvariant_utils 4.2.0: MIT
zvariant 5.15.0: MIT
+49 -9
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
@@ -58,8 +86,8 @@ On Windows 10 or 11, in PowerShell:
irm https://raea.io/install.ps1 | iex
```
It does the same under `~\.raea` and adds raea to your PATH. raea needs the Microsoft Visual C++ Redistributable
(x64), which most machines already have, and a DirectX 12 or Vulkan GPU driver.
It does the same under `~\.raea` and adds raea to your PATH. raea needs a DirectX 12 or Vulkan GPU driver; what
else it needs (the Visual C++ runtime, FFmpeg and uv) is in its `bin\` folder.
## Hello
@@ -92,20 +120,32 @@ 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
[`skills/`](skills): `raea` teaches an agent to write, render and check raea compositions, 3D and games
included. The installer adds it to `~/.claude/skills`, and `raea skills install --agent NAME` to other agents.
- **Claude Code plugin.** `/plugin marketplace add shinyobjectz/raea`, then `/plugin install raea@raea`.
- **Claude plugin.** The raea skill and two hooks (raea's quick check after a composition is saved, and media shown in
the raea app). In Claude Code: `/plugin install raea --marketplace shinyobjectz/raea-skills`. It's the `skills/`
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
+4 -4
View File
@@ -4,15 +4,15 @@ version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
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)"
description = "`raea export capcut`: a composition as a CapCut draft ready in its timeline, written from its layers (raea-app-layers: footage and sounds as clips of their files, the graphics, captions and what is under the footage as movies; docs/capcut.feature, docs/layers.feature LA4b)"
[dependencies]
dunce = "1"
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-io-capcut = { path = "../../io/capcut" }
raea-io-alpha = { path = "../../io/alpha" }
raea-io-media = { path = "../../io/media", default-features = false, features = ["soft-audio", "apple"] }
raea-io-home = { path = "../../io/home" }
# the renderer's own lookup of a staticFile path (/media/x), so the export finds the files the render drew
raea-core-scene = { path = "../../core/scene" }
serde_json = "1"
# the composition exported in layers (layers.json), which the draft is written from (docs/layers.feature LA4b)
raea-app-layers = { path = "../layers" }
image = { version = "0.25", default-features = false, features = ["jpeg"] }
+82
View File
@@ -0,0 +1,82 @@
//! layers.json as a CapCut timeline (docs/layers.feature LA4b): its tracks bottom first, as CapCut lists them (the
//! first video track is CapCut's main track); footage placed in CapCut's terms (plan::place); a footage clip's own
//! sound, which layers.json links to it, as the clip's volume (CapCut's Extract audio separates it); every layer's
//! movie a full-canvas clip. Pure: the export (lib.rs) makes the layers and writes the draft around it.
use std::path::Path;
use raea_app_layers::model::{FileKind, Layer, Layers};
use raea_io_capcut::{Clip, Kind, Media, MediaKind, Place, Timeline, Track};
use crate::plan;
/// The track names CapCut shows for raea's layers (the overlay's, as the export has always named it).
pub fn track_name(layer: Layer, name: &str) -> String {
match layer {
Layer::Captions => format!("raea {name}"),
Layer::Graphics => name.replacen("graphics", "raea overlay", 1),
Layer::Under | Layer::Backing => format!("raea {name}"),
Layer::Footage | Layer::Sound => name.to_string(),
}
}
/// The timeline, and what it can't carry. `dir` is where layers.json is: its movies' paths are relative to it.
pub fn timeline(l: &Layers, dir: &Path) -> (Timeline, Vec<String>) {
let mut notes = Vec::new();
let media: Vec<Media> = l
.files
.iter()
.map(|f| {
let p = Path::new(&f.path);
Media { path: if p.is_absolute() { p.to_path_buf() } else { dir.join(p) }, kind: if f.kind == FileKind::Audio { MediaKind::Audio } else { MediaKind::Video }, seconds: f.seconds, width: f.width, height: f.height, has_audio: f.has_audio }
})
.collect();
let all = || l.tracks.iter().flat_map(|t| t.clips.iter());
// the sound clips a footage clip carries as its own (their ids)
let carried: Vec<&str> = all().filter(|c| c.r#box.is_some()).filter_map(|c| c.link.as_deref()).collect();
let mut video: Vec<Track> = Vec::new();
let mut audio: Vec<Track> = Vec::new();
for t in &l.tracks {
let clips: Vec<Clip> = t
.clips
.iter()
.filter(|c| !carried.contains(&c.id.as_str()))
.map(|c| {
let base = Clip { media: c.file, start: c.start, frames: c.frames, source_in: c.source_in, speed: c.speed.max(0.01), ..Clip::default() };
match t.layer {
Layer::Sound => Clip { volume: 10f64.powf(c.gain_db / 20.0), fade_in: c.fade_in, fade_out: c.fade_out, ..base },
Layer::Footage => {
let m = &media[c.file];
// (a picture stretched to its box is noted by the layers export already, for every editor)
let (media, canvas) = (((m.width as f64).max(1.0), (m.height as f64).max(1.0)), (l.width as f64, l.height as f64));
let bx = c.r#box.unwrap_or([0.0, 0.0, canvas.0, canvas.1]);
let fit = c.fit.as_deref().unwrap_or("fill");
let (picture, _) = raea_app_layers::plan::picture(&bx, &c.clip, fit, &c.position, media, canvas);
let place = plan::place(&picture, media, canvas, c.opacity);
let (keys, cut_changes) = plan::keys(c, fit, picture.kept, media, canvas);
if cut_changes {
let name = Path::new(&l.files[c.file].path).file_name().map_or_else(String::new, |n| n.to_string_lossy().into_owned());
notes.push(format!("{name} (frames {}-{}): what of it is cut changes over its run, and CapCut's crop holds: cut as its first frame shows it throughout, its moves and fades keyed", c.start, c.end() - 1));
}
// its own sound at its gain, or silent: the composition doesn't play its sound there
let own = c.link.as_deref().and_then(|id| all().find(|a| a.id == id));
Clip { volume: own.map_or(0.0, |a| 10f64.powf(a.gain_db / 20.0)), place, keys, ..base }
}
Layer::Graphics | Layer::Captions | Layer::Under | Layer::Backing => Clip { volume: 0.0, place: Place::centred(l.width, l.height), ..base },
}
})
.collect();
if clips.is_empty() {
continue;
}
let track = Track { kind: if t.layer == Layer::Sound { Kind::Audio } else { Kind::Video }, name: track_name(t.layer, &t.name), clips };
if t.layer == Layer::Sound { audio.push(track) } else { video.push(track) }
}
// bottom first; CapCut's main track (the first) keeps no name of its own when it's footage
video.reverse();
if let Some(main) = video.first_mut().filter(|t| t.name.starts_with("footage")) {
main.name.clear();
}
video.extend(audio);
(Timeline { width: l.width, height: l.height, fps: l.fps, media, tracks: video }, notes)
}
+35 -192
View File
@@ -1,26 +1,24 @@
//! `raea export capcut EDIT.tsx` (docs/capcut.feature CC2): the composition as a CapCut draft ready in its timeline.
//! And `raea render ... -o OUT.mov --alpha` (CC1), the transparent movie its overlays are, for any editor.
//! Three renders of it: as it is, with its manifest (the reference render, and what shows when: each file's runs,
//! each sound clip); with its footage and the backgrounds holding it hidden, transparent (what raea draws over the
//! footage); and with only those backgrounds (what it draws under). The footage and sounds become clips of their own
//! files at their trims and gains; what raea draws becomes clips of transparent movies (raea-io-alpha), cut where the
//! drawing comes and goes, the one under the footage left out when it's black; raea-io-capcut writes the draft.
//! `raea export capcut EDIT.tsx` (docs/capcut.feature CC2, docs/layers.feature LA4b): the composition as a CapCut draft
//! ready in its timeline. And `raea render ... -o OUT.mov --alpha` (CC1), the transparent movie its overlays are, for
//! any editor. The composition is exported in layers first (raea-app-layers: the reference render and its manifest,
//! the graphics, captions and what's under the footage, layers.json); layers.json is then written as CapCut's tracks
//! (from_layers.rs) and raea-io-capcut writes the draft, with the reference render copied into its folder.
mod from_layers;
mod media;
pub mod plan;
#[cfg(test)]
mod tests;
use std::path::{Path, PathBuf};
use std::process::Command;
use raea_io_capcut::{Clip, Kind, Media, MediaKind, Place, Timeline, Track};
use raea_app_layers::many;
use raea_io_capcut::Kind;
use raea_runtime_bundle::flag;
use serde_json::Value;
pub type R<T> = Result<T, String>;
pub const USAGE: &str = "raea export capcut EDIT.tsx [--composition ID] [-o DIR] [--name NAME] [--alpha-codec prores|hevc|rle|png] [--no-register] (the composition as a CapCut draft ready in its timeline: its footage and sounds as clips of their own files at their trims and gains, everything raea draws as transparent overlay clips above them; into CapCut's projects, entered in its project list while CapCut is closed, or a draft folder in DIR; the reference render and the overlay movie kept in out/capcut/NAME)";
pub const USAGE: &str = "raea export capcut EDIT.tsx [--composition ID] [-o DIR] [--name NAME] [--alpha-codec prores|hevc|rle|png] [--no-register] (the composition as a CapCut draft ready in its timeline: its footage and sounds as clips of their own files at their trims and gains, everything raea draws as transparent overlay clips above them; the captions on a track of their own above it; into CapCut's projects, entered in its project list while CapCut is closed, or a draft folder in DIR; the reference render copied into the draft's folder, and it and the layers kept in out/capcut/NAME)";
/// `export capcut ...` (or what export takes), and `render ... -o OUT.mov --alpha` through `render`, the CLI's own;
/// None for anything else.
@@ -28,7 +26,7 @@ pub fn cli(args: &[String], render: impl Fn(&[String]) -> R<String>) -> Option<R
match args.first().map(String::as_str) {
Some("export") => Some(match args.get(1).map(String::as_str) {
Some("capcut") => export(&args[2..]),
other => Err(format!("raea export takes where to export to{}: capcut\nusage: {USAGE}", other.map_or(String::new(), |o| format!(", not {o:?}")))),
other => Err(format!("raea export takes where to export to{}: capcut, layers or xml\nusage: {USAGE}\n {}\n {}", other.map_or(String::new(), |o| format!(", not {o:?}")), raea_app_layers::USAGE, raea_app_layers::USAGE_XML)),
}),
Some("render") => movie(args, render),
_ => None,
@@ -46,27 +44,11 @@ fn movie(args: &[String], render: impl Fn(&[String]) -> R<String>) -> Option<R<S
Some(raea_io_alpha::render_movie(args, Path::new(&out), flag(args, "--alpha-codec").as_deref(), flag(args, "--manifest").map(PathBuf::from), quality, render))
}
/// `raea render ARGS` by this same program, with `env` set; its output said through, its failure the export's.
fn render(args: &[String], env: &[(&str, &str)]) -> R<()> {
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
let mut c = Command::new(exe);
c.arg("render").args(args);
for (k, v) in env {
c.env(k, v);
}
let out = c.output().map_err(|e| e.to_string())?;
if !out.status.success() {
let said = format!("{}{}", String::from_utf8_lossy(&out.stdout), String::from_utf8_lossy(&out.stderr));
return Err(format!("the render failed:\n{}", said.trim()));
}
Ok(())
}
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 codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?;
let (root, in_store) = match flag(args, "-o") {
Some(o) => (PathBuf::from(o), false),
None => {
@@ -87,102 +69,27 @@ fn export(args: &[String]) -> R<String> {
name = (2..).map(|k| format!("{base} {k}")).find(|n| !root.join(n).exists()).unwrap();
}
let work = dir.join("out/capcut").join(&name);
std::fs::create_dir_all(&work).map_err(|e| format!("{}: {e}", work.display()))?;
let comp: Vec<String> = flag(args, "--composition").map(|c| vec!["--composition".into(), c]).unwrap_or_default();
let s = |p: &Path| p.display().to_string();
// 1. as it is: the reference render and its manifest
let (reference, manifest_path) = (work.join("reference.mp4"), work.join("render.json"));
render(&[[s(&tsx), "-o".into(), s(&reference), "--manifest".into(), s(&manifest_path)].as_slice(), &comp].concat(), &[])?;
let manifest: Value = serde_json::from_str(&std::fs::read_to_string(&manifest_path).map_err(|e| e.to_string())?).map_err(|e| e.to_string())?;
let (w, h, fps) = (manifest["width"].as_u64().unwrap_or(0) as u32, manifest["height"].as_u64().unwrap_or(0) as u32, manifest["fps"].as_f64().unwrap_or(30.0));
let (wf, hf) = (w as f64, h as f64);
// 2. its footage hidden, transparent: what raea draws over it
let runs = plan::runs(&manifest, fps);
let frames = work.join(format!("overlay.{}.frames", std::process::id()));
let drawn_result = render(&[[s(&tsx), "-o".into(), format!("{}/", frames.display()), "--alpha".into()].as_slice(), &comp].concat(), &[("RAEA_HIDE_MEDIA", "1")]);
// footage the overlay covers (opaque over most of its box at its middle frame) is drawn over the overlay: what the
// composition draws under it, a background
let covered: Vec<bool> = runs.iter().map(|r| drawn_result.is_ok() && opaque_under(&frames, r)).collect();
let overlay = work.join(format!("overlay.{}.mov", ext_of(codec)));
let made = drawn_result.and_then(|_| raea_io_alpha::encode_dir(&frames, &overlay, codec, fps, 0.9));
// the frames folder this export made, and only it
let _ = std::fs::remove_dir_all(&frames);
let made = made?;
// 3. only the backgrounds holding the footage: what raea draws under it, unless that's black (CapCut's canvas)
let under = if runs.is_empty() {
None
} else {
let frames = work.join(format!("under.{}.frames", std::process::id()));
let out = work.join(format!("under.{}.mov", ext_of(codec)));
let done = render(&[[s(&tsx), "-o".into(), format!("{}/", frames.display()), "--alpha".into()].as_slice(), &comp].concat(), &[("RAEA_HIDE_MEDIA", "under")])
.and_then(|_| if lit(&frames) { raea_io_alpha::encode_dir(&frames, &out, codec, fps, 0.9).map(|m| Some((out, m))) } else { Ok(None) });
let _ = std::fs::remove_dir_all(&frames);
done?
};
// 4. the timeline
let mut notes: Vec<String> = Vec::new();
let mut media: Vec<Media> = Vec::new();
let mut index = std::collections::HashMap::<PathBuf, usize>::new();
let mut sounds = plan::sounds(&manifest);
let (mut main, mut rest, mut above) = (Vec::new(), Vec::new(), Vec::new());
for (r, cov) in runs.iter().zip(&covered) {
let path = plan::resolve(&dir, &r.src);
let m = add(&mut media, &mut index, path.clone(), media::video)?;
let (mw, mh) = (media[m].width as f64, media[m].height as f64);
let (place, warn) = plan::place(&r.bx, &r.fit, mw.max(1.0), mh.max(1.0), wf, hf, r.opacity);
let what = format!("{} (frames {}-{})", r.src, r.start, r.end - 1);
if let Some(wn) = warn {
notes.push(format!("{what}: {wn}"));
}
if r.moved {
notes.push(format!("{what}: moves or scales in its box; placed as its first frame shows it (CapCut keyframes don't carry yet)"));
}
if r.faded {
notes.push(format!("{what}: fades; placed at its first frame's opacity"));
}
// its own sound: the manifest's sound clip of the same file over the same frames from the same time
let own = sounds.iter().position(|c| plan::resolve(&dir, &c.src) == path && (c.from - r.start).abs() <= 1 && (c.to - r.end).abs() <= 1 && (c.at - r.at).abs() <= 1.5 / fps);
let volume = own.map_or(0.0, |k| 10f64.powf(sounds.remove(k).gain_db / 20.0));
let clip = Clip { media: m, start: r.start, frames: r.end - r.start, source_in: r.at, speed: r.rate.unwrap_or(1.0).max(0.01), volume, place, ..Clip::default() };
if *cov {
notes.push(format!("{what}: raea draws over all of it from outside what holds it (a layer before it in the page); placed over the overlay, so the overlay's drawing over it is hidden in CapCut"));
}
match (*cov, plan::full(&r.bx, wf, hf)) {
(true, _) => above.push(clip),
(false, true) => main.push(clip),
(false, false) => rest.push(clip),
}
// 1. the layers and layers.json (raea export layers), in out/capcut/NAME
let mut layer_args = vec![tsx.display().to_string(), "-o".into(), work.display().to_string(), "--name".into(), name.clone(), "--alpha-codec".into(), raea_app_layers::codec_ext(codec).into()];
if let Some(c) = flag(args, "--composition") {
layer_args.extend(["--composition".into(), c]);
}
// the main track first (the clips covering the canvas), the rest above it in the page's order, then the overlay,
// then footage the overlay draws under
let mut tracks: Vec<Track> = Vec::new();
if let Some((path, m)) = &under {
tracks.extend(drawn(&mut media, path, m, fps, "raea under"));
}
tracks.extend(plan::lay(Kind::Video, if under.is_some() { "footage" } else { "" }, main));
tracks.extend(plan::lay(Kind::Video, "footage", rest));
tracks.extend(drawn(&mut media, &overlay, &made, fps, "raea overlay"));
tracks.extend(plan::lay(Kind::Video, "footage over", above));
let mut audio = Vec::new();
for c in sounds {
let m = add(&mut media, &mut index, plan::resolve(&dir, &c.src), media::sound)?;
audio.push(Clip { media: m, start: c.from, frames: c.to - c.from, source_in: c.at, speed: c.rate, volume: 10f64.powf(c.gain_db / 20.0), fade_in: c.fade_in, fade_out: c.fade_out, ..Clip::default() });
}
tracks.extend(plan::lay(Kind::Audio, "sound", audio));
let notes_made = manifest["sounds"]["notes"].as_array().map_or(0, Vec::len);
if notes_made > 0 {
notes.push(format!("the Tone graph's music ({notes_made} notes) has no file to place: it is in the reference render's sound"));
}
let tl = Timeline { width: w, height: h, fps, media, tracks };
let (layers, _) = raea_app_layers::export(&layer_args)?;
let reference = work.join(&layers.reference);
// 5. the draft
// 2. its tracks as CapCut's, and the draft
let (tl, carried) = from_layers::timeline(&layers, &work);
let mut notes = layers.notes.clone();
notes.extend(carried);
let markers = raea_io_capcut::seed(&root);
let written = raea_io_capcut::write(&tl, &root, &name, &markers, media::cover(&reference).as_deref())?;
notes.extend(written.warnings.iter().cloned());
// the reference render in the draft's folder, on no track, to set beside what CapCut plays (LA4b)
let beside = written.dir.join("reference.mp4");
if let Err(e) = std::fs::copy(&reference, &beside) {
return Err(format!("{}: {e}", beside.display()));
}
let listed = if !in_store || args.iter().any(|a| a == "--no-register") {
"not entered in CapCut's project list".to_string()
} else {
@@ -192,17 +99,22 @@ fn export(args: &[String]) -> R<String> {
}
};
let count = |k: Kind, n: &str| tl.tracks.iter().filter(|t| t.kind == k && t.name.starts_with(n)).map(|t| t.clips.len()).sum::<usize>();
let bytes = |layer: &str| std::fs::metadata(work.join(format!("{layer}.{}.mov", raea_app_layers::codec_ext(codec)))).map_or(0.0, |m| m.len() as f64 / 1e6);
let mut said = format!(
"APPLIED CapCut draft \"{name}\" at {}: {} tracks, {}, {} ({}, {:.1} MB){}, {}; {:.2} s at {fps} fps, {w}x{h}; {listed}; markers from {}\n the reference render and the movies raea drew: {}",
"APPLIED CapCut draft \"{name}\" at {}: {} tracks, {}, {} ({}, {:.1} MB){}{}, {}; {:.2} s at {} fps, {}x{}; {listed}; markers from {}\n the layers, layers.json and the reference render (also in the draft's folder): {}",
written.dir.display(),
tl.tracks.len(),
many(count(Kind::Video, "") - count(Kind::Video, "raea "), "footage clip"),
many(count(Kind::Video, "raea overlay"), "overlay clip"),
codec.name(),
made.bytes as f64 / 1e6,
under.as_ref().map_or(String::new(), |(_, m)| format!(", {} under the footage ({:.1} MB)", many(count(Kind::Video, "raea under"), "clip"), m.bytes as f64 / 1e6)),
bytes("graphics"),
Some(count(Kind::Video, "raea captions")).filter(|&k| k > 0).map_or(String::new(), |k| format!(", {} ({:.1} MB){}", many(k, "captions clip"), bytes("captions"), layers.srt.as_ref().map_or(String::new(), |s| format!(" and {s}")))),
Some(count(Kind::Video, "raea under")).filter(|&k| k > 0).map_or(String::new(), |k| format!(", {} under the footage ({:.1} MB)", many(k, "clip"), bytes("under"))),
many(count(Kind::Audio, ""), "sound"),
written.duration_us as f64 / 1e6,
layers.fps,
layers.width,
layers.height,
markers.from.as_deref().map_or("CapCut 8.5.0 (no draft CapCut made is in the store)".to_string(), |d| format!("the draft \"{d}\" CapCut made")),
work.display()
);
@@ -212,11 +124,6 @@ fn export(args: &[String]) -> R<String> {
Ok(said)
}
/// "1 clip", "4 clips"
fn many(k: usize, what: &str) -> String {
if k == 1 { format!("1 {what}") } else { format!("{k} {what}s") }
}
/// Where CapCut's project list is copied before a draft is entered in it: the person's own folder, ~/.raea/capcut/backups
/// ($RAEA_CAPCUT_BACKUPS; %LOCALAPPDATA%\raea\capcut\backups on Windows, which sets no HOME). Never raea's home, which
/// is its install or, from a checkout, the source tree (11-11: a list's backup landed in the repository).
@@ -226,67 +133,3 @@ fn backups() -> PathBuf {
None => raea_io_home::env_path("RAEA_CAPCUT_BACKUPS", ".raea/capcut/backups"),
}
}
/// A movie raea drew, as clips of it wherever it draws, full frame on tracks named `name`; none when it draws nothing.
fn drawn(media: &mut Vec<Media>, path: &Path, m: &raea_io_alpha::Made, fps: f64, name: &str) -> Vec<Track> {
let spans = plan::spans(&m.drawn);
if spans.is_empty() {
return Vec::new();
}
let k = media.len();
media.push(Media { path: path.to_path_buf(), kind: MediaKind::Video, seconds: m.frames as f64 / fps, width: m.width, height: m.height, has_audio: false });
let clips = spans.iter().map(|&(a, b)| Clip { media: k, start: a, frames: b - a, source_in: a as f64 / fps, volume: 0.0, place: Place::centred(m.width, m.height), ..Clip::default() }).collect();
plan::lay(Kind::Video, name, clips)
}
/// A file's place in the media list, probed the first time it's named.
fn add(media: &mut Vec<Media>, index: &mut std::collections::HashMap<PathBuf, usize>, p: PathBuf, probe: fn(&Path) -> R<Media>) -> R<usize> {
if let Some(i) = index.get(&p) {
return Ok(*i);
}
media.push(probe(&p)?);
index.insert(p, media.len() - 1);
Ok(media.len() - 1)
}
fn ext_of(c: raea_io_alpha::Codec) -> &'static str {
match c {
raea_io_alpha::Codec::ProRes => "prores",
raea_io_alpha::Codec::Hevc => "hevc",
raea_io_alpha::Codec::Rle => "rle",
raea_io_alpha::Codec::Png => "png",
}
}
/// Whether the overlay is opaque over 90% of a run's box at its middle frame (a grid of points inside it).
fn opaque_under(frames: &Path, r: &plan::Run) -> bool {
let mid = (r.start + r.end - 1) / 2;
let Ok((px, w, h)) = raea_io_alpha::read_png(&frames.join(format!("frame-{mid:05}.png"))) else { return false };
let (mut n, mut opaque) = (0, 0);
for j in 0..16 {
for i in 0..16 {
let x = (r.bx[0] + r.bx[2] * (i as f64 + 0.5) / 16.0) as i64;
let y = (r.bx[1] + r.bx[3] * (j as f64 + 0.5) / 16.0) as i64;
if x < 0 || y < 0 || x >= w as i64 || y >= h as i64 {
continue;
}
n += 1;
opaque += usize::from(px[((y as usize) * w as usize + x as usize) * 4 + 3] >= 250);
}
}
n > 0 && opaque * 10 >= n * 9
}
/// Whether any frame in `frames` draws anything but black, at any alpha (a grid of points on each).
fn lit(frames: &Path) -> bool {
raea_io_alpha::frames_in(frames).iter().any(|p| {
let Ok((px, w, h)) = raea_io_alpha::read_png(p) else { return true };
(0..32).any(|j| {
(0..32).any(|i| {
let (x, y) = ((w as usize * (2 * i + 1)) / 64, (h as usize * (2 * j + 1)) / 64);
let k = (y * w as usize + x) * 4;
px[k + 3] >= 8 && px[k..k + 3].iter().any(|&c| c >= 8)
})
})
})
}
+2 -29
View File
@@ -1,35 +1,8 @@
//! The files a draft uses, probed through raea's media backends (a picture's upright size and length, whether it has
//! sound; a sound's length), and the draft's cover: the reference render's first frame as a small JPEG.
//! The draft's cover: the reference render's first frame as a small JPEG. (The files a draft uses are probed by the
//! layers export, raea-app-layers.)
use std::path::Path;
use raea_io_capcut::{Media, MediaKind};
use crate::R;
/// A video file: its display size (rotation applied) and length from the first backend that opens it, and whether a
/// short window of its sound decodes to samples.
pub fn video(path: &Path) -> R<Media> {
let mut why = Vec::new();
for b in raea_io_media::preferred() {
match b.open_video(path) {
Ok(d) => {
let i = d.info();
let has_audio = raea_io_media::decode_audio_window(path, 0.0, 0.05).is_ok_and(|a| a.len() > 0);
return Ok(Media { path: path.to_path_buf(), kind: MediaKind::Video, seconds: i.duration, width: i.width, height: i.height, has_audio });
}
Err(e) => why.push(format!("{}: {e}", b.name())),
}
}
Err(format!("{} didn't open as video ({})", path.display(), why.join("; ")))
}
/// A sound file: its length from its container.
pub fn sound(path: &Path) -> R<Media> {
let seconds = raea_io_media::probe_seconds(path).ok_or_else(|| format!("{}: no sound length", path.display()))?;
Ok(Media { path: path.to_path_buf(), kind: MediaKind::Audio, seconds, width: 0, height: 0, has_audio: true })
}
/// The first frame of `video`, at most 540 pixels on its long side, as a JPEG.
pub fn cover(video: &Path) -> Option<Vec<u8>> {
let mut d = raea_io_media::preferred().into_iter().find_map(|b| b.open_video(video).ok())?;
+39 -175
View File
@@ -1,182 +1,46 @@
//! The render's manifest as a CapCut timeline (docs/capcut.feature CC2): each run of frames showing one file as a
//! clip of it, each sound clip as an audio clip (or as its footage's own sound), each run of frames the overlay draws
//! as a clip of the overlay movie, and the tracks they go on. Pure: the export (lib.rs) renders and probes around it.
//! Where a picture sits in CapCut's terms (docs/capcut.feature CC2a). The manifest is read by raea-app-layers, the same
//! for every editor, and so is where a picture is drawn and what of it is kept (raea_app_layers::plan::picture); this
//! is CapCut's own.
use std::path::{Path, PathBuf};
use raea_app_layers::model::Clip;
use raea_app_layers::plan::{self, Picture};
use raea_io_capcut::Place;
use raea_io_capcut::{Clip, Kind, Place, Track};
use serde_json::Value;
/// One file shown over a run of frames, as the manifest's frames say: its first source time and rate, its box and
/// fit at its first frame, its place in the page's order (lower draws first), and whether it moved or faded.
#[derive(Clone, Debug, PartialEq)]
pub struct Run {
pub src: String,
pub key: String,
pub start: i64,
pub end: i64,
pub at: f64,
pub last_at: f64,
pub rate: Option<f64>,
pub bx: [f64; 4],
pub fit: String,
pub opacity: f64,
pub z: usize,
pub moved: bool,
pub faded: bool,
/// Where a picture of `mw` x `mh` drawn as `p` sits in CapCut's terms on a `w` x `h` canvas: the part of it kept as
/// its crop, which CapCut fits inside the canvas (scale 1), then scaled to the size raea drew it, centred where raea
/// drew that part.
pub fn place(p: &Picture, (mw, mh): (f64, f64), (w, h): (f64, f64), opacity: f64) -> Place {
let [dx, dy, dw, dh] = p.drawn;
let [l, t, r, b] = p.kept;
let (cw, ch) = ((r - l).max(1e-6), (b - t).max(1e-6));
let fit = (w / (mw * cw)).min(h / (mh * ch));
let (x, y) = (dx + dw * (l + r) / 2.0, dy + dh * (t + b) / 2.0);
Place { x, y, scale: dw / (mw * fit), opacity, crop: p.kept }
}
/// One sound clip of the manifest: its file, frames, source time, gain, rate and fades.
#[derive(Clone, Debug, PartialEq)]
pub struct Sound {
pub src: String,
pub from: i64,
pub to: i64,
pub at: f64,
pub gain_db: f64,
pub rate: f64,
pub fade_in: f64,
pub fade_out: f64,
}
/// The footage's runs, frame by frame: a run goes on while the same element shows the same file with its source time
/// advancing at one rate; a jump in source time (a cut within one take) starts another.
pub fn runs(manifest: &Value, fps: f64) -> Vec<Run> {
let mut done: Vec<Run> = Vec::new();
let mut open: Vec<Run> = Vec::new();
let frames = manifest["frames"].as_array().cloned().unwrap_or_default();
for (i, fr) in frames.iter().enumerate() {
let f = fr["frame"].as_i64().unwrap_or(i as i64);
let mut next = Vec::new();
for (z, v) in fr["videos"].as_array().into_iter().flatten().enumerate() {
let src = v["src"].as_str().unwrap_or_default().to_string();
let key = format!("{src}|{}|{}|{}", v["loc"], v["use"], v["index"]);
let at = v["at"].as_f64().unwrap_or(0.0);
let bx: [f64; 4] = std::array::from_fn(|k| v["box"][k].as_f64().unwrap_or(0.0));
let opacity = v["opacity"].as_f64().unwrap_or(1.0);
let continues = |r: &Run| {
let step = at - r.last_at;
r.key == key && r.end == f && step > 0.0 && match r.rate {
Some(rate) => (step - rate / fps).abs() <= 0.6 / fps,
None => step * fps <= 8.0,
}
};
if let Some(k) = open.iter().position(continues) {
let mut r = open.remove(k);
r.rate.get_or_insert((at - r.last_at) * fps);
r.moved |= r.bx.iter().zip(&bx).any(|(a, b)| (a - b).abs() > 1.0);
r.faded |= (r.opacity - opacity).abs() > 0.02;
(r.end, r.last_at) = (f + 1, at);
next.push(r);
} else {
next.push(Run { src, key, start: f, end: f + 1, at, last_at: at, rate: None, bx, fit: v["fit"].as_str().unwrap_or("fill").to_string(), opacity, z, moved: false, faded: false });
}
}
done.append(&mut open);
open = next;
}
done.append(&mut open);
// the rate over the whole run (source times are whole milliseconds, so one step's can be 1% off), to hundredths
for r in &mut done {
if r.end - r.start > 1 {
r.rate = Some(((r.last_at - r.at) * fps / (r.end - r.start - 1) as f64 * 100.0).round() / 100.0);
}
}
done.sort_by_key(|r| (r.start, r.z));
done
}
/// The manifest's sound clips.
pub fn sounds(manifest: &Value) -> Vec<Sound> {
let s = &manifest["sounds"]["clips"];
s.as_array()
.into_iter()
.flatten()
.map(|c| Sound {
src: c["src"].as_str().unwrap_or_default().to_string(),
from: c["from"].as_i64().unwrap_or(0),
to: c["to"].as_i64().unwrap_or(0),
at: c["at"].as_f64().unwrap_or(0.0),
gain_db: c["gainDb"].as_f64().unwrap_or(0.0),
rate: c["rate"].as_f64().unwrap_or(1.0),
fade_in: c["fadeIn"].as_f64().unwrap_or(0.0),
fade_out: c["fadeOut"].as_f64().unwrap_or(0.0),
/// A footage clip's keys in CapCut's terms (frames from its first, each its place there; none when it holds), cut
/// throughout as `first` keeps it (its first frame's): CapCut's crop holds, so its moves, scaling and fades are keyed
/// around that cut. Thinned to what a straight line between can't give, to 0.15 px and half a percent of opacity; and
/// whether what is cut changes over its run, which CapCut can't show.
pub fn keys(c: &Clip, fit: &str, first: [f64; 4], (mw, mh): (f64, f64), canvas: (f64, f64)) -> (Vec<(i64, Place)>, bool) {
let mut changes = false;
let all: Vec<(i64, [f64; 4])> = c
.keys
.iter()
.map(|k| {
let (p, _) = plan::picture(&k.r#box, &k.clip, fit, &k.position, (mw, mh), canvas);
changes |= plan::apart(&p.kept, &first) > 1e-3;
let at = place(&Picture { drawn: p.drawn, kept: first }, (mw, mh), canvas, k.opacity);
(k.frame, [at.x, at.y, at.scale, at.opacity])
})
.filter(|c| c.to > c.from)
.collect()
}
/// Runs of frames that draw something.
pub fn spans(drawn: &[bool]) -> Vec<(i64, i64)> {
let mut out = Vec::new();
let mut f = 0;
while f < drawn.len() {
if !drawn[f] {
f += 1;
continue;
}
let a = f;
while f < drawn.len() && drawn[f] {
f += 1;
}
out.push((a as i64, f as i64));
.collect();
if all.is_empty() {
return (Vec::new(), false);
}
out
}
/// Whether a box covers the whole canvas.
pub fn full(bx: &[f64; 4], w: f64, h: f64) -> bool {
bx[0] <= 1.0 && bx[1] <= 1.0 && bx[0] + bx[2] >= w - 1.0 && bx[1] + bx[3] >= h - 1.0
}
/// Where a picture of `mw` x `mh` sits to show as it does in its box with its object-fit, in CapCut's terms (scale 1:
/// fitted inside the canvas; a crop is fitted as the part it keeps). A warning when CapCut can't show it so.
pub fn place(bx: &[f64; 4], fit: &str, mw: f64, mh: f64, w: f64, h: f64, opacity: f64) -> (Place, Option<String>) {
let (bw, bh) = (bx[2].max(1.0), bx[3].max(1.0));
let (x, y) = (bx[0] + bw / 2.0, bx[1] + bh / 2.0);
let fit0 = (w / mw).min(h / mh);
let mut warn = None;
let contain = (bw / mw).min(bh / mh);
let (scale, crop) = match fit {
"cover" if full(bx, w, h) => ((bw / mw).max(bh / mh) / fit0, [0.0, 0.0, 1.0, 1.0]),
"cover" => {
let s = (bw / mw).max(bh / mh);
let (cw, ch) = (bw / (mw * s), bh / (mh * s));
let fitc = (w / (mw * cw)).min(h / (mh * ch));
(bw / (mw * cw * fitc), [(1.0 - cw) / 2.0, (1.0 - ch) / 2.0, (1.0 + cw) / 2.0, (1.0 + ch) / 2.0])
}
"none" => (1.0 / fit0, [0.0, 0.0, 1.0, 1.0]),
"scale-down" => (contain.min(1.0) / fit0, [0.0, 0.0, 1.0, 1.0]),
"contain" => (contain / fit0, [0.0, 0.0, 1.0, 1.0]),
_ => {
if ((bw / bh) - (mw / mh)).abs() > 0.01 * (mw / mh) {
warn = Some(format!("stretched to its {bw:.0}x{bh:.0} box in raea (object-fit: fill), fitted inside it in CapCut"));
}
(contain / fit0, [0.0, 0.0, 1.0, 1.0])
}
};
(Place { x, y, scale, opacity, crop }, warn)
}
/// Clips laid on as few tracks as hold them without overlap, first come first: `kind` tracks named `name`, `name 2`...
pub fn lay(kind: Kind, name: &str, clips: Vec<Clip>) -> Vec<Track> {
let mut tracks: Vec<Track> = Vec::new();
for c in clips {
let end = |t: &Track| t.clips.last().map_or(i64::MIN, |l| l.start + l.frames);
match tracks.iter_mut().find(|t| end(t) <= c.start) {
Some(t) => t.clips.push(c),
None => {
let n = tracks.len();
tracks.push(Track { kind, name: if n == 0 || name.is_empty() { name.to_string() } else { format!("{name} {}", n + 1) }, clips: vec![c] });
}
}
}
tracks
}
/// A file the manifest names, as a path, found as the renderer finds it: a staticFile path (/media/x) in the edit's
/// 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)
// a scale step a 0.15 px change in the width of what's kept, as CapCut fits it inside the canvas
let (cw, ch) = ((first[2] - first[0]).max(1e-6), (first[3] - first[1]).max(1e-6));
let fitted = mw * cw * (canvas.0 / (mw * cw)).min(canvas.1 / (mh * ch));
let kept = plan::thin(&all, &[0.15, 0.15, 0.15 / fitted, 0.005]);
let keys = kept.into_iter().map(|(f, [x, y, scale, opacity])| (f, Place { x, y, scale, opacity, crop: first })).collect();
(keys, changes)
}
+87 -66
View File
@@ -1,85 +1,106 @@
//! CC2a-c without a render: a manifest's frames as footage runs, its sound clips, the overlay's spans, where a picture
//! sits in CapCut's terms, and clips laid on tracks.
//! CC2a without a render: where a picture sits in CapCut's terms, and layers.json as CapCut's tracks (LA4b). The
//! manifest's runs, sounds and spans are tested where they're read, in raea-app-layers.
use serde_json::json;
use std::path::Path;
use raea_app_layers::model::{self, Clip as LClip, File, FileKind, Layer, Layers, Track as LTrack};
use crate::from_layers;
use crate::plan::*;
use raea_io_capcut::{Clip, Kind};
/// 90 frames at 30 fps: one take cut into two pieces (a jump in its source time at frame 45), another file in a
/// corner from frame 60, moving one pixel at frame 70. Source times in whole milliseconds, as the manifest has them.
fn manifest() -> serde_json::Value {
let ms = |t: f64| (t * 1000.0).round() / 1000.0;
let frames: Vec<_> = (0..90)
.map(|f| {
let mut v = vec![json!({"src": "media/a.mp4", "at": ms(if f < 45 { 0.5 + f as f64 / 30.0 } else { 3.0 + (f - 45) as f64 / 30.0 }), "box": [0.0, 0.0, 1080.0, 1920.0], "fit": "cover", "opacity": 1.0})];
if f >= 60 {
v.push(json!({"src": "media/pip.mp4", "at": ms((f - 60) as f64 / 15.0), "box": [if f >= 70 { 662.0 } else { 660.0 }, 200.0, 360.0, 360.0], "opacity": 1.0}));
}
json!({"frame": f, "videos": v})
})
.collect();
json!({"width": 1080, "height": 1920, "fps": 30.0, "frames": frames, "sounds": {"clips": [{"src": "/m/music.wav", "from": 0, "to": 90, "at": 0.0, "gainDb": -6.0, "fadeOut": 0.5}]}})
}
#[test]
fn footage_runs_break_where_the_source_jumps() {
let r = runs(&manifest(), 30.0);
assert_eq!(r.iter().map(|r| (r.src.as_str(), r.start, r.end)).collect::<Vec<_>>(), [("media/a.mp4", 0, 45), ("media/a.mp4", 45, 90), ("media/pip.mp4", 60, 90)]);
assert!((r[1].at - 3.0).abs() < 1e-9);
assert_eq!((r[0].rate, r[1].rate), (Some(1.0), Some(1.0)), "a take at its own speed, though each step is 33 or 34 ms");
assert!((r[2].rate.unwrap() - 2.0).abs() < 1e-6, "the corner plays at twice its speed");
assert!(r[2].moved && !r[0].moved);
assert_eq!(r[2].fit, "fill");
}
#[test]
fn sounds_keep_gain_and_fades() {
let s = sounds(&manifest());
assert_eq!(s.len(), 1);
assert_eq!((s[0].from, s[0].to, s[0].gain_db, s[0].fade_out), (0, 90, -6.0, 0.5));
}
#[test]
fn overlay_spans_are_runs_of_drawn_frames() {
assert_eq!(spans(&[false, true, true, false, false, true]), [(1, 3), (5, 6)]);
assert!(spans(&[false; 4]).is_empty());
}
#[test]
fn pictures_sit_as_their_fit_shows_them() {
// a landscape take covering a portrait canvas: scaled past the fitted width until it fills the height
let (p, w) = place(&[0.0, 0.0, 1080.0, 1920.0], "cover", 1920.0, 1080.0, 1080.0, 1920.0, 1.0);
let at = |bx: [f64; 4], fit: &str, media: (f64, f64)| {
let (p, note) = raea_app_layers::plan::picture(&bx, &None, fit, &None, media, (1080.0, 1920.0));
(place(&p, media, (1080.0, 1920.0), 1.0), note)
};
// a landscape take covering a portrait canvas: scaled past the fitted width until it fills the height, uncut (the
// canvas cuts it)
let (p, w) = at([0.0, 0.0, 1080.0, 1920.0], "cover", (1920.0, 1080.0));
assert!(w.is_none() && (p.scale - (1920.0 / 1080.0) / 0.5625).abs() < 1e-9 && p.crop == [0.0, 0.0, 1.0, 1.0]);
assert_eq!((p.x, p.y), (540.0, 960.0));
// a square in a corner, contained: a third of the canvas's width
let (p, _) = place(&[660.0, 200.0, 360.0, 360.0], "contain", 640.0, 640.0, 1080.0, 1920.0, 1.0);
let (p, _) = at([660.0, 200.0, 360.0, 360.0], "contain", (640.0, 640.0));
assert!((p.scale - 1.0 / 3.0).abs() < 1e-9 && (p.x, p.y) == (840.0, 380.0));
// a landscape take covering a square box: cropped to its middle square, which then fits as a square
let (p, _) = place(&[0.0, 0.0, 540.0, 540.0], "cover", 1920.0, 1080.0, 1080.0, 1920.0, 1.0);
// a landscape take covering a square box inside the canvas: cropped to its middle square, which then fits as a square
let (p, _) = at([100.0, 100.0, 540.0, 540.0], "cover", (1920.0, 1080.0));
assert!((p.crop[0] - 0.21875).abs() < 1e-9 && (p.crop[2] - 0.78125).abs() < 1e-9 && p.crop[1] == 0.0);
assert!((p.scale - 0.5).abs() < 1e-9);
assert!((p.scale - 0.5).abs() < 1e-9 && ((p.x - 370.0).abs(), (p.y - 370.0).abs()) < (1e-9, 1e-9));
// the same box in the canvas's corner: cut only on its right, the canvas cutting its left; the part kept sits where
// raea drew it, its left past the canvas
let (p, _) = at([0.0, 0.0, 540.0, 540.0], "cover", (1920.0, 1080.0));
assert!(p.crop[0] == 0.0 && (p.crop[2] - 0.78125).abs() < 1e-9);
assert!((p.x - (-210.0 + 750.0 / 2.0)).abs() < 1e-9 && (p.y - 270.0).abs() < 1e-9);
// stretched in raea: said
assert!(place(&[0.0, 0.0, 500.0, 100.0], "fill", 640.0, 640.0, 1080.0, 1920.0, 1.0).1.is_some());
assert!(at([0.0, 0.0, 500.0, 100.0], "fill", (640.0, 640.0)).1.is_some());
}
#[test]
fn clips_go_on_as_few_tracks_as_hold_them() {
let c = |start, frames| Clip { start, frames, ..Clip::default() };
let t = lay(Kind::Audio, "sound", vec![c(0, 90), c(10, 5), c(15, 10), c(90, 5)]);
assert_eq!(t.iter().map(|t| (t.name.as_str(), t.clips.len())).collect::<Vec<_>>(), [("sound", 2), ("sound 2", 2)]);
fn layers_json_goes_bottom_first_with_footage_carrying_its_own_sound() {
let file = |path: &str, kind, w, h| File { path: path.into(), kind, seconds: 3.0, width: w, height: h, has_audio: kind == FileKind::Video, channels: 2, sample_rate: 48_000, rotation: 0 };
let clip = |id: &str, f, start, frames| LClip::new(id.into(), f, start, frames, 0.0);
let t = |layer, name: &str, clips| LTrack { layer, name: name.into(), clips };
let v1 = LClip { r#box: Some([0.0, 0.0, 1080.0, 1920.0]), fit: Some("cover".into()), link: Some("a1".into()), ..clip("v1", 0, 0, 90) };
let a1 = LClip { gain_db: -6.0, link: Some("v1".into()), ..clip("a1", 0, 0, 90) };
let l = Layers {
version: model::VERSION,
name: "edit".into(),
width: 1080,
height: 1920,
fps: 30.0,
frames: 90,
reference: "reference.mp4".into(),
srt: Some("edit.srt".into()),
files: vec![file("/m/a.mp4", FileKind::Video, 1920, 1080), file("captions.prores.mov", FileKind::Video, 1080, 1920), file("graphics.prores.mov", FileKind::Video, 1080, 1920), file("/m/music.wav", FileKind::Audio, 0, 0)],
tracks: vec![
t(Layer::Captions, "captions", vec![clip("c1", 1, 10, 30)]),
t(Layer::Graphics, "graphics", vec![clip("g1", 2, 0, 90)]),
t(Layer::Footage, "footage", vec![v1]),
t(Layer::Sound, "sound", vec![a1, LClip { gain_db: -12.0, fade_out: 0.5, ..clip("a2", 3, 0, 90) }]),
],
notes: vec![],
};
let (tl, _) = from_layers::timeline(&l, Path::new("/out/edit"));
// bottom first: the footage is CapCut's main track (no name), then the overlay, then the captions; sound after
assert_eq!(tl.tracks.iter().map(|t| t.name.as_str()).collect::<Vec<_>>(), ["", "raea overlay", "raea captions", "sound"]);
// a layer's movie is found beside layers.json; the footage where it is
assert_eq!(tl.media[1].path, Path::new("/out/edit/captions.prores.mov"));
assert_eq!(tl.media[0].path, Path::new("/m/a.mp4"));
// the footage carries its own sound at its gain (-6 dB), so that sound isn't a clip of its own; the music is
let foot = &tl.tracks[0].clips[0];
assert!((foot.volume - 10f64.powf(-6.0 / 20.0)).abs() < 1e-9);
assert_eq!(tl.tracks[3].clips.len(), 1);
assert!((tl.tracks[3].clips[0].volume - 10f64.powf(-12.0 / 20.0)).abs() < 1e-9 && tl.tracks[3].clips[0].fade_out == 0.5);
// the layers' movies fill the canvas, silent
let cap = &tl.tracks[2].clips[0];
assert_eq!((cap.start, cap.frames, cap.volume, cap.place.scale, cap.place.x, cap.place.y), (10, 30, 0.0, 1.0, 540.0, 960.0));
// footage with no linked sound plays silent
let mut quiet = l.clone();
quiet.tracks[2].clips[0].link = None;
quiet.tracks[3].clips.remove(0);
assert_eq!(from_layers::timeline(&quiet, Path::new("/out/edit")).0.tracks[0].clips[0].volume, 0.0);
}
/// staticFile("x.mp4") is "/media/x.mp4" in the manifest: the export finds it where the render did, in media/ beside
/// the edit, as it finds a relative path; an absolute path stays as it is
/// CC2f: a footage clip's keys in CapCut's terms, around the cut its first frame shows: a steady move is its two ends,
/// a move inside a card keeps the card's cut, and a cut that changes (the split close) is said
#[test]
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();
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);
std::fs::remove_dir_all(&dir).unwrap();
fn keyed_footage_is_keyed_around_its_first_cut() {
use raea_app_layers::model::Key;
let canvas = (1080.0, 1920.0);
let key = |frame: i64, bx: [f64; 4], clip: Option<[f64; 4]>| Key { frame, r#box: bx, clip, position: None, opacity: 1.0 };
let first = |c: &LClip| raea_app_layers::plan::picture(&c.r#box.unwrap(), &c.clip, "cover", &None, (1080.0, 1920.0), canvas).0.kept;
// a picture in picture sliding right 10 px a frame: its two ends
let slide = LClip { r#box: Some([100.0, 500.0, 400.0, 400.0]), keys: (0..24).map(|f| key(f, [100.0 + 10.0 * f as f64, 500.0, 400.0, 400.0], None)).collect(), ..LClip::new("v".into(), 0, 0, 24, 0.0) };
let (got, changes) = keys(&slide, "cover", first(&slide), (1080.0, 1920.0), canvas);
assert!(!changes && got.len() == 2 && got[1].0 == 23 && (got[1].1.x - got[0].1.x - 230.0).abs() < 1e-6);
// inside a card that moves with it, cutting its sides: the same cut throughout, keyed as it moves
let card = |f: i64| key(f, [80.0 + 4.0 * f as f64, 300.0, 600.0, 1066.7], Some([140.0 + 4.0 * f as f64, 300.0, 480.0, 1066.7]));
let carded = LClip { r#box: Some(card(0).r#box), clip: card(0).clip, keys: (0..24).map(card).collect(), ..LClip::new("v".into(), 0, 0, 24, 0.0) };
let (got, changes) = keys(&carded, "cover", first(&carded), (1080.0, 1920.0), canvas);
assert!(!changes && got.len() == 2 && got.iter().all(|(_, p)| p.crop[0] > 0.09 && p.crop[2] < 0.91));
// the split close: its box shrinking to the seam changes what's cut, which CapCut's crop can't follow
let split = |f: i64, h: f64| key(f, [0.0, -260.0 * (1920.0 - h) / 1060.0, 1080.0, 1920.0], (h < 1920.0).then_some([0.0, 0.0, 1080.0, h]));
let closing = LClip { r#box: Some(split(0, 1920.0).r#box), keys: vec![split(0, 1920.0), split(12, 860.0)], ..LClip::new("v".into(), 0, 0, 24, 0.0) };
let (got, changes) = keys(&closing, "cover", first(&closing), (1080.0, 1920.0), canvas);
assert!(changes && got.len() == 2 && got[1].1.crop == [0.0, 0.0, 1.0, 1.0]);
}
+13
View File
@@ -11,8 +11,21 @@ description = "`raea check`: the floor's measurable lines on an export, ranked P
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
raea-io-ffmpeg = { path = "../../io/ffmpeg" }
# caption contrast and loudness, measured as `raea world` measures a render (DR2)
raea-sys-measure = { path = "../../systems/measure" }
# what it reads of a video, through FFmpeg or raea's own decoders where it isn't installed
raea-app-check-read = { path = "read" }
# who can fix what it finds: the encode's or the picture's own, carried, a source (split out to keep this crate small)
raea-app-check-cause = { path = "cause" }
# the text rules on a render's manifest (split out: raea render holds its own text to them)
raea-app-check-text = { path = "text" }
# 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"
+15
View File
@@ -0,0 +1,15 @@
[package]
name = "raea-app-check-cause"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "Who can fix what raea check finds: the encode's or the picture's own, carried from an earlier export, a source rather than a delivery"
[dependencies]
# a project's record of renders and checks (DR3)
raea-core-facts = { path = "../../../core/facts" }
image = { version = "0.25", default-features = false, features = ["png"] }
[dev-dependencies]
serde_json = "1"
+174
View File
@@ -0,0 +1,174 @@
//! Who can fix what `raea check` finds, so a round is spent only on what another render can change (11-19: two
//! Telluride projects took nine renders, five of them for findings no render could move). Three things, for any rule:
//!
//! - **Introduced or there already.** A rule an encode can cause is measured again on the composition's own frames,
//! rendered without encoding (`unencoded`), and the export is set against them (`against`): what the picture already
//! held is the footage's (a note), what the export adds is the encode's (the error, with a fix raea has).
//! - **Carried.** A finding an earlier export of the same composition had at the same moment (`earlier`, `carried`)
//! says since when: the change between them didn't move it, so doing that again won't.
//! - **A source isn't a delivery.** A take or a download checked on its own (`is_source`) isn't held to a delivery's
//! loudness target.
//!
//! None of it changes what a rule measures or where it draws the line.
use std::path::{Path, PathBuf};
use std::process::Command;
use raea_core_facts::{Finding, record};
pub type R<T> = Result<T, String>;
/// Whether a record entry is the render that wrote `out` (a path as the record names it)
fn rendered(e: &record::Entry, out: &str) -> bool {
e.by == "raea render" && e.out.as_deref() == Some(out)
}
/// The composition a video was rendered from, and its project: the newest `raea render` writing it in the project's
/// record (DR3). None outside a project, or for a video no render there wrote (a take, a download).
pub fn composition_of(video: &Path) -> Option<(PathBuf, PathBuf)> {
let project = record::up(video, ".raea/project")?;
let want = record::rel(&project, video);
let made = record::read(&project).into_iter().rev().find(|e| e.kind == "video" && rendered(e, &want))?;
let of = project.join(&made.of);
of.is_file().then_some((project, of))
}
/// Whether a file is one of a project's sources (a take or a download under assets/ or media/ that no render wrote):
/// it isn't a delivery, so a delivery's rules (its loudness target) don't hold it
pub fn is_source(video: &Path) -> bool {
let Some(project) = record::up(video, ".raea/project") else { return false };
let me = record::rel(&project, video);
(me.starts_with("assets/") || me.starts_with("media/")) && !record::read(&project).iter().any(|e| rendered(e, &me))
}
/// Luma as a decoder of raea's export gives it to the check (BT.709, full range: FFmpeg's format=gray of the
/// encoder's limited-range picture), from 8-bit RGBA `width` wide, its top-left `w` x `h`
pub fn luma(rgba: &[u8], width: usize, w: usize, h: usize) -> Vec<u8> {
let mut y = Vec::with_capacity(w * h);
for r in 0..h {
for p in rgba[r * width * 4..][..w * 4].chunks_exact(4) {
y.push((0.2126 * p[0] as f32 + 0.7152 * p[1] as f32 + 0.0722 * p[2] as f32).round().clamp(0.0, 255.0) as u8);
}
}
y
}
/// `frames` as `comp` draws them, never encoded, as luma `w` x `h` (top-left): `raea render COMP --at F,... -o DIR/`
/// (PNG) run by `raea` from the project, kept out of its record as the quick check's stills are
pub fn unencoded(raea: &Path, project: &Path, comp: &Path, frames: &[i64], w: usize, h: usize) -> R<Vec<Vec<u8>>> {
let mut wanted: Vec<i64> = frames.to_vec();
wanted.sort_unstable();
wanted.dedup();
let tmp = std::env::temp_dir().join(format!("raea-unencoded-{}", std::process::id()));
let _ = std::fs::remove_dir_all(&tmp);
std::fs::create_dir_all(&tmp).map_err(|e| format!("{}: {e}", tmp.display()))?;
let at = wanted.iter().map(|f| f.to_string()).collect::<Vec<_>>().join(",");
let read = (|| {
let run = Command::new(raea).arg("render").arg(comp).args(["--at", &at, "-o"]).arg(format!("{}/", tmp.display())).current_dir(project).env("RAEA_RECORD", "off").output().map_err(|e| e.to_string())?;
let mut pngs: Vec<PathBuf> = std::fs::read_dir(&tmp).map_err(|e| e.to_string())?.filter_map(|e| e.ok().map(|e| e.path())).filter(|p| p.extension().is_some_and(|x| x == "png")).collect();
pngs.sort();
if pngs.len() != wanted.len() {
let said = String::from_utf8_lossy(&run.stderr).lines().chain(String::from_utf8_lossy(&run.stdout).lines()).find(|l| l.contains("REFUSED") || l.contains("rror")).unwrap_or("").to_string();
return Err(format!("its render gave {} of {} frames {said}", pngs.len(), wanted.len()).trim_end().to_string());
}
let mut by_frame = std::collections::HashMap::new();
for (f, p) in wanted.iter().zip(&pngs) {
let img = image::open(p).map_err(|e| format!("{}: {e}", p.display()))?.to_rgba8();
let (iw, ih) = (img.width() as usize, img.height() as usize);
if iw < w || ih < h {
return Err(format!("it draws {iw}x{ih}, smaller than the export's {w}x{h}"));
}
by_frame.insert(*f, luma(img.as_raw(), iw, w, h));
}
Ok(frames.iter().map(|f| by_frame[f].clone()).collect())
})();
let _ = std::fs::remove_dir_all(&tmp);
read
}
/// The frame a check reads for each sample taken every `every` seconds from 0: the last frame before the sample's
/// middle, as ffmpeg's fps filter picks it (and raea-app-check-read's readers), held to the picture's `last` frame
pub fn sampled(samples: usize, every: f64, fps: f64, last: i64) -> Vec<i64> {
(0..samples).map(|k| (((k as f64 + 0.5) * every * fps).ceil() as i64 - 1).clamp(0, last.max(0))).collect()
}
/// A sampled measure of the export against the same measure of the unencoded frames.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Against {
/// samples over the rule's line that the export made worse by more than its noise
pub worse: usize,
/// samples over the line before encoding: the picture's own
pub before: usize,
/// samples compared
pub of: usize,
/// the mean of the export's measure less the unencoded one's
pub added: f64,
}
impl Against {
/// Whether the export added to it, beyond what a clean encode moves: at least three samples (and a tenth) worse,
/// and more than half the noise on average
pub fn by_encode(&self, noise: f64) -> bool {
self.worse >= 3usize.max(self.of / 10) && self.added > noise / 2.0
}
/// The first sample the export made worse
pub fn first(out: &[Option<f64>], before: &[Option<f64>], line: f64, noise: f64) -> Option<usize> {
out.iter().zip(before).position(|(o, b)| o.unwrap_or(0.0) > line && o.unwrap_or(0.0) - b.unwrap_or(0.0) > noise)
}
}
/// Per sample, the export's measure against the unencoded frames' (None: nothing to measure, read as 0), over a
/// rule's `line`, where a clean encode moves it at most `noise`
pub fn against(out: &[Option<f64>], before: &[Option<f64>], line: f64, noise: f64) -> Against {
let n = out.len().min(before.len());
let at = |s: &[Option<f64>], i: usize| s[i].unwrap_or(0.0);
let worse = (0..n).filter(|&i| at(out, i) > line && at(out, i) - at(before, i) > noise).count();
let was = (0..n).filter(|&i| at(before, i) > line).count();
let added = (0..n).map(|i| at(out, i) - at(before, i)).sum::<f64>() / n.max(1) as f64;
Against { worse, before: was, of: n, added }
}
/// The newest check, in the project's record, of an earlier export of the composition `video` was rendered from
pub fn earlier(video: &Path) -> Option<record::Entry> {
let project = record::up(video, ".raea/project")?;
let me = record::rel(&project, video);
let entries = record::read(&project);
let made = entries.iter().rposition(|e| rendered(e, &me))?;
// the composition's exports rendered before this one; a versioned copy (NAME-v2.tsx) is the same piece
let stem = |of: &str| piece(&Path::new(of).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default());
let comp = stem(&entries[made].of);
let exports: Vec<String> = entries[..made].iter().filter(|e| e.by == "raea render" && e.kind == "video" && stem(&e.of) == comp).filter_map(|e| e.out.clone()).filter(|o| *o != me).collect();
entries.into_iter().rev().find(|e| e.by == "raea check" && exports.contains(&e.of))
}
/// A composition's name without its version: walkaround-v2 is walkaround
pub fn piece(stem: &str) -> String {
match stem.rfind("-v") {
Some(i) if i + 2 < stem.len() && stem[i + 2..].bytes().all(|b| b.is_ascii_digit()) => stem[..i].to_string(),
_ => stem.to_string(),
}
}
/// The same finding in another export: the same rule, about the same thing, at the same moment (within a second; a
/// finding about the whole piece matches one about the whole piece). Its words may differ ("worst 13%", "worst 15%").
pub fn alike(a: &Finding, b: &Finding, fps: f64) -> bool {
let about = |f: &Finding| f.about.iter().map(|a| a.key.clone().unwrap_or_else(|| a.name.clone())).collect::<Vec<_>>();
a.check == b.check && about(a) == about(b) && match (a.frames, b.frames) {
(Some([x, _]), Some([y, _])) => ((x - y).abs() as f64) <= fps.max(1.0),
(None, None) => true,
_ => false,
}
}
/// Each finding an earlier check had at the same moment says so, and that its fix hasn't moved it: rank and words
/// otherwise as measured
pub fn carried(now: &mut [Finding], before: &record::Entry, fps: f64) {
for f in now.iter_mut() {
if before.findings.iter().any(|b| alike(b, f, fps)) {
f.says.push_str(&format!(" [also in {} ({}): what changed between them didn't move it]", before.of, before.id));
}
}
}
#[cfg(test)]
mod tests;
+107
View File
@@ -0,0 +1,107 @@
use super::*;
use raea_core_facts::Level;
// The 28 samples `raea check` takes of the 11-16 Telluride walkaround (55.8 s, 24 fps, phone footage), as its
// blotching measures them: rendered to PNG with no encoding (BEFORE), those PNGs through x264 crf 12, and raea's own
// exports at --quality high and master. Blotching's line is 0.009; x264 moved a sample at most 0.005.
const BEFORE: [Option<f64>; 28] = [Some(0.0), None, Some(0.052), Some(0.062), None, Some(0.062), None, None, Some(0.076), Some(0.009), Some(0.03), Some(0.039), Some(0.068), None, None, None, None, Some(0.077), Some(0.062), None, None, Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0)];
const X264: [Option<f64>; 28] = [Some(0.0), None, Some(0.052), Some(0.062), None, Some(0.059), None, None, Some(0.078), Some(0.008), Some(0.028), Some(0.034), Some(0.071), None, None, None, None, Some(0.078), Some(0.062), None, Some(0.039), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0)];
const HIGH: [Option<f64>; 28] = [Some(0.0), None, Some(0.042), Some(0.024), Some(0.052), Some(0.064), Some(0.05), None, Some(0.126), Some(0.063), Some(0.061), Some(0.122), Some(0.088), Some(0.04), Some(0.029), Some(0.047), Some(0.044), Some(0.096), Some(0.09), None, Some(0.029), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0)];
const MASTER: [Option<f64>; 28] = [Some(0.0), None, Some(0.026), Some(0.002), None, Some(0.03), None, None, Some(0.022), None, None, None, None, None, None, None, None, Some(0.071), Some(0.053), None, None, Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0), Some(0.0)];
const LINE: f64 = 0.009;
const NOISE: f64 = 0.005;
/// What the picture already held is told from what the encode added: a clean encode and raea's master add nothing,
/// its high adds to 14 of 28 samples, and 9 samples hold the footage's own either way
#[test]
fn the_picture_s_own_is_told_from_the_encode_s() {
let clean = against(&X264, &BEFORE, LINE, NOISE);
assert!(!clean.by_encode(NOISE), "{clean:?}");
assert!(clean.added.abs() < 0.002, "{clean:?}");
let high = against(&HIGH, &BEFORE, LINE, NOISE);
assert!(high.by_encode(NOISE), "{high:?}");
assert_eq!((high.worse, high.before, high.of), (14, 9, 28));
assert_eq!(Against::first(&HIGH, &BEFORE, LINE, NOISE), Some(4));
let master = against(&MASTER, &BEFORE, LINE, NOISE);
assert!(!master.by_encode(NOISE), "{master:?}");
assert_eq!(master.worse, 0);
// a small, even addition over a clean picture still counts (VideoToolbox over a dark render, 10-25)
assert!(against(&[Some(0.013); 16], &[Some(0.003); 16], LINE, NOISE).by_encode(NOISE));
}
/// The frame read for each sample is the last before its middle, as the fps filter picks it
#[test]
fn the_sampled_frames_are_the_check_s() {
assert_eq!(sampled(3, 2.0, 24.0, 1338), vec![23, 71, 119]);
assert_eq!(sampled(2, 2.0, 30.0, 1000), vec![29, 89]);
assert_eq!(sampled(2, 2.0, 30000.0 / 1001.0, 1000), vec![29, 89]);
assert_eq!(sampled(2, 2.0, 24.0, 50), vec![23, 50]);
}
/// Luma as the check reads raea's export: BT.709 weights, full range, cropped to the top-left
#[test]
fn luma_is_bt709_cropped() {
let px = |r: u8, g: u8, b: u8| [r, g, b, 255];
let rgba: Vec<u8> = [px(255, 255, 255), px(0, 0, 0), px(255, 0, 0), px(0, 255, 0)].concat();
assert_eq!(luma(&rgba, 2, 2, 2), vec![255, 0, 54, 182]);
assert_eq!(luma(&rgba, 2, 1, 2), vec![255, 54]);
}
fn finding(check: &str, frame: Option<i64>, says: &str) -> Finding {
let f = Finding::new(check, Level::Error, says, "raea check");
match frame {
Some(n) => f.frames(n, n + 1),
None => f,
}
}
/// A finding is carried when the same rule finds the same thing at the same moment, whatever its numbers say
#[test]
fn a_carried_finding_is_the_same_rule_at_the_same_moment() {
let fps = 24.0;
assert!(alike(&finding("blotching", Some(96), "worst 13%"), &finding("blotching", Some(96), "worst 15%"), fps));
assert!(alike(&finding("clipping", Some(624), "9 runs"), &finding("clipping", Some(640), "6 runs"), fps));
assert!(!alike(&finding("clipping", Some(624), "9 runs"), &finding("clipping", Some(1104), "11 runs"), fps));
assert!(!alike(&finding("clipping", Some(624), "x"), &finding("dropout", Some(624), "x"), fps));
assert!(alike(&finding("brand", None, "a"), &finding("brand", None, "b"), fps));
assert_eq!(piece("walkaround-v2"), "walkaround");
assert_eq!(piece("edit-video"), "edit-video");
assert_eq!(piece("telluride-v12"), "telluride");
}
/// A project whose record holds two renders of one composition and a check of the first: the second's check finds
/// that one, its blotching carried and its clipping new; a take under assets/ is a source, an export isn't
#[test]
fn the_earlier_check_is_of_the_composition_s_other_export() {
let dir = std::env::temp_dir().join(format!("raea-cause-{}", std::process::id()));
let _ = std::fs::remove_dir_all(&dir);
for d in [".raea/record", "out", "assets/footage", "compositions"] {
std::fs::create_dir_all(dir.join(d)).unwrap();
}
std::fs::write(dir.join(".raea/project"), "[project]\n\tid = pj_test\n").unwrap();
for f in ["out/a-v1.mp4", "out/a-v2.mp4", "assets/footage/take.mov", "compositions/a.tsx", "compositions/a-v2.tsx"] {
std::fs::write(dir.join(f), b"").unwrap();
}
let entry = |id: &str, by: &str, of: &str, out: Option<&str>, kind: &str, findings: Vec<Finding>| record::Entry { id: id.into(), at: 0, by: by.into(), of: of.into(), out: out.map(Into::into), kind: kind.into(), commit: None, findings, despite: vec![] };
let entries = [
entry("20261116-170223-a", "raea render", "compositions/a.tsx", Some("out/a-v1.mp4"), "video", vec![]),
entry("20261116-170252-a-v1", "raea check", "out/a-v1.mp4", None, "check", vec![finding("blotching", Some(96), "worst 13%")]),
entry("20261116-171601-a-v2", "raea render", "compositions/a-v2.tsx", Some("out/a-v2.mp4"), "video", vec![]),
];
for e in &entries {
std::fs::write(dir.join(format!(".raea/record/{}.json", e.id)), serde_json::to_vec(e).unwrap()).unwrap();
}
let v2 = dir.join("out/a-v2.mp4");
assert_eq!(composition_of(&v2).map(|(_, c)| c.ends_with("compositions/a-v2.tsx")), Some(true));
let before = earlier(&v2).expect("the check of a-v1");
assert_eq!(before.of, "out/a-v1.mp4");
let mut now = vec![finding("blotching", Some(96), "worst 15%"), finding("clipping", Some(624), "9 runs")];
carried(&mut now, &before, 24.0);
assert!(now[0].says.contains("also in out/a-v1.mp4 (20261116-170252-a-v1)"), "{}", now[0].says);
assert_eq!(now[1].says, "9 runs");
// nothing was rendered before a-v1, so its check has no earlier one, even with a-v2's check in the record
assert!(earlier(&dir.join("out/a-v1.mp4")).is_none());
assert!(is_source(&dir.join("assets/footage/take.mov")));
assert!(!is_source(&v2));
let _ = std::fs::remove_dir_all(&dir);
}
+7
View File
@@ -0,0 +1,7 @@
[package]
name = "raea-app-check-flash"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "`raea check`'s flashing screen (WCAG 2.3.1): opposing swings in a frame's windows, from decoded RGB"
+232
View File
@@ -0,0 +1,232 @@
//! The flashing screen behind `raea check` (apps/check flash.rs feeds it the decoded frames): a pure measure of pixels,
//! in a crate of its own so the check stays small (tools/size.sh).
/// Flashing past WCAG 2.3.1: more than three flashes in any one second, over enough of the frame to matter. A flash is a
/// pair of opposing changes in the same pixels, so a shape sliding past isn't one. Each window, a third of the frame wide
/// and high, stands in for WCAG's quarter of a 10-degree field (the real area depends on the screen and how far away it
/// is, which a file doesn't say), and a quarter of its pixels must swing together: by 0.10 relative luminance with the
/// darker end under 0.80, or by 20 of saturated red ((R-G-B)*320, where R/(R+G+B) is at least 0.8). Every decoded frame
/// counts, on its own timestamp, and the picture is sampled twice, by area and by point, so fine patterns don't average
/// away. A screen for review, not a Harding or PEAT certification; an interlaced picture isn't split into its fields.
const FLASH_MOST: usize = 6;
const FLASH_PAIR_S: f64 = 1.0 + 1e-9;
/// A pixel in one measure: its value, and whether it can count. Red's value runs on through the saturation line, and a change
/// counts when either end of it is saturated; a one-level step across the line isn't a jump from zero.
#[derive(Clone, Copy)]
struct Px {
value: f32,
counts: bool,
}
struct Swing {
at: f64,
direction: f32,
moved: Vec<bool>,
plain: bool,
kept: bool,
}
/// One window's swings in one measure: the ones an opposite swing within a second moves back in the same pixels. The
/// general measure leaves out swings where another quarter of the window moved the other way at once (a moving pattern).
struct Swings {
by: f32,
under: f32,
mixed_counts: bool,
pivot: Vec<Px>,
extreme: Vec<Px>,
at: f64,
direction: f32,
recent: std::collections::VecDeque<Swing>,
ends: Vec<f64>,
}
impl Swings {
fn new(by: f32, under: f32, mixed_counts: bool) -> Swings {
Swings { by, under, mixed_counts, pivot: Vec::new(), extreme: Vec::new(), at: 0.0, direction: 0.0, recent: Default::default(), ends: Vec::new() }
}
fn moves(&self, a: Px, b: Px, direction: f32) -> bool {
(b.value - a.value) * direction >= self.by && a.value.min(b.value) < self.under && (a.counts || b.counts)
}
fn changed(&self, earlier: &[Px], later: &[Px], direction: f32) -> bool {
earlier.iter().zip(later).filter(|(a, b)| self.moves(**a, **b, direction)).count() * 4 >= earlier.len()
}
fn push(&mut self, t: f64, px: &[Px]) {
if self.pivot.is_empty() {
self.pivot = px.to_vec();
self.extreme = px.to_vec();
self.at = t;
return;
}
if self.direction == 0.0 {
for direction in [1.0, -1.0] {
if self.changed(&self.pivot, px, direction) {
self.direction = direction;
self.extreme = px.to_vec();
self.at = t;
break;
}
}
return;
}
if self.changed(&self.extreme, px, -self.direction) {
self.record();
self.pivot = std::mem::replace(&mut self.extreme, px.to_vec());
self.at = t;
self.direction = -self.direction;
} else if self.changed(&self.pivot, px, self.direction) && self.went_further(px) {
self.extreme = px.to_vec();
}
}
/// Whether the pixels swinging from the pivot went further than the saved extreme, judged on those pixels alone: the
/// rest of the window can dim by less than counts and still outweigh a patch that's flashing.
fn went_further(&self, px: &[Px]) -> bool {
let further: f32 = self.pivot.iter().zip(px).zip(&self.extreme).filter(|((p, n), _)| self.moves(**p, **n, self.direction)).map(|((_, n), e)| (n.value - e.value) * self.direction).sum();
further > 0.0
}
fn record(&mut self) {
if !self.changed(&self.pivot, &self.extreme, self.direction) {
return;
}
let moved: Vec<bool> = self.pivot.iter().zip(&self.extreme).map(|(a, b)| self.moves(*a, *b, self.direction)).collect();
let plain = self.mixed_counts || !self.changed(&self.pivot, &self.extreme, -self.direction);
let (at, direction) = (self.at, self.direction);
let mut kept = false;
for other in self.recent.iter_mut().rev() {
if at - other.at > FLASH_PAIR_S {
break;
}
let same = moved.iter().zip(&other.moved).filter(|(x, y)| **x && **y).count();
if other.direction == -direction && same * 4 >= moved.len() {
other.kept = true;
kept = true;
}
}
self.recent.push_back(Swing { at, direction, moved, plain, kept });
while self.recent.front().is_some_and(|s| at - s.at > FLASH_PAIR_S) {
self.retire();
}
}
/// The oldest swing leaves the second it could still pair within; only the seconds' ends are kept for good.
fn retire(&mut self) {
if let Some(s) = self.recent.pop_front()
&& s.plain
&& s.kept
{
self.ends.push(s.at);
}
}
/// The most swings in any one second, and when that second starts.
fn busiest(&mut self) -> (usize, f64) {
if self.direction != 0.0 {
self.record();
self.direction = 0.0;
}
while !self.recent.is_empty() {
self.retire();
}
self.ends.sort_by(f64::total_cmp);
let (mut best, mut from, mut j) = (0, 0.0, 0);
for i in 0..self.ends.len() {
while self.ends[i] - self.ends[j] >= 1.0 - 1e-9 {
j += 1;
}
if i - j + 1 > best {
(best, from) = (i - j + 1, self.ends[j]);
}
}
(best, from)
}
}
/// Frames of two pictures side by side, each `w` by `h` RGB: the area sample and the point sample of one frame.
pub struct FlashScreen {
w: usize,
h: usize,
last: Vec<u8>,
linear: Vec<f32>,
luma: Vec<Px>,
red: Vec<Px>,
cut: Vec<Px>,
windows: Vec<(usize, usize, Swings, Swings)>,
}
impl FlashScreen {
pub fn new(w: usize, h: usize) -> FlashScreen {
let (ww, wh) = (w / 3, h / 3);
let places = |size: usize, window: usize| {
let mut at: Vec<usize> = (0..=size - window).step_by((size / 6).max(1)).collect();
at.push(size - window);
at.dedup();
at
};
let mut windows = Vec::new();
for sample in 0..2 {
for &y in &places(h, wh) {
for &x in &places(w, ww) {
windows.push((x + sample * w, y, Swings::new(0.10, 0.80, false), Swings::new(20.0, f32::INFINITY, true)));
}
}
}
let linear = (0..=255u32)
.map(|c| {
let c = c as f32 / 255.0;
if c <= 0.04045 { c / 12.92 } else { ((c + 0.055) / 1.055).powf(2.4) }
})
.collect();
FlashScreen { w, h, last: Vec::new(), linear, luma: Vec::new(), red: Vec::new(), cut: Vec::new(), windows }
}
pub fn push(&mut self, rgb: &[u8], t: f64) {
if rgb == self.last {
return;
}
self.luma.clear();
self.red.clear();
for px in rgb.chunks_exact(3) {
let (r, g, b) = (self.linear[px[0] as usize], self.linear[px[1] as usize], self.linear[px[2] as usize]);
self.luma.push(Px { value: 0.2126 * r + 0.7152 * g + 0.0722 * b, counts: true });
let sum = r + g + b + 1e-9;
self.red.push(Px { value: ((r - g - b) * 320.0).max(0.0), counts: r / sum >= 0.8 });
}
let (stride, ww, wh) = (self.w * 2, self.w / 3, self.h / 3);
for (x, y, general, saturated) in &mut self.windows {
self.cut.clear();
for r in 0..wh {
self.cut.extend_from_slice(&self.luma[(*y + r) * stride + *x..][..ww]);
}
general.push(t, &self.cut);
self.cut.clear();
for r in 0..wh {
self.cut.extend_from_slice(&self.red[(*y + r) * stride + *x..][..ww]);
}
saturated.push(t, &self.cut);
}
self.last.clear();
self.last.extend_from_slice(rgb);
}
/// (swings in the worst second, when it starts, which measure) when past the limit
pub fn finish(mut self) -> Option<(usize, f64, &'static str)> {
let mut worst: Option<(usize, f64, &'static str)> = None;
for (_, _, general, saturated) in &mut self.windows {
for (swings, kind) in [(general, "general"), (saturated, "red")] {
let (n, from) = swings.busiest();
if n > FLASH_MOST && worst.is_none_or(|w| n > w.0) {
worst = Some((n, from, kind));
}
}
}
worst
}
}
#[cfg(test)]
mod tests;
+100
View File
@@ -0,0 +1,100 @@
use super::*;
/// a 96x54 picture drawn by `paint(frame index, sample, x, y)`, sample 0 the area sample and 1 the point sample, for
/// `frames` frames at `fps`
fn flash_samples(frames: usize, fps: f64, paint: impl Fn(usize, usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
let (w, h) = (96, 54);
let mut screen = FlashScreen::new(w, h);
for f in 0..frames {
let mut rgb = Vec::with_capacity(w * 2 * h * 3);
for y in 0..h {
for sample in 0..2 {
for x in 0..w {
rgb.extend_from_slice(&paint(f, sample, x, y));
}
}
}
screen.push(&rgb, f as f64 / fps);
}
screen.finish()
}
fn flash_of(seconds: usize, paint: impl Fn(usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
flash_samples(seconds * 60, 60.0, move |f, _, x, y| paint(f, x, y))
}
/// two colours taking turns `hz` times a second, over a box of the frame
fn turns(hz: usize, on: [u8; 3], off: [u8; 3], bx: (usize, usize, usize, usize)) -> Option<(usize, f64, &'static str)> {
flash_of(3, move |f, x, y| {
let inside = x >= bx.0 && x < bx.0 + bx.2 && y >= bx.1 && y < bx.1 + bx.3;
if inside && f * hz * 2 / 60 % 2 == 0 { on } else { off }
})
}
#[test]
fn flashing_is_found_past_three_a_second_and_not_at_it() {
let (white, black) = ([255, 255, 255], [0, 0, 0]);
let all = (0, 0, 96, 54);
assert_eq!(turns(3, white, black, all), None, "three a second is the limit, not past it");
let (swings, _, kind) = turns(4, white, black, all).expect("four a second");
assert_eq!((swings / 2, kind), (4, "general"));
// a small box: under a quarter of any window, and then over it
assert_eq!(turns(5, white, black, (40, 20, 10, 10)), None);
assert!(turns(5, white, black, (30, 18, 32, 18)).is_some());
// too small a change, and both ends too bright for WCAG to count it
assert_eq!(turns(5, [60, 60, 60], [30, 30, 30], all), None);
assert_eq!(turns(5, [255, 255, 255], [235, 235, 235], all), None);
// a dark saturated red: too dim to count as a general flash, past the limit as a red one
assert_eq!(turns(5, [150, 0, 0], black, all).map(|t| t.2), Some("red"));
}
#[test]
fn a_flash_of_single_frames_counts_at_any_frame_rate() {
// 120 fps with one white frame in every 30: four flashes a second, each gone within a sixtieth of a second
let found = flash_samples(360, 120.0, |f, _, _, _| if f % 30 == 1 { [255, 255, 255] } else { [0, 0, 0] });
assert_eq!(found.map(|(swings, _, kind)| (swings / 2, kind)), Some((4, "general")));
}
#[test]
fn a_flash_the_area_sample_averages_away_is_found_in_the_point_sample() {
let found = flash_samples(180, 60.0, |f, sample, _, _| {
if sample == 0 {
return [128, 128, 128];
}
if f * 5 * 2 / 60 % 2 == 0 { [255, 255, 255] } else { [0, 0, 0] }
});
assert!(found.is_some(), "the same flash in the point sample alone");
}
#[test]
fn a_shape_sliding_past_and_ordinary_cuts_are_not_flashing() {
let (white, black) = ([255, 255, 255], [0, 0, 0]);
assert_eq!(flash_of(3, move |f, x, _| if x < f { white } else { black }), None, "one wipe across the frame");
assert_eq!(flash_of(4, move |f, _, _| if (f / 30) % 2 == 0 { white } else { black }), None, "a cut every half second");
}
#[test]
fn a_patch_strobing_while_its_background_dims_is_still_found() {
// a third of a window: 0 then 124 on a 148 background, then the background settles at 124 and the patch cycles 124 and 160.
// The background's drop is under the 0.10 that counts, but it outweighs the patch in the window's mean.
let found = flash_samples(180, 60.0, |f, _, x, y| {
let patch = x < 16 && y < 12;
let level = match (patch, f) {
(true, 0) => 0,
(true, 1) => 124,
(true, _) => if (f - 2) * 5 * 2 / 60 % 2 == 0 { 160 } else { 124 },
(false, 0 | 1) => 148,
(false, _) => 124,
};
[level, level, level]
});
assert!(found.is_some(), "the patch flashes five times a second");
}
#[test]
fn a_colour_crossing_the_saturation_line_is_not_a_red_flash() {
// one level of green moves the pixel across R/(R+G+B) = 0.8 and hardly changes its red at all
let found = flash_samples(180, 60.0, |f, _, _, _| if f * 5 * 2 / 60 % 2 == 0 { [100, 49, 0] } else { [100, 50, 0] });
assert_eq!(found, None);
}
+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);
}
}
+21
View File
@@ -0,0 +1,21 @@
[package]
name = "raea-app-check-read"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "What `raea check` reads of a video: FFmpeg's probe, and raea's own decoders standing in for FFmpeg where it isn't installed"
[dependencies]
serde_json = "1"
raea-io-home = { path = "../../../io/home" }
raea-io-media = { path = "../../../io/media", default-features = false }
raea-app-media = { path = "../../media" }
# ffmpeg's flag for every decoded frame, by its version (the one read's flashing frames)
raea-io-ffmpeg = { path = "../../../io/ffmpeg" }
# caption contrast, as `raea world` measures it (DR2)
raea-sys-measure = { path = "../../../systems/measure" }
[target.'cfg(unix)'.dependencies]
# the one read's named pipes
libc = "0.2"
+219
View File
@@ -0,0 +1,219 @@
//! What `raea check` reads of a video: through FFmpeg where it's on the PATH (the reference its rules were tuned on),
//! else through raea's own decoders (raea-app-media), so `raea check` works wherever `raea media probe` and `raea media
//! loudness` do, with nothing to install. 0.1.7 refused any video without FFmpeg, which Windows never has (Shane 11-18:
//! "can we make it so ffmpeg does work the way we need it?"). RAEA_CHECK_NATIVE=1 reads natively with FFmpeg there too;
//! tests/parity.rs holds the two to the same answers. Each reader names the FFmpeg command it stands in for.
pub mod once;
pub use once::{log_level, showinfo_base, showinfo_frame};
use raea_io_media::VideoDecoder;
use serde_json::Value;
use std::path::Path;
use std::process::Command;
pub type R<T> = Result<T, String>;
/// Whether to read natively: FFmpeg's ffmpeg or ffprobe isn't on the PATH, or RAEA_CHECK_NATIVE is on
pub fn native() -> bool {
raea_io_home::env_on("RAEA_CHECK_NATIVE") || !(on_path("ffmpeg") && on_path("ffprobe"))
}
fn on_path(tool: &str) -> bool {
let exe = if cfg!(windows) { format!("{tool}.exe") } else { tool.to_string() };
std::env::var_os("PATH").is_some_and(|p| std::env::split_paths(&p).any(|d| d.join(&exe).is_file()))
}
fn open(video: &str) -> R<(Box<dyn VideoDecoder>, raea_io_media::Info)> {
let d = raea_app_media::open_video(Path::new(video))?;
let info = d.info().clone();
Ok((d, info))
}
/// A luma byte as FFmpeg's format=gray gives it from a limited-range picture: full range, 16-235 spread to 0-255 and
/// rounded (FFmpeg 9: 16 is 0, 126 is 128, 235 is 255)
fn gray(y: u8) -> u8 {
(((y.clamp(16, 235) as u32 - 16) * 255 + 109) / 219) as u8
}
/// What `raea check` needs to know of a video before it reads it
pub struct Probe {
pub w: f64,
pub h: f64,
pub duration: f64,
/// when the picture ends, on the clock FFmpeg's filters read: it starts at the file's first stream, sound can run on
/// past the picture, and the container's duration counts that
pub picture: f64,
pub audio: bool,
/// the picture's frames a second (0 when it doesn't say)
pub fps: f64,
}
/// The picture's size, the file's duration, where the picture ends and whether there's sound: ffprobe's stream and
/// format entries, or raea's own probe without FFmpeg
pub fn probe(video: &str) -> R<Probe> {
if native() {
let p = raea_app_media::probe_of(Path::new(video))?;
let v = p.video.as_ref().ok_or("no video stream")?;
let picture = p.track.as_ref().map_or(v.duration, |t| t.duration);
return Ok(Probe { w: v.width as f64, h: v.height as f64, duration: p.duration.max(picture), picture, audio: p.audio.is_some(), fps: v.fps });
}
let entries = "stream=codec_type,width,height,r_frame_rate,duration,start_time:format=duration,start_time";
let out = Command::new("ffprobe").args(["-v", "error", "-show_entries", entries, "-of", "json", video]).output().map_err(|e| format!("ffprobe: {e}"))?;
let v: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("ffprobe: {e}"))?;
let streams = v["streams"].as_array().cloned().unwrap_or_default();
let vid = streams.iter().find(|s| s["codec_type"] == "video").ok_or("no video stream")?;
let seconds = |field: &Value| -> Option<f64> { field.as_str()?.parse().ok() };
let duration = seconds(&v["format"]["duration"]).unwrap_or(0.0);
let origin = seconds(&v["format"]["start_time"]).unwrap_or(0.0);
let picture = match seconds(&vid["duration"]) {
Some(length) => seconds(&vid["start_time"]).unwrap_or(origin) - origin + length,
None => last_packet_end(video).map_or(duration, |end| end - origin),
};
let audio = streams.iter().any(|s| s["codec_type"] == "audio");
let fps = vid["r_frame_rate"].as_str().and_then(|r| {
let (n, d) = r.split_once('/').unwrap_or((r, "1"));
Some(n.parse::<f64>().ok()? / d.parse::<f64>().ok().filter(|d| *d > 0.0)?)
});
Ok(Probe { w: vid["width"].as_f64().unwrap_or(1920.0), h: vid["height"].as_f64().unwrap_or(1080.0), duration, picture, audio, fps: fps.unwrap_or(0.0) })
}
/// Where the picture's last packet ends, for a container that doesn't state the video stream's own length (Matroska)
fn last_packet_end(video: &str) -> Option<f64> {
let out = Command::new("ffprobe").args(["-v", "error", "-select_streams", "v:0", "-show_entries", "packet=pts_time,duration_time", "-of", "csv=p=0", video]).output().ok()?;
String::from_utf8_lossy(&out.stdout)
.lines()
.filter_map(|l| {
let mut parts = l.split(',');
let t: f64 = parts.next()?.trim().parse().ok()?;
Some(t + parts.next().and_then(|d| d.trim().parse::<f64>().ok()).unwrap_or(0.0))
})
.max_by(f64::total_cmp)
}
/// `ffmpeg -i V -vf scale=32:18:flags=area,format=gray -f rawvideo -` averaged a frame, and the rate `ffmpeg -i` says
/// (defects.rs lumas): each frame's mean light, 0 to 1, and the frames a second
pub fn lumas(video: &str) -> R<(Vec<f32>, f64)> {
let (mut d, info) = open(video)?;
let mut out = Vec::new();
for (_, at) in raea_app_media::frames_of(Path::new(video), &info, None, None) {
let (y, ..) = raea_app_media::yuv(d.frame_nv12_at(at)?);
out.push(y.iter().map(|&p| gray(p) as f32).sum::<f32>() / (y.len().max(1) as f32 * 255.0));
}
Ok((out, raea_app_media::standard_fps(info.fps)))
}
/// `ffmpeg -i V -vf fps=0.5,crop=W:H:0:0,format=gray -f rawvideo -` (picture.rs blotching): every 2 s, the picture's
/// top-left W x H in grey
pub fn crops(video: &str, w: usize, h: usize, mut each: impl FnMut(&[u8])) -> R<()> {
let (mut d, info) = open(video)?;
let frames = raea_app_media::frames_of(Path::new(video), &info, None, None);
for (tick, _) in raea_app_media::times(raea_app_media::video_span(Path::new(video), &info), None, None, 0.5) {
// the last frame before the tick's middle, as the fps filter picks it (by the frames' own times: a read at the
// middle less a microsecond came back a frame late)
let Some(&(_, at)) = frames.iter().take_while(|(pts, _)| *pts < tick + 1.0).last() else { continue };
let f = d.frame_nv12_at(at)?;
let fw = f.width as usize;
let (y, ..) = raea_app_media::yuv(f);
let crop: Vec<u8> = (0..h.min(y.len() / fw.max(1))).flat_map(|r| y[r * fw..r * fw + w.min(fw)].iter().map(|&p| gray(p))).collect();
each(&crop);
}
Ok(())
}
/// flash.rs's graph (showinfo, the picture at W x H area-sampled beside it point-sampled, rgb24): every frame with
/// its time, until `each` says stop. How many frames were read.
pub fn flash_frames(video: &str, w: usize, h: usize, mut each: impl FnMut(f64, &[u8])) -> R<usize> {
let (mut d, info) = open(video)?;
let mut buf = vec![0u8; w * 2 * h * 3];
let mut n = 0;
for (pts, at) in raea_app_media::frames_of(Path::new(video), &info, None, None) {
let f = d.frame_at(at)?;
let (sw, sh) = (f.width as usize, f.height as usize);
for y in 0..h {
let (y0, y1) = (y * sh / h, ((y + 1) * sh / h).max(y * sh / h + 1));
for x in 0..w {
let (x0, x1) = (x * sw / w, ((x + 1) * sw / w).max(x * sw / w + 1));
let mut sum = [0u32; 3];
for sy in y0..y1 {
for p in f.rgba[(sy * sw + x0) * 4..(sy * sw + x1) * 4].chunks_exact(4) {
(0..3).for_each(|c| sum[c] += p[c] as u32);
}
}
let count = ((y1 - y0) * (x1 - x0)) as u32;
let near = ((y * sh + sh / 2) / h * sw + (x * sw + sw / 2) / w) * 4;
for c in 0..3 {
buf[(y * w * 2 + x) * 3 + c] = ((sum[c] + count / 2) / count) as u8;
buf[(y * w * 2 + w + x) * 3 + c] = f.rgba[near + c];
}
}
}
each(pts, &buf);
n += 1;
}
Ok(n)
}
/// `ffmpeg -i V -vn -ac 1 -ar RATE -f f32le -` (sound.rs sound): the sound folded to mono at `rate`
pub fn mono(video: &str, rate: u32) -> R<Vec<f32>> {
if native() {
return Ok(raea_app_media::audio_folded(Path::new(video), rate, true, None, None, false)?.channels.swap_remove(0));
}
ffmpeg_f32(video, 1, rate)
}
/// `ffmpeg -i V -vn -ac N -ar R -f f32le -`: the sound as N interleaved channels of floats
fn ffmpeg_f32(video: &str, channels: u32, rate: u32) -> R<Vec<f32>> {
let out = Command::new("ffmpeg").args(["-v", "error", "-i", video, "-vn", "-ac", &channels.to_string(), "-ar", &rate.to_string(), "-f", "f32le", "-"]).output().map_err(|e| format!("ffmpeg: {e}"))?;
if !out.status.success() {
return Err(format!("ffmpeg couldn't read the sound of {video}: {}", String::from_utf8_lossy(&out.stderr).trim()));
}
Ok(out.stdout.chunks_exact(4).map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect())
}
/// `ffmpeg -i V -vn -ac 2 -ar R -f f32le -` (defects.rs clipping): each channel at its own level. Clipping is a
/// channel's: on the mono fold (L + R) * 0.707 a centred voice reads 3 dB hotter than either side, and a master at
/// -1.6 dBTP read as full scale (11-19, the walkaround's flat tops).
pub fn channels(video: &str, rate: u32) -> R<Vec<Vec<f32>>> {
if native() {
return Ok(raea_app_media::audio_folded(Path::new(video), rate, false, None, None, false)?.channels);
}
let x = ffmpeg_f32(video, 2, rate)?;
Ok(vec![x.iter().step_by(2).copied().collect(), x.iter().skip(1).step_by(2).copied().collect()])
}
/// `ffmpeg -i V -vn -af ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=- -f null -` (sound.rs sound): the
/// momentary loudness (400 ms) every 100 ms, each time and its LUFS
pub fn meter(video: &str) -> R<(Vec<f64>, Vec<f64>)> {
let a = raea_app_media::audio_folded(Path::new(video), raea_io_media::audio::RATE, false, None, None, false)?;
let n = (a.duration() * 10.0).floor() as usize;
Ok(((0..n).map(|i| i as f64 / 10.0).collect(), raea_io_media::audio::momentary(&a, 10.0, n)))
}
/// `ffmpeg -i V -an -vf freezedetect=n=NOISE_DB:d=MIN -f null -`'s log (sound.rs freezes reads it either way)
pub fn freezes(video: &str, noise_db: f64, min: f64) -> R<String> {
let found = raea_app_media::freezes(Path::new(video), 10f64.powf(noise_db / 20.0), min)?;
Ok(found.into_iter().map(|(s, end)| match end {
Some((d, e)) => format!("freeze_start: {s}\nfreeze_duration: {d}\nfreeze_end: {e}\n"),
None => format!("freeze_start: {s}\n"),
}).collect())
}
/// raea_sys_measure::contrast's read (`ffmpeg -ss AT -i V -frames:v 1 -vf crop=... -pix_fmt rgb24`): a text's contrast
/// against what's behind it, None when the crop falls outside the frame
pub fn contrast(video: &str, at: f64, crop: [u32; 4], color: &str) -> Option<f64> {
let [x, y, w, h] = [crop[0] & !1, crop[1] & !1, crop[2].max(2) & !1, crop[3].max(2) & !1].map(|v| v as usize);
let (mut d, _) = open(video).ok()?;
let f = d.frame_at(at).ok()?;
let fw = f.width as usize;
if x + w > fw || y + h > f.height as usize {
return None;
}
let rgb: Vec<u8> = (y..y + h).flat_map(|r| f.rgba[(r * fw + x) * 4..(r * fw + x + w) * 4].chunks_exact(4).flat_map(|p| [p[0], p[1], p[2]]).collect::<Vec<_>>()).collect();
raea_sys_measure::ratio_behind(&rgb, raea_sys_measure::lum(raea_sys_measure::rgb_of(color)))
}
/// raea_sys_measure::loudness's read (`ffmpeg -i V -vn -af ebur128=peak=true -f null -`): the integrated loudness and
/// true peak, None when there's no sound
pub fn loudness(video: &str) -> Option<(f64, Option<f64>)> {
let a = raea_app_media::audio_folded(Path::new(video), raea_io_media::audio::RATE, false, None, None, false).ok().filter(|a| a.len() > 0)?;
Some((raea_io_media::audio::lufs(&a), Some(raea_io_media::audio::true_peak_db(&a))))
}
+205
View File
@@ -0,0 +1,205 @@
//! The picture read once for four of raea check's rules (11-19: flashing, freezes, flash frames and blotching each
//! decoded the whole file, 3.7 s apiece on a 56 s export, and decoding is the machine's whole CPU, so reading them at
//! the same time saved nothing). One FFmpeg decodes it and splits the frames into the four filter chains the rules
//! were tuned on, each to its own output with its own options as when it ran alone, so each rule reads the same bytes:
//!
//! - the flashing screen's area- and point-sampled frames (showinfo, rgb24, passthrough) to stdout, their times on stderr;
//! - freezedetect into a null output, its findings on stderr;
//! - each frame's 32x18 grey (the flash-frame rule) to a named pipe;
//! - every 2 s the grey crop blotching scores, to another.
//!
//! Unix only (named pipes); elsewhere, and where FFmpeg isn't installed, the rules read on their own as before.
#[cfg(unix)]
use std::io::{BufRead, Read};
#[cfg(unix)]
use std::path::Path;
#[cfg(unix)]
use std::process::{Command, Stdio};
use crate::R;
/// What the one read gave the rules beside the frames it handed on
pub struct Once {
/// the flashing screen's frames read, and whether one came without its time (the read was stopped)
pub frames: usize,
pub lost: bool,
/// FFmpeg ran to its end
pub ok: bool,
/// errors decoding the picture, and the first of them
pub errors: usize,
pub first: String,
/// freezedetect's lines
pub freezes: String,
/// each frame's mean brightness, 0 to 1 (defects.rs lumas)
pub lumas: Vec<f32>,
}
/// A frame's number and time from showinfo's log, exact: its `pts` in ticks of the time base. `pts_time` is rounded to six
/// significant digits, which is enough to push a legal third flash across the one-second line.
pub fn showinfo_frame(line: &str, base: Option<(i64, i64)>) -> Option<(usize, f64)> {
let rest = line.split(" n:").nth(1)?;
let n = rest.split_whitespace().next()?.parse().ok()?;
let pts: i64 = rest.split("pts:").nth(1)?.split_whitespace().next()?.parse().ok()?;
let (num, den) = base?;
Some((n, pts as f64 * num as f64 / den as f64))
}
pub fn showinfo_base(line: &str) -> Option<(i64, i64)> {
let (num, den) = line.split("config in time_base:").nth(1)?.split(',').next()?.trim().split_once('/')?;
Some((num.parse().ok()?, den.parse().ok()?))
}
/// A line's severity under `-loglevel level+`: the first bracket after any `[context @ address]`. Searching the whole line
/// would take a file's own metadata for an error when its title happens to say one.
pub fn log_level(line: &str) -> Option<&str> {
let mut rest = line.trim_start();
if rest.starts_with('[') && rest[..rest.find(']')?].contains(" @ ") {
rest = rest[rest.find(']')? + 1..].trim_start();
}
let rest = rest.strip_prefix('[')?;
Some(&rest[..rest.find(']')?])
}
/// Each 32x18 grey frame's mean brightness, 0 to 1 (`scale=32:18:flags=area,format=gray`, defects.rs lumas)
pub fn lumas_of(grey: &[u8]) -> Vec<f32> {
let mut out = Vec::with_capacity(grey.len() / (32 * 18));
for f in grey.as_chunks::<{ 32 * 18 }>().0 {
let mut sum = 0f32;
for &p in f {
sum += p as f32;
}
out.push(sum / (32.0 * 18.0 * 255.0));
}
out
}
/// Whether the four rules can read in one: FFmpeg is the reader, and the system has named pipes
pub fn can() -> bool {
cfg!(unix) && !crate::native()
}
/// The one read: the flashing screen's frames (`flash`, w x h each side) to `screen` with their times, the grey crop
/// (`crop`, w x h; None when blotching doesn't read) every 2 s to `crops`, freezedetect at `still` seconds
#[cfg(not(unix))]
pub fn picture(_: &str, _: (usize, usize), _: Option<(usize, usize)>, _: f64, _: impl FnMut(f64, &[u8]) + Send, _: impl FnMut(&[u8]) + Send) -> R<Once> {
Err("one read needs named pipes".into())
}
#[cfg(unix)]
pub fn picture(video: &str, flash: (usize, usize), crop: Option<(usize, usize)>, still: f64, mut screen: impl FnMut(f64, &[u8]) + Send, mut crops: impl FnMut(&[u8]) + Send) -> R<Once> {
let dir = std::env::temp_dir().join(format!("raea-once-{}-{}", std::process::id(), std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |d| d.as_nanos())));
std::fs::create_dir_all(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
let (lumas_at, crops_at) = (dir.join("lumas"), dir.join("crops"));
let read = (|| {
fifo(&lumas_at)?;
if crop.is_some() {
fifo(&crops_at)?;
}
let (w, h) = flash;
let mut graph = format!(
"[0:v:0]split={}[f][z][l]{};[f]showinfo,split=2[area][point];[area]scale={w}:{h}:flags=area[a];[point]scale={w}:{h}:flags=neighbor[p];[a][p]hstack=inputs=2,format=rgb24[fo];[z]freezedetect=n=-60dB:d={still}[zo];[l]scale=32:18:flags=area,format=gray[lo]",
if crop.is_some() { 4 } else { 3 },
if crop.is_some() { "[b]" } else { "" }
);
if let Some((cw, ch)) = crop {
graph.push_str(&format!(";[b]fps=0.5,crop={cw}:{ch}:0:0,format=gray[bo]"));
}
let sync = raea_io_ffmpeg::passthrough();
let mut args: Vec<String> = ["-hide_banner", "-nostats", "-nostdin", "-y", "-loglevel", "level+info", "-i", video, "-filter_complex", &graph].map(String::from).to_vec();
args.extend(["-map", "[fo]", sync[0], sync[1], "-f", "rawvideo", "pipe:1", "-map", "[zo]", "-f", "null", "-", "-map", "[lo]", "-f", "rawvideo"].map(String::from));
args.push(lumas_at.display().to_string());
if crop.is_some() {
args.extend(["-map", "[bo]", "-f", "rawvideo"].map(String::from));
args.push(crops_at.display().to_string());
}
let mut child = Command::new("ffmpeg").args(&args).stdin(Stdio::null()).stdout(Stdio::piped()).stderr(Stdio::piped()).spawn().map_err(|e| format!("ffmpeg: {e}"))?;
let (mut out, err) = (child.stdout.take().unwrap(), child.stderr.take().unwrap());
let (times, clock) = std::sync::mpsc::channel();
std::thread::scope(|s| {
// each output read apart from the others, so that none can fill while another is being waited on
let log = s.spawn(move || {
let (mut err, mut line) = (std::io::BufReader::new(err), Vec::new());
let (mut base, mut errors, mut first, mut freezes) = (None, 0usize, String::new(), String::new());
while err.read_until(b'\n', &mut line).is_ok_and(|n| n > 0) {
let text = String::from_utf8_lossy(&line);
if matches!(log_level(&text), Some("error" | "fatal" | "panic")) {
errors += 1;
if first.is_empty() {
first = text.trim().to_string();
}
} else if text.trim_start().starts_with("[Parsed_showinfo") {
base = showinfo_base(&text).or(base);
if let Some(frame) = showinfo_frame(&text, base) {
let _ = times.send(frame);
}
} else if text.contains("freezedetect") {
freezes.push_str(&text);
}
line.clear();
}
(errors, first, freezes)
});
let lumas = s.spawn(|| {
let mut b = Vec::new();
let _ = std::fs::File::open(&lumas_at).and_then(|mut f| f.read_to_end(&mut b));
lumas_of(&b)
});
let crop_reader = crop.map(|(cw, ch)| {
let at = &crops_at;
let crops = &mut crops;
s.spawn(move || {
if let Ok(mut f) = std::fs::File::open(at) {
let mut buf = vec![0u8; cw * ch];
while f.read_exact(&mut buf).is_ok() {
crops(&buf);
}
}
})
});
let mut buf = vec![0u8; w * 2 * h * 3];
let (mut frames, mut lost) = (0usize, false);
while out.read_exact(&mut buf).is_ok() {
// the frame's own line is written before its pixels, so one that doesn't come isn't going to
match clock.recv_timeout(std::time::Duration::from_secs(60)) {
Ok((n, t)) if n == frames => screen(t, &buf),
_ => {
lost = true;
let _ = child.kill();
break;
}
}
frames += 1;
}
drop(out);
let ok = child.wait().is_ok_and(|s| s.success());
// a pipe FFmpeg never opened (it stopped first) would hold its reader in open(): opening it to write lets go
for p in [&lumas_at, &crops_at] {
let _ = unblock(p);
}
let (errors, first, freezes) = log.join().unwrap_or_default();
let lumas = lumas.join().unwrap_or_default();
if let Some(c) = crop_reader {
let _ = c.join();
}
Ok(Once { frames, lost, ok, errors, first, freezes, lumas })
})
})();
let _ = std::fs::remove_dir_all(&dir);
read
}
#[cfg(unix)]
fn fifo(p: &Path) -> R<()> {
let c = std::ffi::CString::new(p.as_os_str().as_encoded_bytes()).map_err(|e| e.to_string())?;
// SAFETY: a NUL-terminated path, and mkfifo reads nothing else
if unsafe { libc::mkfifo(c.as_ptr(), 0o600) } != 0 {
return Err(format!("{}: {}", p.display(), std::io::Error::last_os_error()));
}
Ok(())
}
#[cfg(unix)]
fn unblock(p: &Path) -> std::io::Result<()> {
use std::os::unix::fs::OpenOptionsExt;
std::fs::OpenOptions::new().write(true).custom_flags(libc::O_NONBLOCK).open(p).map(drop)
}
+165
View File
@@ -0,0 +1,165 @@
//! Each native reader against the FFmpeg read it stands in for (lib.rs names the command), on a clip FFmpeg makes: a
//! moving test picture that freezes for its last 4 s, over stereo sound whose level swells. `raea check` without FFmpeg
//! must reach the verdicts it reaches with it, so each answer is held to FFmpeg's within what a rule could notice.
//! Skipped where FFmpeg isn't installed (there is nothing to compare against).
use std::path::Path;
use std::process::Command;
fn ffmpeg(args: &[&str]) -> (Vec<u8>, String) {
let out = Command::new("ffmpeg").args(["-hide_banner", "-nostats", "-nostdin"]).args(args).output().expect("ffmpeg runs");
assert!(out.status.success(), "ffmpeg {args:?}: {}", String::from_utf8_lossy(&out.stderr));
(out.stdout, String::from_utf8_lossy(&out.stderr).into_owned())
}
fn clip(dir: &Path) -> String {
let file = dir.join("clip.mp4").to_string_lossy().into_owned();
let picture = "testsrc2=size=320x180:rate=30:duration=5,tpad=stop_mode=clone:stop_duration=4";
let sound = "aevalsrc=0.4*sin(2*PI*440*t)*(0.55+0.45*sin(2*PI*0.25*t))|0.25*sin(2*PI*660*t):s=48000:d=9";
ffmpeg(&["-y", "-f", "lavfi", "-i", picture, "-f", "lavfi", "-i", sound, "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "aac", "-b:a", "192k", "-shortest", &file]);
file
}
/// The mean absolute difference of two byte runs, in levels
fn apart(a: &[u8], b: &[u8]) -> f64 {
a.iter().zip(b).map(|(x, y)| x.abs_diff(*y) as u64).sum::<u64>() as f64 / a.len().max(1) as f64
}
/// Root-mean-square level in dB of each 100 ms of `x` at `rate`
fn levels(x: &[f32], rate: usize) -> Vec<f64> {
x.chunks_exact(rate / 10).map(|c| 10.0 * (c.iter().fold(0.0, |s, v| s + v * v) as f64 / c.len() as f64 + 1e-12).log10()).collect()
}
/// Each measure's name, how far the native read is from FFmpeg's, and how far it may be: all printed, then held
struct Off(Vec<(String, f64, f64)>);
impl Off {
fn by(&mut self, what: impl Into<String>, off: f64, most: f64) {
self.0.push((what.into(), off, most));
}
}
#[test]
fn the_native_reads_match_ffmpeg_s() {
if Command::new("ffmpeg").arg("-version").output().is_err() {
eprintln!("skipped: no FFmpeg to compare against");
return;
}
let dir = std::env::temp_dir().join(format!("raea-check-read-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let v = &clip(&dir);
let mut off = Off(vec![]);
let by_ffmpeg = raea_app_check_read::probe(v).unwrap();
// SAFETY: set before any reader runs, on this test's only thread
unsafe { std::env::set_var("RAEA_CHECK_NATIVE", "1") };
assert!(raea_app_check_read::native());
let p = raea_app_check_read::probe(v).unwrap();
assert_eq!((p.w, p.h, p.audio), (by_ffmpeg.w, by_ffmpeg.h, by_ffmpeg.audio));
assert!((p.duration - by_ffmpeg.duration).abs() < 0.05 && (p.picture - by_ffmpeg.picture).abs() < 0.05, "{} {} vs {} {}", p.duration, p.picture, by_ffmpeg.duration, by_ffmpeg.picture);
// flash-frame's light per frame
let (gray, _) = ffmpeg(&["-v", "error", "-i", v, "-map", "0:v:0", "-vf", "scale=32:18:flags=area,format=gray", "-f", "rawvideo", "-"]);
let theirs: Vec<f64> = gray.chunks_exact(32 * 18).map(|f| f.iter().map(|&b| b as f64).sum::<f64>() / (32.0 * 18.0 * 255.0)).collect();
let (ours, fps) = raea_app_check_read::lumas(v).unwrap();
assert_eq!((ours.len(), fps), (theirs.len(), 30.0));
off.by("a frame's light, of 1", ours.iter().zip(&theirs).map(|(a, b)| (*a as f64 - b).abs()).fold(0.0, f64::max), 0.01);
// blotching's dark crops every 2 s
let (w, h) = (320, 176);
let (gray, _) = ffmpeg(&["-v", "error", "-i", v, "-vf", &format!("fps=0.5,crop={w}:{h}:0:0,format=gray"), "-f", "rawvideo", "-"]);
let mut crops = vec![];
raea_app_check_read::crops(v, w, h, |c| crops.push(c.to_vec())).unwrap();
assert_eq!(crops.len(), gray.len() / (w * h));
for (i, (a, b)) in crops.iter().zip(gray.chunks_exact(w * h)).enumerate() {
let bias = a.iter().zip(b).map(|(x, y)| *x as f64 - *y as f64).sum::<f64>() / a.len() as f64;
off.by(format!("blotching crop {i}, levels (bias {bias:+.2})"), apart(a, b), 3.0);
}
// the flashing screen's frames: area-sampled beside point-sampled RGB
let (fw, fh) = (192, 108);
let graph = format!("split=2[area][point];[area]scale={fw}:{fh}:flags=area[a];[point]scale={fw}:{fh}:flags=neighbor[b];[a][b]hstack=inputs=2,format=rgb24");
let (rgb, _) = ffmpeg(&["-v", "error", "-i", v, "-map", "0:v:0", "-vf", &graph, "-f", "rawvideo", "-"]);
let (mut frames, mut times) = (vec![], vec![]);
let n = raea_app_check_read::flash_frames(v, fw, fh, |t, buf| {
times.push(t);
frames.push(buf.to_vec());
})
.unwrap();
assert_eq!(n, rgb.len() / (fw * 2 * fh * 3));
assert!(times.windows(2).all(|t| (t[1] - t[0] - 1.0 / 30.0).abs() < 1e-3), "frame times step by a frame");
off.by("a flash frame, levels", frames.iter().zip(rgb.chunks_exact(fw * 2 * fh * 3)).map(|(a, b)| apart(a, b)).fold(0.0, f64::max), 6.0);
// the sound folded to mono, 100 ms at a time
let (pcm, _) = ffmpeg(&["-v", "error", "-i", v, "-vn", "-ac", "1", "-ar", "24000", "-f", "f32le", "-"]);
let theirs = levels(&pcm.chunks_exact(4).map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect::<Vec<_>>(), 24000);
let ours = levels(&raea_app_check_read::mono(v, 24000).unwrap(), 24000);
assert!(ours.len().abs_diff(theirs.len()) <= 1, "{} windows vs {}", ours.len(), theirs.len());
off.by("100 ms of mono sound, dB", ours.iter().zip(&theirs).skip(1).map(|(a, b)| (a - b).abs()).fold(0.0, f64::max), 0.5);
// momentary loudness every 100 ms
let (log, _) = ffmpeg(&["-i", v, "-vn", "-af", "ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=-", "-f", "null", "-"]);
let theirs: Vec<f64> = String::from_utf8_lossy(&log).lines().filter_map(|l| l.strip_prefix("lavfi.r128.M=")?.trim().parse().ok()).collect();
let (at, ours) = raea_app_check_read::meter(v).unwrap();
assert!(ours.len().abs_diff(theirs.len()) <= 2 && at.len() == ours.len(), "{} readings vs {}", ours.len(), theirs.len());
off.by("a momentary loudness, LU", ours.iter().zip(&theirs).skip(4).map(|(a, b)| (a - b).abs()).fold(0.0, f64::max), 0.5);
// the freeze: 5 s in, to the end
let (_, log) = ffmpeg(&["-i", v, "-an", "-vf", "freezedetect=n=-60dB:d=3", "-f", "null", "-"]);
let starts = |log: &str| log.lines().filter_map(|l| l.split("freeze_start: ").nth(1)?.trim().parse::<f64>().ok()).collect::<Vec<_>>();
let (theirs, ours) = (starts(&log), starts(&raea_app_check_read::freezes(v, -60.0, 3.0).unwrap()));
assert!(ours.len() == 1 && theirs.len() == 1, "freezes from {ours:?} vs {theirs:?}");
off.by("the freeze's start, s", (ours[0] - theirs[0]).abs(), 0.1);
// the mix's loudness and a caption's contrast, against raea-sys-measure's FFmpeg reads
let (i, tp) = raea_app_check_read::loudness(v).unwrap();
let (fi, ftp) = raea_sys_measure::loudness(Path::new(v)).unwrap();
off.by("integrated loudness, LU", (i - fi).abs(), 0.3);
off.by("true peak, dB", (tp.unwrap() - ftp.unwrap()).abs(), 0.5);
let ours = raea_app_check_read::contrast(v, 1.0, [40, 60, 120, 60], "rgb(255, 255, 255)").unwrap();
let theirs = raea_sys_measure::contrast(Path::new(v), 1.0, [40, 60, 120, 60], "rgb(255, 255, 255)").unwrap();
off.by("a caption's contrast, share", (ours / theirs - 1.0).abs(), 0.05);
let _ = std::fs::remove_dir_all(&dir);
for (what, by, most) in &off.0 {
eprintln!("{} {what}: {by:.4} (at most {most})", if by < most { "ok " } else { "OVER" });
}
assert!(off.0.iter().all(|(_, by, most)| by < most), "a native read is further from FFmpeg's than a rule allows");
}
/// The one read (once.rs) against the four reads it stands in for, each run alone as raea check ran it: each rule gets
/// the same bytes, frames and log lines. Away from Unix the rules read alone (no named pipes), and this is skipped.
#[test]
fn one_read_gives_each_rule_what_its_own_read_gave() {
if !raea_app_check_read::once::can() {
eprintln!("skipped: the rules read alone here");
return;
}
let dir = std::env::temp_dir().join(format!("raea-once-test-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let file = dir.join("clip.mp4").to_string_lossy().into_owned();
ffmpeg(&["-y", "-f", "lavfi", "-i", "testsrc2=size=320x180:rate=30:duration=5,tpad=stop_mode=clone:stop_duration=4", "-c:v", "libx264", "-pix_fmt", "yuv420p", &file]);
let (w, h, cw, ch) = (192usize, 108usize, 320usize, 176usize);
let (mut frames, mut crops) = (Vec::new(), Vec::new());
let once = raea_app_check_read::once::picture(&file, (w, h), Some((cw, ch)), 3.0, |t, b| frames.push((t, b.to_vec())), |b| crops.extend_from_slice(b)).unwrap();
assert!(once.ok && !once.lost && once.errors == 0);
// the flashing screen's frames, as flash.rs read them alone
let sync = raea_io_ffmpeg::passthrough();
let graph = format!("showinfo,split=2[area][point];[area]scale={w}:{h}:flags=area[a];[point]scale={w}:{h}:flags=neighbor[b];[a][b]hstack=inputs=2,format=rgb24");
let (alone, log) = ffmpeg(&["-loglevel", "level+info", "-i", &file, "-map", "0:v:0", "-vf", &graph, sync[0], sync[1], "-f", "rawvideo", "-"]);
assert_eq!(frames.len(), alone.len() / (w * 2 * h * 3));
assert_eq!(frames.iter().flat_map(|f| f.1.iter().copied()).collect::<Vec<u8>>(), alone);
let base = log.lines().find_map(raea_app_check_read::showinfo_base);
let times: Vec<f64> = log.lines().filter(|l| l.trim_start().starts_with("[Parsed_showinfo")).filter_map(|l| raea_app_check_read::showinfo_frame(l, base)).map(|f| f.1).collect();
assert_eq!(frames.iter().map(|f| f.0).collect::<Vec<f64>>(), times);
// each frame's brightness, as defects.rs read it
let (grey, _) = ffmpeg(&["-v", "error", "-i", &file, "-map", "0:v:0", "-vf", "scale=32:18:flags=area,format=gray", "-f", "rawvideo", "-"]);
assert_eq!(once.lumas, raea_app_check_read::once::lumas_of(&grey));
// blotching's crops, as picture.rs read them
let (alone, _) = ffmpeg(&["-v", "error", "-i", &file, "-vf", &format!("fps=0.5,crop={cw}:{ch}:0:0,format=gray"), "-f", "rawvideo", "-"]);
assert_eq!(crops, alone);
// and freezedetect's freeze, as sound.rs read it
let (_, log) = ffmpeg(&["-i", &file, "-an", "-vf", "freezedetect=n=-60dB:d=3", "-f", "null", "-"]);
let starts = |s: &str| s.lines().filter_map(|l| l.split("freeze_start: ").nth(1).map(|x| x.trim().to_string())).collect::<Vec<_>>();
assert_eq!(starts(&once.freezes), starts(&log));
assert!(!starts(&log).is_empty());
let _ = std::fs::remove_dir_all(&dir);
}
+171
View File
@@ -0,0 +1,171 @@
use super::*;
/// The defects Fingerprint's axes map to that a measure finds exactly (docs/fingerprint.feature FP4c), so the check
/// wins over a head: clipping, a dropout, and a flash frame. Each on the same decoded sound or a small grey picture;
/// each with red-team cases in tests.rs (a loud clean tone, a faded pause, a cut).
///
/// Clipping: a run of 3 samples or more at full scale (|x| 0.999 or more), or a flat top: 4 or more samples the same
/// to the bit at a level a sound rarely holds still at (0.05 or more), as a hard limiter or a clamp leaves them.
/// Counted per second; a second with CLIP_RUNS runs or more is a finding.
pub(crate) const FULL: f32 = 0.999;
pub(crate) const FLAT_LEVEL: f32 = 0.05;
pub(crate) const CLIP_RUNS: usize = 3;
pub(crate) fn clipped(channels: &[Vec<f32>]) -> Vec<(f64, String)> {
let len = channels.iter().map(Vec::len).max().unwrap_or(0);
let mut per: Vec<usize> = vec![0; len / SR + 1];
// each channel's runs, a second's count the most any channel had: clipping is a channel's
for x in channels {
let mut own: Vec<usize> = vec![0; len / SR + 1];
let mut i = 0;
while i < x.len() {
let v = x[i];
let mut j = i + 1;
if v.abs() >= FULL {
while j < x.len() && x[j].abs() >= FULL && x[j].signum() == v.signum() {
j += 1;
}
if j - i >= 3 {
own[i / SR] += 1;
}
} else if v.abs() >= FLAT_LEVEL {
while j < x.len() && x[j].to_bits() == v.to_bits() {
j += 1;
}
if j - i >= 4 {
own[i / SR] += 1;
}
}
i = j;
}
for (p, o) in per.iter_mut().zip(own) {
*p = (*p).max(o);
}
}
let mut out = Vec::new();
let mut s = 0;
while s < per.len() {
if per[s] < CLIP_RUNS {
s += 1;
continue;
}
let mut e = s;
while e + 1 < per.len() && per[e + 1] >= CLIP_RUNS {
e += 1;
}
let runs: usize = per[s..=e].iter().sum();
out.push((s as f64, format!("the sound clips: {runs} flat-topped runs over {} s; bring the level down before it hits the ceiling", e - s + 1)));
s = e + 1;
}
out
}
/// A dropout: the sound falls from level (-45 dBFS or more) to digital silence (under -80 dBFS) in one 10 ms step and
/// comes back within two, to within 10 dB of where it was, 50 ms to 3 s later. A pause that fades out or in isn't one.
pub(crate) const SILENT: f64 = -80.0;
pub(crate) const HAD_LEVEL: f64 = -45.0;
pub(crate) fn dropouts(x: &[f32]) -> Vec<(f64, String)> {
let rms: Vec<f64> = x.as_chunks::<HOP>().0.iter().map(|f| crate::sound::db(f)).collect();
let step = HOP as f64 / SR as f64;
let mut out = Vec::new();
let mut i = 1;
while i < rms.len() {
// a step that is silent, or nearly (the source cut partway through it), after one with level
if !(rms[i] < HAD_LEVEL - 20.0 && rms[i - 1] >= HAD_LEVEL) {
i += 1;
continue;
}
let mut j = i + 1;
while j < rms.len() && rms[j] < SILENT {
j += 1;
}
let gap = (j - i) as f64 * step;
let silent_inside = j > i + 1;
// back at once: within two steps, to within 10 dB of the level before the gap (a fade in takes longer)
let before = rms[i - 1];
let back = rms[j.min(rms.len())..(j + 2).min(rms.len())].iter().any(|l| *l >= HAD_LEVEL.max(before - 10.0));
if silent_inside && back && (0.05..=3.0).contains(&gap) {
out.push((i as f64 * step, format!("the sound drops out for {:.2} s and comes back; a dropout, not a pause (no fade either side)", gap)));
}
i = j.max(i + 1);
}
out
}
/// A flash frame: one or two frames whose mean brightness differs from the frames either side by FLASH_STEP or more
/// (0-1), while those two agree within FLASH_SAME: a black or white frame dropped into a shot. A cut (the brightness
/// moves and stays) and a fade aren't flash frames.
pub(crate) const FLASH_STEP: f32 = 0.25;
pub(crate) const FLASH_SAME: f32 = 0.08;
pub(crate) fn flash_frames(luma: &[f32], fps: f64) -> Vec<(f64, String)> {
let mut out = Vec::new();
let mut i = 1;
while i + 1 < luma.len() {
let found = (1..=2).find(|&k| {
let (before, after) = (luma[i - 1], luma.get(i + k - 1 + 1).copied());
let Some(after) = after else { return false };
(before - after).abs() <= FLASH_SAME && luma[i..i + k].iter().all(|&l| (l - before).abs() >= FLASH_STEP && (l - after).abs() >= FLASH_STEP)
});
match found {
Some(k) => {
out.push((i as f64 / fps, format!("{k} frame{} flash{} {} in the middle of a shot; a dropped or stray frame", if k == 1 { "" } else { "s" }, if k == 1 { "es" } else { "" }, if luma[i] < luma[i - 1] { "dark" } else { "bright" })));
i += k + 1;
}
None => i += 1,
}
}
out
}
/// Each frame's mean brightness (0-1), decoded small and grey
fn lumas(video: &str) -> R<(Vec<f32>, f64)> {
if crate::read::native() {
return crate::read::lumas(video);
}
let out = Command::new("ffmpeg")
.args(["-v", "error", "-nostdin", "-i", video, "-map", "0:v:0", "-vf", "scale=32:18:flags=area,format=gray", "-f", "rawvideo", "-"])
.output()
.map_err(|e| format!("ffmpeg: {e}"))?;
if !out.status.success() {
return Err(format!("ffmpeg couldn't read the picture of {video}: {}", String::from_utf8_lossy(&out.stderr).trim()));
}
Ok((crate::read::once::lumas_of(&out.stdout), ffmpeg_rate(video)?))
}
/// The frame rate `ffmpeg -i` says
pub(crate) fn ffmpeg_rate(video: &str) -> R<f64> {
let rate = ffmpeg_stderr(&["-hide_banner", "-i", video])?;
Ok(rate.split(" fps").next().and_then(|s| s.rsplit(", ").next()).and_then(|s| s.trim().parse().ok()).unwrap_or(30.0))
}
pub(crate) fn flash_frame_rule(video: &str, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
let (l, fps) = lumas(video)?;
flash_frame_from(&l, fps, issues, passed);
Ok(())
}
/// The stray frames each frame's brightness shows
pub(crate) fn flash_frame_from(l: &[f32], fps: f64, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let found = flash_frames(l, fps);
if found.is_empty() {
passed.push("flash-frame: no stray black or white frame".into());
}
issues.extend(moments("flash-frame", 1, found));
}
/// Each moment a rule found, as an issue of that priority
pub(crate) fn moments(rule: &'static str, p: u8, found: Vec<(f64, String)>) -> impl Iterator<Item = Issue> {
found.into_iter().map(move |(at, says)| Issue { rule, p, at: Some(at), says })
}
/// The sound's defects on the decoded mix (sound.rs decodes it once)
pub(crate) fn sound_defects(x: &[f32], channels: &[Vec<f32>], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
for (rule, found, ok) in [("clipping", clipped(channels), "clipping: no flat-topped runs"), ("dropout", dropouts(x), "dropout: the sound never drops to silence and back")] {
if found.is_empty() {
passed.push(ok.into());
}
issues.extend(moments(rule, 1, found));
}
}
+49 -259
View File
@@ -1,275 +1,60 @@
use super::*;
use raea_app_check_flash::FlashScreen;
/// Flashing past WCAG 2.3.1: more than three flashes in any one second, over enough of the frame to matter. A flash is a
/// pair of opposing changes in the same pixels, so a shape sliding past isn't one. Each window, a third of the frame wide
/// and high, stands in for WCAG's quarter of a 10-degree field (the real area depends on the screen and how far away it
/// is, which a file doesn't say), and a quarter of its pixels must swing together: by 0.10 relative luminance with the
/// darker end under 0.80, or by 20 of saturated red ((R-G-B)*320, where R/(R+G+B) is at least 0.8). Every decoded frame
/// counts, on its own timestamp, and the picture is sampled twice, by area and by point, so fine patterns don't average
/// away. A screen for review, not a Harding or PEAT certification; an interlaced picture isn't split into its fields.
/// The width each frame is decoded at for the flashing screen (raea-app-check-flash: its rule and its windows), twice over:
/// the area sample and the point sample side by side
const FLASH_W: usize = 192;
const FLASH_MOST: usize = 6;
const FLASH_PAIR_S: f64 = 1.0 + 1e-9;
/// A pixel in one measure: its value, and whether it can count. Red's value runs on through the saturation line, and a change
/// counts when either end of it is saturated; a one-level step across the line isn't a jump from zero.
#[derive(Clone, Copy)]
struct Px {
value: f32,
counts: bool,
pub(crate) use crate::read::{log_level, showinfo_base, showinfo_frame};
/// The flashing screen's frame height for the picture's shape
fn flash_h(probe: &Probe) -> usize {
(((FLASH_W as f64 * probe.h / probe.w.max(1.0)) / 2.0).round() as usize * 2).max(6)
}
struct Swing {
at: f64,
direction: f32,
moved: Vec<bool>,
plain: bool,
kept: bool,
}
/// One window's swings in one measure: the ones an opposite swing within a second moves back in the same pixels. The
/// general measure leaves out swings where another quarter of the window moved the other way at once (a moving pattern).
struct Swings {
by: f32,
under: f32,
mixed_counts: bool,
pivot: Vec<Px>,
extreme: Vec<Px>,
at: f64,
direction: f32,
recent: std::collections::VecDeque<Swing>,
ends: Vec<f64>,
}
impl Swings {
fn new(by: f32, under: f32, mixed_counts: bool) -> Swings {
Swings { by, under, mixed_counts, pivot: Vec::new(), extreme: Vec::new(), at: 0.0, direction: 0.0, recent: Default::default(), ends: Vec::new() }
/// Freezes, flashing, flash frames and blotching, in that order, from one read of the picture (raea-app-check-read
/// once.rs: one decode where there were four); each reads on its own where one read can't be had
pub(crate) fn picture_rules(video: &str, probe: &Probe, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
if !crate::read::once::can() {
freezes(video, probe, taste, issues, passed)?;
flashing(video, probe, issues, passed)?;
flash_frame_rule(video, issues, passed)?;
return blotching(video, probe, issues, passed);
}
fn moves(&self, a: Px, b: Px, direction: f32) -> bool {
(b.value - a.value) * direction >= self.by && a.value.min(b.value) < self.under && (a.counts || b.counts)
let (w, h) = (FLASH_W, flash_h(probe));
let kept = x264_kept(video);
let (cw, ch) = (probe.w as usize / 8 * 8, probe.h as usize / 8 * 8);
let mut screen = FlashScreen::new(w, h);
let mut scores = Vec::new();
let once = crate::read::once::picture(video, (w, h), kept.is_none().then_some((cw, ch)), taste.map_or(3.0, |t| t.value), |t, buf| screen.push(buf, t), scorer(&mut scores, cw, ch))?;
freezes_from(&once.freezes, probe, taste, issues, passed);
if once.lost {
return Err(format!("{video}: flashing can't be screened, frame {} has no timestamp of its own", once.frames));
}
fn changed(&self, earlier: &[Px], later: &[Px], direction: f32) -> bool {
earlier.iter().zip(later).filter(|(a, b)| self.moves(**a, **b, direction)).count() * 4 >= earlier.len()
if !once.ok || once.frames == 0 {
return Err(format!("{video}: flashing can't be screened, FFmpeg decoded {} frames ({})", once.frames, once.first));
}
fn push(&mut self, t: f64, px: &[Px]) {
if self.pivot.is_empty() {
self.pivot = px.to_vec();
self.extreme = px.to_vec();
self.at = t;
return;
}
if self.direction == 0.0 {
for direction in [1.0, -1.0] {
if self.changed(&self.pivot, px, direction) {
self.direction = direction;
self.extreme = px.to_vec();
self.at = t;
break;
}
}
return;
}
if self.changed(&self.extreme, px, -self.direction) {
self.record();
self.pivot = std::mem::replace(&mut self.extreme, px.to_vec());
self.at = t;
self.direction = -self.direction;
} else if self.changed(&self.pivot, px, self.direction) && self.went_further(px) {
self.extreme = px.to_vec();
}
screened(screen, once.errors, &once.first, issues, passed);
flash_frame_from(&once.lumas, ffmpeg_rate(video)?, issues, passed);
match kept {
Some(crf) => passed.push(format!("blotching: encoded by x264 at crf {crf}, which keeps the darks")),
None => blotching_from(video, probe, &scores, issues, passed),
}
/// Whether the pixels swinging from the pivot went further than the saved extreme, judged on those pixels alone: the
/// rest of the window can dim by less than counts and still outweigh a patch that's flashing.
fn went_further(&self, px: &[Px]) -> bool {
let further: f32 = self.pivot.iter().zip(px).zip(&self.extreme).filter(|((p, n), _)| self.moves(**p, **n, self.direction)).map(|((_, n), e)| (n.value - e.value) * self.direction).sum();
further > 0.0
}
fn record(&mut self) {
if !self.changed(&self.pivot, &self.extreme, self.direction) {
return;
}
let moved: Vec<bool> = self.pivot.iter().zip(&self.extreme).map(|(a, b)| self.moves(*a, *b, self.direction)).collect();
let plain = self.mixed_counts || !self.changed(&self.pivot, &self.extreme, -self.direction);
let (at, direction) = (self.at, self.direction);
let mut kept = false;
for other in self.recent.iter_mut().rev() {
if at - other.at > FLASH_PAIR_S {
break;
}
let same = moved.iter().zip(&other.moved).filter(|(x, y)| **x && **y).count();
if other.direction == -direction && same * 4 >= moved.len() {
other.kept = true;
kept = true;
}
}
self.recent.push_back(Swing { at, direction, moved, plain, kept });
while self.recent.front().is_some_and(|s| at - s.at > FLASH_PAIR_S) {
self.retire();
}
}
/// The oldest swing leaves the second it could still pair within; only the seconds' ends are kept for good.
fn retire(&mut self) {
if let Some(s) = self.recent.pop_front()
&& s.plain
&& s.kept
{
self.ends.push(s.at);
}
}
/// The most swings in any one second, and when that second starts.
fn busiest(&mut self) -> (usize, f64) {
if self.direction != 0.0 {
self.record();
self.direction = 0.0;
}
while !self.recent.is_empty() {
self.retire();
}
self.ends.sort_by(f64::total_cmp);
let (mut best, mut from, mut j) = (0, 0.0, 0);
for i in 0..self.ends.len() {
while self.ends[i] - self.ends[j] >= 1.0 - 1e-9 {
j += 1;
}
if i - j + 1 > best {
(best, from) = (i - j + 1, self.ends[j]);
}
}
(best, from)
}
}
/// Frames of two pictures side by side, each `w` by `h` RGB: the area sample and the point sample of one frame.
pub(crate) struct FlashScreen {
w: usize,
h: usize,
last: Vec<u8>,
linear: Vec<f32>,
luma: Vec<Px>,
red: Vec<Px>,
cut: Vec<Px>,
windows: Vec<(usize, usize, Swings, Swings)>,
}
impl FlashScreen {
pub(crate) fn new(w: usize, h: usize) -> FlashScreen {
let (ww, wh) = (w / 3, h / 3);
let places = |size: usize, window: usize| {
let mut at: Vec<usize> = (0..=size - window).step_by((size / 6).max(1)).collect();
at.push(size - window);
at.dedup();
at
};
let mut windows = Vec::new();
for sample in 0..2 {
for &y in &places(h, wh) {
for &x in &places(w, ww) {
windows.push((x + sample * w, y, Swings::new(0.10, 0.80, false), Swings::new(20.0, f32::INFINITY, true)));
}
}
}
let linear = (0..=255u32)
.map(|c| {
let c = c as f32 / 255.0;
if c <= 0.04045 { c / 12.92 } else { ((c + 0.055) / 1.055).powf(2.4) }
})
.collect();
FlashScreen { w, h, last: Vec::new(), linear, luma: Vec::new(), red: Vec::new(), cut: Vec::new(), windows }
}
pub(crate) fn push(&mut self, rgb: &[u8], t: f64) {
if rgb == self.last {
return;
}
self.luma.clear();
self.red.clear();
for px in rgb.chunks_exact(3) {
let (r, g, b) = (self.linear[px[0] as usize], self.linear[px[1] as usize], self.linear[px[2] as usize]);
self.luma.push(Px { value: 0.2126 * r + 0.7152 * g + 0.0722 * b, counts: true });
let sum = r + g + b + 1e-9;
self.red.push(Px { value: ((r - g - b) * 320.0).max(0.0), counts: r / sum >= 0.8 });
}
let (stride, ww, wh) = (self.w * 2, self.w / 3, self.h / 3);
for (x, y, general, saturated) in &mut self.windows {
self.cut.clear();
for r in 0..wh {
self.cut.extend_from_slice(&self.luma[(*y + r) * stride + *x..][..ww]);
}
general.push(t, &self.cut);
self.cut.clear();
for r in 0..wh {
self.cut.extend_from_slice(&self.red[(*y + r) * stride + *x..][..ww]);
}
saturated.push(t, &self.cut);
}
self.last.clear();
self.last.extend_from_slice(rgb);
}
/// (swings in the worst second, when it starts, which measure) when past the limit
pub(crate) fn finish(mut self) -> Option<(usize, f64, &'static str)> {
let mut worst: Option<(usize, f64, &'static str)> = None;
for (_, _, general, saturated) in &mut self.windows {
for (swings, kind) in [(general, "general"), (saturated, "red")] {
let (n, from) = swings.busiest();
if n > FLASH_MOST && worst.is_none_or(|w| n > w.0) {
worst = Some((n, from, kind));
}
}
}
worst
}
}
/// Every decoded frame, once: -fps_mode from FFmpeg 5.1 on, -vsync before it.
fn passthrough() -> [&'static str; 2] {
let out = Command::new("ffmpeg").args(["-hide_banner", "-version"]).output().map(|o| o.stdout).unwrap_or_default();
let head = String::from_utf8_lossy(&out);
let version = head.split("version ").nth(1).and_then(|v| {
let mut parts = v.trim_start_matches('n').split(|c: char| !c.is_ascii_digit());
Some((parts.next()?.parse::<u32>().ok()?, parts.next()?.parse::<u32>().ok()?))
});
[if version.is_some_and(|v| v < (5, 1)) { "-vsync" } else { "-fps_mode" }, "passthrough"]
}
/// A frame's number and time from showinfo's log, exact: its `pts` in ticks of the time base. `pts_time` is rounded to six
/// significant digits, which is enough to push a legal third flash across the one-second line.
pub(crate) fn showinfo_frame(line: &str, base: Option<(i64, i64)>) -> Option<(usize, f64)> {
let rest = line.split(" n:").nth(1)?;
let n = rest.split_whitespace().next()?.parse().ok()?;
let pts: i64 = rest.split("pts:").nth(1)?.split_whitespace().next()?.parse().ok()?;
let (num, den) = base?;
Some((n, pts as f64 * num as f64 / den as f64))
}
pub(crate) fn showinfo_base(line: &str) -> Option<(i64, i64)> {
let (num, den) = line.split("config in time_base:").nth(1)?.split(',').next()?.trim().split_once('/')?;
Some((num.parse().ok()?, den.parse().ok()?))
}
/// A line's severity under `-loglevel level+`: the first bracket after any `[context @ address]`. Searching the whole line
/// would take a file's own metadata for an error when its title happens to say one.
pub(crate) fn log_level(line: &str) -> Option<&str> {
let mut rest = line.trim_start();
if rest.starts_with('[') && rest[..rest.find(']')?].contains(" @ ") {
rest = rest[rest.find(']')? + 1..].trim_start();
}
let rest = rest.strip_prefix('[')?;
Some(&rest[..rest.find(']')?])
Ok(())
}
pub(crate) fn flashing(video: &str, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
let w = FLASH_W;
let h = (((w as f64 * probe.h / probe.w.max(1.0)) / 2.0).round() as usize * 2).max(6);
let (w, h) = (FLASH_W, flash_h(probe));
if crate::read::native() {
let mut screen = FlashScreen::new(w, h);
if crate::read::flash_frames(video, w, h, |t, buf| screen.push(buf, t))? == 0 {
return Err(format!("{video}: flashing can't be screened, no frame decoded"));
}
screened(screen, 0, "", issues, passed);
return Ok(());
}
let graph = format!("showinfo,split=2[area][point];[area]scale={w}:{h}:flags=area[a];[point]scale={w}:{h}:flags=neighbor[b];[a][b]hstack=inputs=2,format=rgb24");
let sync = passthrough();
let sync = raea_io_ffmpeg::passthrough();
let mut child = Command::new("ffmpeg")
.args(["-hide_banner", "-nostats", "-nostdin", "-loglevel", "level+info", "-i", video, "-map", "0:v:0", "-vf", &graph, sync[0], sync[1], "-f", "rawvideo", "-"])
.stdin(std::process::Stdio::null())
@@ -326,6 +111,12 @@ pub(crate) fn flashing(video: &str, probe: &Probe, issues: &mut Vec<Issue>, pass
if !status.success() || frames == 0 {
return Err(format!("{video}: flashing can't be screened, FFmpeg decoded {frames} frames ({first})"));
}
screened(screen, errors, &first, issues, passed);
Ok(())
}
/// What the screen found, after `errors` errors decoding the picture (`first` the first of them)
fn screened(screen: FlashScreen, errors: usize, first: &str, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
if errors > 0 {
issues.push(Issue {
rule: "decode",
@@ -344,5 +135,4 @@ pub(crate) fn flashing(video: &str, probe: &Probe, issues: &mut Vec<Issue>, pass
None if errors == 0 => passed.push("flashing: no more than 3 flashes a second found (a screen, not a certification)".to_string()),
None => {}
}
Ok(())
}
+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)]
+48 -88
View File
@@ -1,4 +1,4 @@
//! `raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 9:16]
//! `raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--things T.json] [--shape 9:16]
//! [--platform tiktok|reels|shorts] [-o check.json]`: the floor's measurable lines on an export (docs/craft-system.md, I; sdk/guides/craft/floor.md).
//! Each issue is ranked P0 (breaks the piece) to P3 (polish), with where it is and what to do. Rules on the file alone:
//! loudness and true peak, a steady sound that stops dead (a source run out, a cut with no fade), stretches where nothing
@@ -20,22 +20,20 @@ mod picture;
use picture::*;
mod flash;
use flash::*;
mod text;
use text::*;
mod defects;
use defects::*;
/// what a render's text breaks, from its manifest (split out: a render holds its own text to it)
use raea_app_check_text::*;
/// who can fix what it finds: the encode's or the picture's own, carried from an earlier export, a source
use raea_app_check_cause as cause;
/// a video read through FFmpeg, or raea's own decoders where it isn't installed
use raea_app_check_read::{self as read, Probe};
pub mod quick;
pub mod hook;
pub use raea_app_check_inbox as inbox;
#[cfg(test)]
mod tests;
type R<T> = Result<T, String>;
#[derive(Clone)]
struct Issue {
rule: &'static str,
p: u8,
at: Option<f64>,
says: String,
}
/// `raea check …` with the person's taste, none or more (taste.ts and the kinds beside it, which the raea CLI evaluates: it owns the engine):
/// its rules' checks hold the export to the person's own lines.
@@ -68,7 +66,7 @@ fn flag<'a>(args: &'a [String], name: &str) -> Option<&'a str> {
args.iter().position(|a| a == name).and_then(|i| args.get(i + 1)).map(String::as_str)
}
pub const USAGE: &str = "raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, flashing, cues, loudness, blotching, a placeholder brand kit; its findings errors, warns and notes)";
pub const USAGE: &str = "raea check VIDEO.mp4 [--manifest render.json] [--words W.json] [--perception P.json] [--things T.json] [--shape 16:9|9:16|4:5|1:1] [--platform tiktok|reels|shorts] [--taste taste.ts|DIR] [-o check.json] (an export against the floor: clipped text, contrast, safe areas, freezes, flashing, cues, loudness, blotching, a placeholder brand kit, and with --things what `raea fingerprint things --json` found: a thing floating or passing through another, the camera lurching mid-move, an empty frame; its findings errors, warns and notes)";
/// A rule from the person's taste: a form raea can measure, its value, and the taste line it stands for.
#[derive(Clone, Debug, PartialEq)]
@@ -117,7 +115,7 @@ fn taste_text(rules: &[Taste], runs: &[Run], w: f64, h: f64, issues: &mut Vec<Is
}
/// the flags `raea check` takes, each with a value
const TAKES: [&str; 7] = ["--manifest", "--words", "--perception", "--shape", "--platform", "--taste", "-o"];
const TAKES: [&str; 8] = ["--manifest", "--words", "--perception", "--things", "--shape", "--platform", "--taste", "-o"];
fn run(args: &[String], tastes: Vec<raea_core_brief::Taste>) -> R<(String, bool)> {
let (video, issues, passed, fps) = measured(args, taste_rules(&tastes))?;
@@ -142,9 +140,8 @@ fn measured(args: &[String], taste: Vec<Taste>) -> R<(String, Vec<Issue>, Vec<St
if !std::path::Path::new(&video).exists() {
return Err(format!("no file at {video}\n{USAGE}"));
}
let probe = Probe::of(&video)?;
let mut issues = Vec::new();
let mut passed = Vec::new();
let probe = read::probe(&video)?;
let (mut issues, mut passed) = (Vec::new(), Vec::new());
let manifest: Option<Value> = match flag(args, "--manifest") {
Some(m) => Some(serde_json::from_str(&std::fs::read_to_string(m).map_err(|e| format!("{m}: {e}"))?).map_err(|e| format!("{m}: {e}"))?),
None => None,
@@ -155,10 +152,17 @@ fn measured(args: &[String], taste: Vec<Taste>) -> R<(String, Vec<Issue>, Vec<St
loudness(&video, taste_of(&taste, "loudness"), &mut issues, &mut passed)?;
sound(&video, words.as_deref(), &mut issues, &mut passed)?;
}
freezes(&video, &probe, taste_of(&taste, "still-max"), &mut issues, &mut passed)?;
flashing(&video, &probe, &mut issues, &mut passed)?;
blotching(&video, &probe, &mut issues, &mut passed)?;
picture_rules(&video, &probe, taste_of(&taste, "still-max"), &mut issues, &mut passed)?;
brand_kit(&[flag(args, "--manifest").unwrap_or(""), video.as_str()], &mut issues, &mut passed);
if let Some(p) = flag(args, "--things") {
things(p, &mut issues, &mut passed)?;
}
// a take or a download isn't a delivery: the mix sets the delivery's level, so its own is said, not held to the target
if cause::is_source(std::path::Path::new(&video)) {
for i in issues.iter_mut().filter(|i| i.rule == "loudness") {
(i.p, i.says) = (3, format!("a source, not a delivery: {} (the mix sets the delivery's level)", i.says));
}
}
if let Some(manifest) = &manifest {
let runs = text_runs(manifest);
let (w, h) = (manifest["width"].as_f64().unwrap_or(probe.w), manifest["height"].as_f64().unwrap_or(probe.h));
@@ -176,33 +180,37 @@ fn measured(args: &[String], taste: Vec<Taste>) -> R<(String, Vec<Issue>, Vec<St
Ok((video, issues, passed, fps))
}
/// What `raea fingerprint things FILE --json` found (docs/fingerprint.feature FP13c): a thing floating, two passing
/// through each other, the camera lurching mid-move, an empty frame; measured there, from depth, masks and the camera's
/// path, never by a head
fn things(p: &str, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
let v: Value = serde_json::from_str(&std::fs::read_to_string(p).map_err(|e| format!("{p}: {e}"))?).map_err(|e| format!("{p}: {e}"))?;
let before = issues.len();
for i in v["issues"].as_array().into_iter().flatten() {
let Some(rule) = ["floating", "passing-through", "camera-speed", "empty-frame"].into_iter().find(|r| i["rule"] == *r) else { continue };
issues.push(Issue { rule, p: i["p"].as_u64().unwrap_or(2).min(3) as u8, at: i["at"].as_f64(), says: i["says"].as_str().unwrap_or_default().into() });
}
if issues.len() == before {
passed.push("things: nothing floats, passes through, lurches or is empty".into());
}
Ok(())
}
/// The issues as Findings (docs/direction.feature DR3: P0 and P1 errors, P2 a warn, P3 a note; a time is its frame at
/// `fps`), with `more` (a render's own), worst first then by time.
fn findings_of(mut issues: Vec<Issue>, more: Vec<Finding>, fps: f64) -> Vec<Finding> {
issues.sort_by(|a, b| a.p.cmp(&b.p).then(a.at.unwrap_or(0.0).total_cmp(&b.at.unwrap_or(0.0))));
finding::ranked(
issues
.iter()
.map(|i| {
let f = Finding::new(i.rule, Level::of_rank(i.p), &i.says, "raea check");
// an issue at a second is about the frame it falls on
match i.at {
Some(t) => {
let fr = (t * fps).round() as i64;
f.frames(fr, fr + 1)
}
None => f,
}
})
.chain(more)
.collect(),
)
finding::ranked(issues.iter().map(|i| i.finding("raea check", fps)).chain(more).collect())
}
/// The findings (`findings_of`), written to -o as JSON when asked, and the report's text with the count last. True
/// when an error is among them.
fn report(video: &str, issues: Vec<Issue>, more: Vec<Finding>, passed: Vec<String>, out: Option<&str>, fps: f64) -> R<(String, bool)> {
let found = findings_of(issues, more, fps);
let mut found = findings_of(issues, more, fps);
// what an earlier export of the same composition already had says so: the change between them didn't move it
if let Some(e) = cause::earlier(std::path::Path::new(video)) {
cause::carried(&mut found, &e, fps);
}
let bad = found.iter().any(|f| f.level == Level::Error);
if let Some(out) = out {
let j = json!({"file": video, "fps": fps, "findings": found, "passed": passed});
@@ -216,54 +224,6 @@ fn report(video: &str, issues: Vec<Issue>, more: Vec<Finding>, passed: Vec<Strin
s.push_str(&line);
s.push('\n');
}
Ok((s + &format!("raea check: {}", finding::count(&found)), bad))
}
struct Probe {
w: f64,
h: f64,
duration: f64,
/// when the picture ends, on the clock FFmpeg's filters read: it starts at the file's first stream, sound can run on
/// past the picture, and the container's duration counts that
picture: f64,
audio: bool,
}
/// Where the picture's last packet ends, for a container that doesn't state the video stream's own length (Matroska)
fn last_packet_end(video: &str) -> Option<f64> {
let out = Command::new("ffprobe").args(["-v", "error", "-select_streams", "v:0", "-show_entries", "packet=pts_time,duration_time", "-of", "csv=p=0", video]).output().ok()?;
String::from_utf8_lossy(&out.stdout)
.lines()
.filter_map(|l| {
let mut parts = l.split(',');
let t: f64 = parts.next()?.trim().parse().ok()?;
Some(t + parts.next().and_then(|d| d.trim().parse::<f64>().ok()).unwrap_or(0.0))
})
.max_by(f64::total_cmp)
}
impl Probe {
fn of(video: &str) -> R<Probe> {
let out = Command::new("ffprobe")
.args(["-v", "error", "-show_entries", "stream=codec_type,width,height,r_frame_rate,duration,start_time:format=duration,start_time", "-of", "json", video])
.output()
.map_err(|e| format!("ffprobe: {e}"))?;
let v: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("ffprobe: {e}"))?;
let streams = v["streams"].as_array().cloned().unwrap_or_default();
let vid = streams.iter().find(|s| s["codec_type"] == "video").ok_or("no video stream")?;
let seconds = |field: &Value| field.as_str().and_then(|d| d.parse::<f64>().ok());
let duration = seconds(&v["format"]["duration"]).unwrap_or(0.0);
let origin = seconds(&v["format"]["start_time"]).unwrap_or(0.0);
let picture = match seconds(&vid["duration"]) {
Some(length) => seconds(&vid["start_time"]).unwrap_or(origin) - origin + length,
None => last_packet_end(video).map_or(duration, |end| end - origin),
};
Ok(Probe {
w: vid["width"].as_f64().unwrap_or(1920.0),
h: vid["height"].as_f64().unwrap_or(1080.0),
duration,
picture,
audio: streams.iter().any(|s| s["codec_type"] == "audio"),
})
}
s.push_str(&format!("raea check: {}", finding::count(&found)));
Ok((s, bad))
}
+106 -33
View File
@@ -101,54 +101,127 @@ pub(crate) fn x264_crf(head: &[u8]) -> Option<f64> {
/// in its darks is the picture's own (8-bit glows and faint panels), which blotch_score can't always tell apart
pub(crate) const X264_KEEPS: f64 = 16.0;
pub(crate) fn blotching(video: &str, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
/// How far a clean encode moves a sample's blotching (x264 crf 12 over the walkaround's unencoded frames, 11-19: at most 0.005)
pub(crate) const BLOTCH_NOISE: f64 = 0.005;
/// Blotching's samples against the same frames of the composition drawn without encoding (raea-app-check-cause): None
/// when the video isn't a render in a raea project's record
fn blotching_cause(video: &str, probe: &Probe, scores: &[Option<f64>], w: usize, h: usize) -> Option<R<(cause::Against, Vec<Option<f64>>)>> {
let (project, comp) = cause::composition_of(std::path::Path::new(video))?;
Some((|| {
if probe.fps <= 0.0 {
return Err("the video doesn't say its frame rate".to_string());
}
let frames = cause::sampled(scores.len(), 2.0, probe.fps, (probe.picture * probe.fps).round() as i64 - 1);
let me = std::env::current_exe().map_err(|e| e.to_string())?;
let before: Vec<Option<f64>> = cause::unencoded(&me, &project, &comp, &frames, w, h)?.iter().map(|y| blotch_score(y, w, h)).collect();
Ok((cause::against(scores, &before, BLOTCHY, BLOTCH_NOISE), before))
})())
}
/// The crf an x264 encode that keeps the darks was made at: blotching isn't read for it
pub(crate) fn x264_kept(video: &str) -> Option<f64> {
let mut head = Vec::new();
if let Ok(f) = std::fs::File::open(video) {
let _ = std::io::Read::read_to_end(&mut std::io::Read::take(f, 8 << 20), &mut head);
}
if let Some(crf) = x264_crf(&head).filter(|c| *c <= X264_KEEPS) {
x264_crf(&head).filter(|c| *c <= X264_KEEPS)
}
pub(crate) fn blotching(video: &str, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
if let Some(crf) = x264_kept(video) {
passed.push(format!("blotching: encoded by x264 at crf {crf}, which keeps the darks"));
return Ok(());
}
let (w, h) = (probe.w as usize / 8 * 8, probe.h as usize / 8 * 8);
let mut child = Command::new("ffmpeg")
.args(["-v", "error", "-i", video, "-vf", &format!("fps=0.5,crop={w}:{h}:0:0,format=gray"), "-f", "rawvideo", "-"])
.stdout(std::process::Stdio::piped())
.spawn()
.map_err(|e| format!("ffmpeg: {e}"))?;
let mut out = child.stdout.take().unwrap();
let mut buf = vec![0u8; w * h];
let mut scores: Vec<Option<f64>> = Vec::new();
let mut frame = scorer(&mut scores, w, h);
if crate::read::native() {
crate::read::crops(video, w, h, &mut frame)?;
} else {
let mut child = Command::new("ffmpeg")
.args(["-v", "error", "-i", video, "-vf", &format!("fps=0.5,crop={w}:{h}:0:0,format=gray"), "-f", "rawvideo", "-"])
.stdout(std::process::Stdio::piped())
.spawn()
.map_err(|e| format!("ffmpeg: {e}"))?;
let mut out = child.stdout.take().unwrap();
let mut buf = vec![0u8; w * h];
while std::io::Read::read_exact(&mut out, &mut buf).is_ok() {
frame(&buf);
}
let _ = child.wait();
}
drop(frame);
blotching_from(video, probe, &scores, issues, passed);
Ok(())
}
/// Each grey crop's blotching, kept in `scores`
pub(crate) fn scorer(scores: &mut Vec<Option<f64>>, w: usize, h: usize) -> impl FnMut(&[u8]) + Send + '_ {
move |buf| scores.push(blotch_score(buf, w, h))
}
/// What blotching's samples (one every 2 s) found
pub(crate) fn blotching_from(video: &str, probe: &Probe, scores: &[Option<f64>], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let (w, h) = (probe.w as usize / 8 * 8, probe.h as usize / 8 * 8);
let (mut bad, mut seen, mut worst) = (Vec::new(), 0, 0f64);
let mut t = 0.0;
while std::io::Read::read_exact(&mut out, &mut buf).is_ok() {
if let Some(s) = blotch_score(&buf, w, h) {
seen += 1;
worst = worst.max(s);
if std::env::var_os("RAEA_CHECK_DEBUG").is_some() {
eprintln!("blotch {t:6.1}s {s:.3}");
}
if s > BLOTCHY {
bad.push((t, s));
}
for (k, s) in scores.iter().enumerate() {
let Some(s) = *s else { continue };
let t = k as f64 * 2.0;
seen += 1;
worst = worst.max(s);
if std::env::var_os("RAEA_CHECK_DEBUG").is_some() {
eprintln!("blotch {t:6.1}s {s:.3}");
}
if s > BLOTCHY {
bad.push((t, s));
}
t += 2.0;
}
let _ = child.wait();
if !bad.is_empty() {
let at = bad[0].0;
let share = bad.len() as f64 / seen.max(1) as f64;
issues.push(Issue {
rule: "blotching",
p: if share > 0.2 { 1 } else { 2 },
at: Some(at),
says: format!(
"blocky patches in dark areas in {} of {seen} sampled frames (worst {:.0}% of dark blocks stepping); the encoder starved the near-blacks: export as PNG frames and encode with more bits for darks",
bad.len(),
worst * 100.0
),
});
let found = format!("blocky patches in dark areas in {} of {seen} sampled frames (worst {:.0}% of dark blocks stepping)", bad.len(), worst * 100.0);
let (p, at, says) = match blotching_cause(video, probe, scores, w, h) {
// what the composition draws before any encoding is the picture's own (a phone's compression): no render
// setting removes it, so it's said, not worked on
Some(Ok(a)) if !a.0.by_encode(BLOTCH_NOISE) => (3, Some(at), format!("{found}: the picture's own, there as the composition draws them before any encoding (the footage's compression); the encode added none, so no render setting removes them")),
Some(Ok(a)) => {
let first = cause::Against::first(scores, &a.1, BLOTCHY, BLOTCH_NOISE).map(|i| i as f64 * 2.0);
let own = if a.0.before > 0 { format!("; {} of the samples show the footage's own too, which stays", a.0.before) } else { String::new() };
(if a.0.worse as f64 / a.0.of.max(1) as f64 > 0.2 { 1 } else { 2 }, first.or(Some(at)), format!("the encode added blocky patches in dark areas: {} of {} samples are blotchier than the composition draws them unencoded; render with --quality master, which gives the darks the bits they need{own}", a.0.worse, a.0.of))
}
Some(Err(why)) => (if share > 0.2 { 1 } else { 2 }, Some(at), format!("{found}; whether the encode made them or the picture holds them couldn't be told ({why}): render with --quality master if the encode starved the darks")),
None => (if share > 0.2 { 1 } else { 2 }, Some(at), format!("{found}: the encode starved the near-blacks, or the footage holds them; render with --quality master, and check a render made in a raea project to tell which")),
};
issues.push(Issue { rule: "blotching", p, at, says });
} else if seen > 0 {
passed.push(format!("blotching: dark areas clean in {seen} sampled frames"));
}
Ok(())
}
/// Caption contrast: at each text's middle frame, the pixels behind it against its colour, at least 3:1. The pixels
/// behind are the half of the box least like the text.
pub(crate) fn contrast(video: &str, runs: &[Run], w: f64, h: f64, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let (sx, sy) = (probe.w / w, probe.h / h);
let mut low = 0;
let mut measured = 0;
for r in runs.iter().filter(|r| r.size >= 20.0).take(80) {
let [x, y, bw, bh] = r.box_;
let crop = [(x * sx).max(0.0) as u32, (y * sy).max(0.0) as u32, (bw * sx) as u32, (bh * sy) as u32];
if crop[0] + crop[2] > probe.w as u32 || crop[1] + crop[3] > probe.h as u32 {
continue;
}
let t = (r.from + r.to) / 2.0;
// the same measure `raea world` joins to a text from its render (raea-sys-measure, DR2)
let ratio = if crate::read::native() { crate::read::contrast(video, t, crop, &r.color) } else { raea_sys_measure::contrast(std::path::Path::new(video), t, crop, &r.color) };
let Some(ratio) = ratio else { continue };
measured += 1;
if ratio < 3.0 {
low += 1;
issues.push(Issue { rule: "contrast", p: 1, at: Some(t), says: format!("{} is {ratio:.1}:1 against what's behind it; make it at least 3:1 (a band, a shadow for separation, or another colour)", quote(&r.text)) });
}
}
if measured > 0 && low == 0 {
passed.push(format!("contrast: {measured} texts at 3:1 or better against their pixels"));
}
}
+45 -26
View File
@@ -27,6 +27,12 @@ pub(crate) fn pct(v: &[f64], q: f64) -> f64 {
/// a bed that stops under a voice shows in the band the voice doesn't fill (a projector's clatter in the highs). A band's
/// level is its share of the step's mean square (Parseval, undoing the Hann window's power), so a tone reads the same in
/// its band as in the mix
/// A stretch of sound's level in dB (its RMS)
pub(crate) fn db(f: &[f32]) -> f64 {
let ms = f.iter().map(|&v| (v as f64).powi(2)).sum::<f64>() / f.len().max(1) as f64;
20.0 * (ms.sqrt() + 1e-9).log10()
}
pub(crate) fn levels(x: &[f32]) -> (Vec<f64>, [Vec<f64>; 3]) {
use std::f64::consts::PI;
let n = x.len() / HOP;
@@ -44,8 +50,7 @@ pub(crate) fn levels(x: &[f32]) -> (Vec<f64>, [Vec<f64>; 3]) {
let scale = 2.0 / (HOP * HOP) as f64 / (hann.iter().map(|h| h * h).sum::<f64>() / HOP as f64);
let (mut rms, mut bands) = (Vec::with_capacity(n), [Vec::with_capacity(n), Vec::with_capacity(n), Vec::with_capacity(n)]);
for f in x.chunks_exact(HOP) {
let ms = f.iter().map(|&v| (v as f64).powi(2)).sum::<f64>() / HOP as f64;
rms.push(20.0 * (ms.sqrt() + 1e-9).log10());
rms.push(db(f));
let w: Vec<f64> = f.iter().zip(&hann).map(|(&v, h)| v as f64 * h).collect();
let mut e = [0.0; 3];
for (b, tw) in &bins {
@@ -157,13 +162,10 @@ pub(crate) fn bed_up(rms: &[f64], speak: &[bool]) -> Vec<(f64, String)> {
/// The sound's rules on an export: dead stops always; with the voice's words, a stretch with no voice over it and a bed
/// too close under it
pub(crate) fn sound(video: &str, words: Option<&[Word]>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
let out = Command::new("ffmpeg").args(["-v", "error", "-i", video, "-vn", "-ac", "1", "-ar", &SR.to_string(), "-f", "f32le", "-"]).output().map_err(|e| format!("ffmpeg: {e}"))?;
if !out.status.success() {
return Err(format!("ffmpeg couldn't read the sound of {video}: {}", String::from_utf8_lossy(&out.stderr).trim()));
}
let x: Vec<f32> = out.stdout.chunks_exact(4).map(|b| f32::from_le_bytes([b[0], b[1], b[2], b[3]])).collect();
let x = crate::read::mono(video, SR as u32)?;
let (rms, bands) = levels(&x);
let found = |list: Vec<(f64, String)>, p: u8| list.into_iter().map(move |(at, says)| Issue { rule: "sound", p, at: Some(at), says });
sound_defects(&x, &crate::read::channels(video, SR as u32)?, issues, passed);
let found = |list: Vec<(f64, String)>, p: u8| crate::defects::moments("sound", p, list);
let stops = dead_stops(&rms, &bands);
if stops.is_empty() {
passed.push("sound: no steady sound stops dead".into());
@@ -172,19 +174,7 @@ pub(crate) fn sound(video: &str, words: Option<&[Word]>, issues: &mut Vec<Issue>
let Some(words) = words.filter(|w| !w.is_empty()) else { return Ok(()) };
let speak = speaking(words, rms.len());
// momentary loudness (EBU R128, 400 ms) every 100 ms, from ffmpeg's meter
let meter = Command::new("ffmpeg")
.args(["-nostats", "-hide_banner", "-i", video, "-vn", "-af", "ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=-", "-f", "null", "-"])
.output()
.map_err(|e| format!("ffmpeg: {e}"))?;
let (mut mt, mut mv) = (Vec::new(), Vec::new());
for line in String::from_utf8_lossy(&meter.stdout).lines() {
if let Some(t) = line.split("pts_time:").nth(1).filter(|_| line.starts_with("frame:")) {
mt.push(t.trim().parse::<f64>().unwrap_or(0.0));
} else if let Some(v) = line.strip_prefix("lavfi.r128.M=") {
mv.push(v.trim().parse::<f64>().unwrap_or(-120.0));
}
}
mt.truncate(mv.len());
let (mt, mv) = if crate::read::native() { crate::read::meter(video)? } else { ffmpeg_meter(video)? };
if let Some((voice, over)) = over_voice(&mt, &mv, &speak) {
if over.is_empty() {
passed.push(format!("sound: nothing without the voice is louder than it ({voice:.1} LUFS momentary)"));
@@ -199,6 +189,24 @@ pub(crate) fn sound(video: &str, words: Option<&[Word]>, issues: &mut Vec<Issue>
Ok(())
}
/// `ffmpeg ... -af ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=-`: each meter reading's time and LUFS
fn ffmpeg_meter(video: &str) -> R<(Vec<f64>, Vec<f64>)> {
let meter = Command::new("ffmpeg")
.args(["-nostats", "-hide_banner", "-i", video, "-vn", "-af", "ebur128=metadata=1,ametadata=print:key=lavfi.r128.M:file=-", "-f", "null", "-"])
.output()
.map_err(|e| format!("ffmpeg: {e}"))?;
let (mut mt, mut mv) = (Vec::new(), Vec::new());
for line in String::from_utf8_lossy(&meter.stdout).lines() {
if let Some(t) = line.split("pts_time:").nth(1).filter(|_| line.starts_with("frame:")) {
mt.push(t.trim().parse::<f64>().unwrap_or(0.0));
} else if let Some(v) = line.strip_prefix("lavfi.r128.M=") {
mv.push(v.trim().parse::<f64>().unwrap_or(-120.0));
}
}
mt.truncate(mv.len());
Ok((mt, mv))
}
pub(crate) fn ffmpeg_stderr(args: &[&str]) -> R<String> {
let out = Command::new("ffmpeg").args(args).output().map_err(|e| format!("ffmpeg: {e}"))?;
Ok(String::from_utf8_lossy(&out.stderr).into_owned())
@@ -206,8 +214,9 @@ pub(crate) fn ffmpeg_stderr(args: &[&str]) -> R<String> {
/// -14 LUFS integrated (±1) and a true peak at or below -1 dBTP (the floor's mix line)
pub(crate) fn loudness(video: &str, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
// the same measure `raea world` joins to a render as its Mix (raea-sys-measure, DR2)
let Some((i, peak)) = raea_sys_measure::loudness(std::path::Path::new(video)) else { return Ok(()) };
// the same measure `raea world` joins to a render as its Mix (raea-sys-measure, DR2), or raea's own without FFmpeg
let measured = if crate::read::native() { crate::read::loudness(video) } else { raea_sys_measure::loudness(std::path::Path::new(video)) };
let Some((i, peak)) = measured else { return Ok(()) };
let mut ok = true;
let target = taste.map_or(-14.0, |t| t.value);
if (i - target).abs() > 1.0 {
@@ -251,8 +260,19 @@ pub(crate) fn frozen_stretches(log: &str, duration: f64) -> Vec<(f64, f64)> {
pub(crate) fn freezes(video: &str, probe: &Probe, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) -> R<()> {
let most = taste.map_or(3.0, |t| t.value);
let err = ffmpeg_stderr(&["-hide_banner", "-nostats", "-i", video, "-an", "-vf", &format!("freezedetect=n=-60dB:d={most}"), "-f", "null", "-"])?;
let stretches = frozen_stretches(&err, probe.picture);
let err = if crate::read::native() {
crate::read::freezes(video, -60.0, most)?
} else {
ffmpeg_stderr(&["-hide_banner", "-nostats", "-i", video, "-an", "-vf", &format!("freezedetect=n=-60dB:d={most}"), "-f", "null", "-"])?
};
freezes_from(&err, probe, taste, issues, passed);
Ok(())
}
/// The freezes freezedetect's lines found (`taste`'s still-max when the person set one, else 3 s)
pub(crate) fn freezes_from(err: &str, probe: &Probe, taste: Option<&Taste>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let most = taste.map_or(3.0, |t| t.value);
let stretches = frozen_stretches(err, probe.picture);
for &(s, d) in &stretches {
let says = format!("nothing changes for {d:.1} s; give it a reason to hold, or cut it shorter");
issues.push(match taste {
@@ -263,5 +283,4 @@ pub(crate) fn freezes(video: &str, probe: &Probe, taste: Option<&Taste>, issues:
if stretches.is_empty() {
passed.push(format!("frozen: nothing holds still for {most} s"));
}
Ok(())
}
+96 -89
View File
@@ -292,72 +292,6 @@ fn a_sign_the_camera_carries_off_isnt_clipped_but_a_title_held_off_is() {
assert_eq!(rules, vec![("safe-area", "THE NIGHT MARKET".to_string()), ("clipped", "WIDE".to_string())]);
}
/// a 96x54 picture drawn by `paint(frame index, sample, x, y)`, sample 0 the area sample and 1 the point sample, for
/// `frames` frames at `fps`
fn flash_samples(frames: usize, fps: f64, paint: impl Fn(usize, usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
let (w, h) = (96, 54);
let mut screen = FlashScreen::new(w, h);
for f in 0..frames {
let mut rgb = Vec::with_capacity(w * 2 * h * 3);
for y in 0..h {
for sample in 0..2 {
for x in 0..w {
rgb.extend_from_slice(&paint(f, sample, x, y));
}
}
}
screen.push(&rgb, f as f64 / fps);
}
screen.finish()
}
fn flash_of(seconds: usize, paint: impl Fn(usize, usize, usize) -> [u8; 3]) -> Option<(usize, f64, &'static str)> {
flash_samples(seconds * 60, 60.0, move |f, _, x, y| paint(f, x, y))
}
/// two colours taking turns `hz` times a second, over a box of the frame
fn turns(hz: usize, on: [u8; 3], off: [u8; 3], bx: (usize, usize, usize, usize)) -> Option<(usize, f64, &'static str)> {
flash_of(3, move |f, x, y| {
let inside = x >= bx.0 && x < bx.0 + bx.2 && y >= bx.1 && y < bx.1 + bx.3;
if inside && f * hz * 2 / 60 % 2 == 0 { on } else { off }
})
}
#[test]
fn flashing_is_found_past_three_a_second_and_not_at_it() {
let (white, black) = ([255, 255, 255], [0, 0, 0]);
let all = (0, 0, 96, 54);
assert_eq!(turns(3, white, black, all), None, "three a second is the limit, not past it");
let (swings, _, kind) = turns(4, white, black, all).expect("four a second");
assert_eq!((swings / 2, kind), (4, "general"));
// a small box: under a quarter of any window, and then over it
assert_eq!(turns(5, white, black, (40, 20, 10, 10)), None);
assert!(turns(5, white, black, (30, 18, 32, 18)).is_some());
// too small a change, and both ends too bright for WCAG to count it
assert_eq!(turns(5, [60, 60, 60], [30, 30, 30], all), None);
assert_eq!(turns(5, [255, 255, 255], [235, 235, 235], all), None);
// a dark saturated red: too dim to count as a general flash, past the limit as a red one
assert_eq!(turns(5, [150, 0, 0], black, all).map(|t| t.2), Some("red"));
}
#[test]
fn a_flash_of_single_frames_counts_at_any_frame_rate() {
// 120 fps with one white frame in every 30: four flashes a second, each gone within a sixtieth of a second
let found = flash_samples(360, 120.0, |f, _, _, _| if f % 30 == 1 { [255, 255, 255] } else { [0, 0, 0] });
assert_eq!(found.map(|(swings, _, kind)| (swings / 2, kind)), Some((4, "general")));
}
#[test]
fn a_flash_the_area_sample_averages_away_is_found_in_the_point_sample() {
let found = flash_samples(180, 60.0, |f, sample, _, _| {
if sample == 0 {
return [128, 128, 128];
}
if f * 5 * 2 / 60 % 2 == 0 { [255, 255, 255] } else { [0, 0, 0] }
});
assert!(found.is_some(), "the same flash in the point sample alone");
}
#[test]
fn a_frame_gets_its_exact_time_from_the_log() {
// lines FFmpeg 9.0.2 logged with -loglevel level+info
@@ -382,34 +316,107 @@ fn only_a_lines_own_severity_counts_as_an_error() {
assert_eq!(log_level("frame= 300 fps=0.0"), None);
}
/// A centred line in a left: 0; right: 0 box isn't in the left zone: its letters are tested where the render recorded
/// them (#89); a left-aligned one is, the finding naming the edge, and a manifest without ink is tested by the box.
#[test]
fn a_shape_sliding_past_and_ordinary_cuts_are_not_flashing() {
let (white, black) = ([255, 255, 255], [0, 0, 0]);
assert_eq!(flash_of(3, move |f, x, _| if x < f { white } else { black }), None, "one wipe across the frame");
assert_eq!(flash_of(4, move |f, _, _| if (f / 30) % 2 == 0 { white } else { black }), None, "a cut every half second");
fn safe_area_tests_the_letters_not_the_box() {
let safe_area = |ink: Value| {
let m = json!({"fps": 1.0, "frames": [{"frame": 0, "text": [{"text": "centred", "box": [0, 160, 640, 40], "ink": ink}]}]});
let (mut issues, mut passed) = (vec![], vec![]);
text_rules(&text_runs(&m), None, 640.0, 360.0, None, None, &mut issues, &mut passed);
issues.into_iter().filter(|i| i.rule == "safe-area").map(|i| i.says).collect::<String>()
};
assert_eq!(safe_area(json!([250, 160, 140, 40])), "");
let left = safe_area(json!([0, 160, 140, 40]));
assert!(left.contains("at the left") && left.contains("its letters 0,160 140x40"), "{left}");
assert!(safe_area(Value::Null).contains("its box 0,160 640x40"));
}
#[test]
fn a_patch_strobing_while_its_background_dims_is_still_found() {
// a third of a window: 0 then 124 on a 148 background, then the background settles at 124 and the patch cycles 124 and 160.
// The background's drop is under the 0.10 that counts, but it outweighs the patch in the window's mean.
let found = flash_samples(180, 60.0, |f, _, x, y| {
let patch = x < 16 && y < 12;
let level = match (patch, f) {
(true, 0) => 0,
(true, 1) => 124,
(true, _) => if (f - 2) * 5 * 2 / 60 % 2 == 0 { 160 } else { 124 },
(false, 0 | 1) => 148,
(false, _) => 124,
};
[level, level, level]
});
assert!(found.is_some(), "the patch flashes five times a second");
fn a_card_sharing_one_word_with_another_line_isnt_held_to_it() {
let run = |text: &str, from: f64| Run { text: text.into(), from, to: from + 2.0, box_: [0.0; 4], boxes: vec![], color: String::new(), size: 48.0 };
let said = |ws: &[(&str, f64)]| ws.iter().map(|(t, s)| Word { text: (*t).into(), start: *s, end: *s }).collect::<Vec<Word>>();
let words = said(&[("at", 37.9), ("wirestock", 38.2), ("i", 38.9), ("worked", 39.0), ("on", 39.2), ("a", 39.3), ("sora", 39.5), ("campaign", 40.2)]);
let (mut issues, mut passed) = (vec![], vec![]);
// one word of three shared with the line, said 1.35 s before: not a caption of it (the film's false P1)
cues(&[run("Wirestock × OpenAI Sora", 39.55)], &words, &mut issues, &mut passed);
// one word of four, "campaign": the same
cues(&[run("Classroom of Tomorrow campaign", 39.55)], &words, &mut issues, &mut passed);
assert!(issues.is_empty(), "{:?}", issues.iter().map(|i| &i.says).collect::<Vec<_>>());
// a one-word card is held only to the word said right by it: "wirestock" 1.35 s earlier is another moment
cues(&[run("Wirestock", 39.55)], &words, &mut issues, &mut passed);
assert!(issues.is_empty(), "{:?}", issues.iter().map(|i| &i.says).collect::<Vec<_>>());
// a real caption late by 0.4 s is still found
cues(&[run("a Sora campaign", 39.7)], &words, &mut issues, &mut passed);
assert_eq!(issues.len(), 1, "{:?}", issues.iter().map(|i| &i.says).collect::<Vec<_>>());
}
#[test]
fn a_colour_crossing_the_saturation_line_is_not_a_red_flash() {
// one level of green moves the pixel across R/(R+G+B) = 0.8 and hardly changes its red at all
let found = flash_samples(180, 60.0, |f, _, _, _| if f * 5 * 2 / 60 % 2 == 0 { [100, 49, 0] } else { [100, 50, 0] });
assert_eq!(found, None);
fn clipping_is_found_and_a_loud_clean_tone_isnt() {
// a clean tone near full scale, then the same tone clamped (a limiter's flat tops), then pushed past full scale
let loud = tone(3.0, &[(0.0, 3.0, -1.0)]);
let one = |x: &[f32]| clipped(&[x.to_vec()]);
assert!(one(&loud).is_empty(), "{:?}", one(&loud));
let clamped: Vec<f32> = loud.iter().map(|v| (v * 10.0).clamp(-0.3, 0.3)).collect();
assert_eq!(one(&clamped).len(), 1);
let over: Vec<f32> = loud.iter().map(|v| (v * 2.0).clamp(-1.0, 1.0)).collect();
assert_eq!(one(&over).len(), 1);
// one transient hitting full scale once isn't clipping
let mut once = tone(3.0, &[(0.0, 3.0, -20.0)]);
once[SR] = 1.0;
assert!(one(&once).is_empty());
// clipping is a channel's: one side clipped is found; a centred voice at -1.6 dBFS a side is clean, though the mono
// fold (L + R) * 0.707 takes it past full scale (11-19: the walkaround's master read as clipping)
assert_eq!(clipped(&[loud.clone(), over.clone()]).len(), 1);
let centred: Vec<f32> = loud.iter().map(|v| v * 0.92).collect();
assert!(clipped(&[centred.clone(), centred.clone()]).is_empty());
let folded: Vec<f32> = centred.iter().map(|v| (v + v) * 0.7071).collect();
assert_eq!(one(&folded).len(), 1);
}
#[test]
fn a_dropout_is_found_and_a_faded_pause_isnt() {
// a bed at -20 dBFS with 0.6 s cut out of it, as the bootstrap's dropout does
let mut cut = tone(4.0, &[(0.0, 4.0, -20.0)]);
cut[(1.7 * SR as f64) as usize..(2.3 * SR as f64) as usize].iter_mut().for_each(|v| *v = 0.0);
let found = dropouts(&cut);
assert_eq!(found.len(), 1, "{found:?}");
assert!((found[0].0 - 1.7).abs() < 0.02, "{found:?}");
// a pause that fades out over 300 ms and back in isn't one, nor a sound that stops and stays stopped
let gain = |t: f32| ((1.7 - t) / 0.3).max((t - 2.3) / 0.3).clamp(0.0, 1.0);
let paused: Vec<f32> = tone(4.0, &[(0.0, 4.0, -20.0)]).into_iter().enumerate().map(|(i, v)| v * gain(i as f32 / SR as f32)).collect();
assert!(dropouts(&paused).is_empty(), "{:?}", dropouts(&paused));
assert!(dropouts(&tone(4.0, &[(0.0, 2.0, -20.0)])).is_empty());
}
#[test]
fn a_flash_frame_is_found_and_a_cut_or_a_fade_isnt() {
let mut shot = vec![0.5f32; 60];
shot[30] = 0.0;
assert_eq!(flash_frames(&shot, 30.0).len(), 1);
shot[31] = 0.0;
assert_eq!(flash_frames(&shot, 30.0).len(), 1, "two frames are one flash");
let cut: Vec<f32> = (0..60).map(|i| if i < 30 { 0.6 } else { 0.1 }).collect();
assert!(flash_frames(&cut, 30.0).is_empty());
let fade: Vec<f32> = (0..60).map(|i| 0.6 * (1.0 - i as f32 / 59.0)).collect();
assert!(flash_frames(&fade, 30.0).is_empty());
// a white frame, too
let mut white = vec![0.3f32; 20];
white[10] = 1.0;
assert_eq!(flash_frames(&white, 30.0)[0].0, 10.0 / 30.0);
}
#[test]
fn things_found_are_findings_and_an_unknown_rule_is_not() {
let p = std::env::temp_dir().join(format!("raea-check-things-{}.json", std::process::id()));
let found = r#"{"issues": [{"rule": "floating", "p": 2, "at": 1.5, "to": 3.0, "says": "cup floats"}, {"rule": "made-up", "p": 0, "at": 0.0, "says": "x"}]}"#;
std::fs::write(&p, found).unwrap();
let (mut issues, mut passed) = (Vec::new(), Vec::new());
things(p.to_str().unwrap(), &mut issues, &mut passed).unwrap();
assert_eq!(issues.iter().map(|i| (i.rule, i.p, i.at)).collect::<Vec<_>>(), [("floating", 2, Some(1.5))]);
std::fs::write(&p, r#"{"issues": []}"#).unwrap();
things(p.to_str().unwrap(), &mut Vec::new(), &mut passed).unwrap();
let _ = std::fs::remove_file(&p);
assert_eq!(passed.len(), 1, "nothing found is a pass");
}
+13
View File
@@ -0,0 +1,13 @@
[package]
name = "raea-app-check-text"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "raea check's text rules on a render's manifest: clipped, UI zones, reading time, face, cues, brand kit"
[dependencies]
dunce = "1"
serde_json = "1"
# a transcript's words, read as `raea world` reads them (docs/direction.feature DR1)
raea-core-facts = { path = "../../../core/facts" }
@@ -1,27 +1,59 @@
use super::*;
//! What a render's text breaks, from its manifest alone: clipped, in the platform's UI zones, too brief to read, over
//! the face, off its cue, and the brand kit it was styled from. raea check's text rules, split out of raea-app-check so
//! `raea render --manifest` holds its own text to them as it finishes, a check's round sooner.
use serde_json::Value;
pub type R<T> = Result<T, String>;
use raea_core_facts::{Finding, Level};
/// One thing a rule found: its rule, its rank (P0 breaks the piece to P3 polish), when (seconds) and what to do.
#[derive(Clone, Debug)]
pub struct Issue {
pub rule: &'static str,
pub p: u8,
pub at: Option<f64>,
pub says: String,
}
impl Issue {
/// As a Finding `by` a command (docs/direction.feature DR3: P0 and P1 errors, P2 a warn, P3 a note), about the
/// frame its second falls on at `fps`
pub fn finding(&self, by: &str, fps: f64) -> Finding {
let f = Finding::new(self.rule, Level::of_rank(self.p), &self.says, by);
match self.at {
Some(t) => {
let n = (t * fps).round() as i64;
f.frames(n, n + 1)
}
None => f,
}
}
}
/// A text as it stays on screen: from the frame it comes on to the frame it leaves. Typing (a text growing into the
/// next) and counting (only its digits changing) are one run, judged by its last text.
#[derive(Clone)]
pub(crate) struct Run {
pub(crate) text: String,
pub(crate) from: f64,
pub(crate) to: f64,
pub(crate) box_: [f64; 4],
/// its box on every frame it shows its whole text: a text the camera carries (a sign on a panning street) moves
pub struct Run {
pub text: String,
pub from: f64,
pub to: f64,
pub box_: [f64; 4],
/// where its letters are on every frame it shows its whole text (the manifest's `ink`, else its box: a centred line in
/// a full-width box is nowhere near x = 0, #89): a text the camera carries (a sign on a panning street) moves
/// through the frame's edges and zones, which only counts against it when no frame shows it clear
pub(crate) boxes: Vec<[f64; 4]>,
pub(crate) color: String,
pub(crate) size: f64,
pub boxes: Vec<[f64; 4]>,
pub color: String,
pub size: f64,
}
/// The brand kit the cut was styled from (brand/ at or above the manifest's or the video's folder, as render finds
/// brand.css): a kit `raea brand` read from a thin fetch that nobody corrected by hand is a placeholder, P1; a brand.css
/// with no brand.json beside it wasn't read from the brand at all, P2
pub(crate) fn brand_kit(near: &[&str], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
pub 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 };
@@ -49,7 +81,7 @@ pub(crate) fn brand_kit(near: &[&str], issues: &mut Vec<Issue>, passed: &mut Vec
}
}
pub(crate) fn text_runs(manifest: &Value) -> Vec<Run> {
pub fn text_runs(manifest: &Value) -> Vec<Run> {
let fps = manifest["fps"].as_f64().unwrap_or(30.0);
let frames = manifest["frames"].as_array().cloned().unwrap_or_default();
let mut open: Vec<Run> = Vec::new();
@@ -61,7 +93,8 @@ pub(crate) fn text_runs(manifest: &Value) -> Vec<Run> {
let mut next = Vec::new();
for x in shown {
let text = x["text"].as_str().unwrap_or("").trim().to_string();
let b = x["box"].as_array().map(|b| [0, 1, 2, 3].map(|i| b.get(i).and_then(Value::as_f64).unwrap_or(0.0))).unwrap_or([0.0; 4]);
let quad = |k: &str| x[k].as_array().map(|b| [0, 1, 2, 3].map(|i| b.get(i).and_then(Value::as_f64).unwrap_or(0.0)));
let (b, ink) = (quad("box").unwrap_or([0.0; 4]), quad("ink"));
let k = key(&text);
let found = open.iter().position(|r| {
let rk = key(&r.text);
@@ -77,7 +110,7 @@ pub(crate) fn text_runs(manifest: &Value) -> Vec<Run> {
if text.len() >= r.text.len() {
r.text = text;
r.box_ = b;
r.boxes.push(b);
r.boxes.push(ink.unwrap_or(b));
}
r.to = t + 1.0 / fps;
r.color = x["color"].as_str().unwrap_or("rgb(255, 255, 255)").to_string();
@@ -93,11 +126,11 @@ pub(crate) fn text_runs(manifest: &Value) -> Vec<Run> {
}
/// The share of the face's area a text may cover before it's a fault (@raea/video's proofBoxes keeps the same 8%)
pub(crate) const FACE_COVER: f64 = 0.08;
pub const FACE_COVER: f64 = 0.08;
/// The face over time from a perception.json (`raea cut`: each clip's first frame, the face at its middle in the
/// edit's px): [from, to) in seconds and the face's box, for the stretches that have one
pub(crate) fn faces_of(perception: &Value, fps: f64) -> Vec<(f64, f64, [f64; 4])> {
pub fn faces_of(perception: &Value, fps: f64) -> Vec<(f64, f64, [f64; 4])> {
let mut keys: Vec<(f64, Option<[f64; 4]>)> = perception.as_object().into_iter().flatten().filter_map(|(k, v)| {
let face = v["face"].as_object().map(|f| ["x", "y", "w", "h"].map(|n| f.get(n).and_then(Value::as_f64).unwrap_or(0.0)));
Some((k.parse::<f64>().ok()? / fps, face))
@@ -108,7 +141,7 @@ pub(crate) fn faces_of(perception: &Value, fps: f64) -> Vec<(f64, f64, [f64; 4])
/// Text over the face: a run that covers more than FACE_COVER of the face's area while that face is up, on every frame
/// that shows it whole (a text the camera carries counts only when no frame shows it clear)
pub(crate) fn face_cover(runs: &[Run], faces: &[(f64, f64, [f64; 4])], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
pub fn face_cover(runs: &[Run], faces: &[(f64, f64, [f64; 4])], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let share = |b: &[f64; 4], f: &[f64; 4]| {
let ox = (b[0] + b[2]).min(f[0] + f[2]) - b[0].max(f[0]);
let oy = (b[1] + b[3]).min(f[1] + f[3]) - b[1].max(f[1]);
@@ -132,7 +165,7 @@ pub(crate) fn face_cover(runs: &[Run], faces: &[(f64, f64, [f64; 4])], issues: &
}
/// the zones where text can't go, as [top, right, bottom, left] at 1080 wide (sdk/guides/craft/floor.md)
pub(crate) fn zones(w: f64, h: f64, shape: Option<&str>, platform: Option<&str>) -> [f64; 4] {
pub fn zones(w: f64, h: f64, shape: Option<&str>, platform: Option<&str>) -> [f64; 4] {
let r = w / h;
let shape = shape.unwrap_or(if r < 0.7 { "9:16" } else if r < 0.9 { "4:5" } else if r < 1.2 { "1:1" } else { "16:9" });
let z = match (shape, platform) {
@@ -151,12 +184,12 @@ pub(crate) fn zones(w: f64, h: f64, shape: Option<&str>, platform: Option<&str>)
/// A caption the voice reads out: every word of the text is said while it's on screen (from a little before it comes
/// on). The viewer hears it as it shows, so it needs no reading time of its own (karaoke groups are up for as long as
/// they take to say).
pub(crate) fn spoken(r: &Run, words: &[Word]) -> bool {
pub fn spoken(r: &Run, words: &[Word]) -> bool {
let tokens: Vec<String> = r.text.split_whitespace().map(norm).filter(|t| !t.is_empty()).collect();
!tokens.is_empty() && tokens.iter().all(|t| words.iter().any(|w| norm(&w.text) == *t && w.start >= r.from - 0.3 && w.start <= r.to + 0.1))
}
pub(crate) fn text_rules(runs: &[Run], heard: Option<&[Word]>, w: f64, h: f64, shape: Option<&str>, platform: Option<&str>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
pub fn text_rules(runs: &[Run], heard: Option<&[Word]>, w: f64, h: f64, shape: Option<&str>, platform: Option<&str>, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let [zt, zr, zb, zl] = zones(w, h, shape, platform);
let (mut clipped, mut unsafe_, mut brief) = (0, 0, 0);
for r in runs {
@@ -169,7 +202,9 @@ pub(crate) fn text_rules(runs: &[Run], heard: Option<&[Word]>, w: f64, h: f64, s
issues.push(Issue { rule: "clipped", p: 0, at: Some(r.from), says: format!("{q} runs off the frame (box {x:.0},{y:.0} {bw:.0}x{bh:.0} in {w:.0}x{h:.0}); fit it or break the line") });
} else if r.boxes.iter().all(zoned) {
unsafe_ += 1;
issues.push(Issue { rule: "safe-area", p: 1, at: Some(r.from), says: format!("{q} sits in the app's UI zone (keep {zt:.0} px top, {zb:.0} bottom, {zl:.0} left, {zr:.0} right clear)") });
let [ix, iy, iw, ih] = *r.boxes.last().unwrap_or(&r.box_);
let edge = if iy < zt { format!("the top (keep {zt:.0} px clear)") } else if iy + ih > h - zb { format!("the bottom (keep {zb:.0} px clear)") } else if ix < zl { format!("the left (keep {zl:.0} px clear)") } else { format!("the right (keep {zr:.0} px clear)") };
issues.push(Issue { rule: "safe-area", p: 1, at: Some(r.from), says: format!("{q} sits in the app's UI zone at {edge}: its {} {ix:.0},{iy:.0} {iw:.0}x{ih:.0} in {w:.0}x{h:.0}", if r.boxes.last() == Some(&r.box_) { "box" } else { "letters" }) });
}
let words = r.text.split_whitespace().count() as f64;
let need = (0.3 * words).max(1.0);
@@ -190,66 +225,49 @@ pub(crate) fn text_rules(runs: &[Run], heard: Option<&[Word]>, w: f64, h: f64, s
}
}
pub(crate) fn quote(s: &str) -> String {
pub fn quote(s: &str) -> String {
let s: String = s.chars().take(40).collect();
format!("\u{201c}{s}\u{201d}")
}
/// Caption contrast: at each text's middle frame, the pixels behind it against its colour, at least 3:1. The pixels
/// behind are the half of the box least like the text.
pub(crate) fn contrast(video: &str, runs: &[Run], w: f64, h: f64, probe: &Probe, issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let (sx, sy) = (probe.w / w, probe.h / h);
let mut low = 0;
let mut measured = 0;
for r in runs.iter().filter(|r| r.size >= 20.0).take(80) {
let [x, y, bw, bh] = r.box_;
let crop = [(x * sx).max(0.0) as u32, (y * sy).max(0.0) as u32, (bw * sx) as u32, (bh * sy) as u32];
if crop[0] + crop[2] > probe.w as u32 || crop[1] + crop[3] > probe.h as u32 {
continue;
}
let t = (r.from + r.to) / 2.0;
// the same measure `raea world` joins to a text from its render (raea-sys-measure, DR2)
let Some(ratio) = raea_sys_measure::contrast(std::path::Path::new(video), t, crop, &r.color) else { continue };
measured += 1;
if ratio < 3.0 {
low += 1;
issues.push(Issue { rule: "contrast", p: 1, at: Some(t), says: format!("{} is {ratio:.1}:1 against what's behind it; make it at least 3:1 (a band, a shadow for separation, or another colour)", quote(&r.text)) });
}
}
if measured > 0 && low == 0 {
passed.push(format!("contrast: {measured} texts at 3:1 or better against their pixels"));
}
}
/// A transcript's word: its text, start and end in seconds (its end is its start when the transcript doesn't say).
pub(crate) use raea_core_facts::Word;
pub use raea_core_facts::Word;
/// A transcript's words (raea_core_facts::transcript_words: {text, start} in seconds, or t, start_ms, or {text, from}
/// in frames at `fps`), as the app's words.json and `raea render --words` have them.
pub(crate) fn transcript(path: &str, fps: f64) -> R<Vec<Word>> {
pub fn transcript(path: &str, fps: f64) -> R<Vec<Word>> {
let v: Value = serde_json::from_str(&std::fs::read_to_string(path).map_err(|e| format!("{path}: {e}"))?).map_err(|e| format!("{path}: {e}"))?;
v.as_array().ok_or_else(|| format!("{path}: expected an array of words ({{text, start}} in seconds or {{text, from}} in frames)"))?;
Ok(raea_core_facts::transcript_words(&v, fps))
}
pub(crate) use raea_core_facts::word_key as norm;
pub use raea_core_facts::word_key as norm;
pub(crate) const SMALL: [&str; 24] = ["the", "and", "you", "your", "for", "with", "that", "this", "its", "it's", "are", "was", "our", "out", "from", "into", "then", "than", "but", "not", "all", "can", "has", "have"];
pub const SMALL: [&str; 24] = ["the", "and", "you", "your", "for", "with", "that", "this", "its", "it's", "are", "was", "our", "out", "from", "into", "then", "than", "but", "not", "all", "can", "has", "have"];
/// Cues land on their words: a text whose words the voice says nearby comes on with the first of them, not after it.
/// The text is found by its first word of weight, and then measured from the first word it shows: a caption "of the
/// spend" comes on with "of", when the voice says "of the" just before "spend".
pub(crate) fn cues(runs: &[Run], words: &[Word], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
pub fn cues(runs: &[Run], words: &[Word], issues: &mut Vec<Issue>, passed: &mut Vec<String>) {
let (mut checked, mut off) = (0, 0);
for r in runs {
let shown: Vec<String> = r.text.split_whitespace().map(norm).filter(|t| !t.is_empty()).collect();
let Some((k, i)) = shown.iter().enumerate().filter(|(_, t)| t.len() >= 3 && !SMALL.contains(&t.as_str())).find_map(|(k, t)| {
words.iter().enumerate().filter(|(_, w)| norm(&w.text) == *t && (w.start - r.from).abs() <= 2.0).min_by(|(_, a), (_, b)| (a.start - r.from).abs().total_cmp(&(b.start - r.from).abs())).map(|(i, _)| (k, i))
// a one-word card matches only a word said right by it: the same word said 2 s earlier is another moment
let near = if shown.len() == 1 { 0.75 } else { 2.0 };
words.iter().enumerate().filter(|(_, w)| norm(&w.text) == *t && (w.start - r.from).abs() <= near).min_by(|(_, a), (_, b)| (a.start - r.from).abs().total_cmp(&(b.start - r.from).abs())).map(|(i, _)| (k, i))
}) else {
continue;
};
// back over the words the text shows before it, while the voice says them in the same order just before
let back = (1..=k.min(i)).take_while(|&n| norm(&words[i - n].text) == shown[k - n]).last().unwrap_or(0);
// a caption says what the voice says: at least half its words, in order, around the anchor. A card that only
// shares one word with another line ("Wirestock x OpenAI Sora" against "At Wirestock, I worked on...") isn't
// a caption of it, and holding it to that word's time was a false P1
let fwd = (1..).take_while(|&n| k + n < shown.len() && i + n < words.len() && norm(&words[i + n].text) == shown[k + n]).last().unwrap_or(0);
if (back + 1 + fwd) * 2 < shown.len() {
continue;
}
let w = &words[i - back];
let tok = norm(&w.text);
checked += 1;
+4
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" }
@@ -17,6 +19,8 @@ serde_json = "1"
# project's compositions
raea-core-brief = { path = "../../core/brief" }
raea-app-check = { path = "../check" }
# the check's text rules, held to a video render's manifest as it ends
raea-app-check-text = { path = "../check/text" }
raea-app-registry = { path = "../workspace/registry" }
# the project's notes, whose asks' checks raea check runs beside its rules (DR6)
raea-app-notes = { path = "../notes" }
+13 -6
View File
@@ -32,13 +32,20 @@ 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.
/// The .ts files `--taste` names: the file, or every .ts in the folder. A file named under the person's taste folder
/// that isn't there yet is a note, not a refusal: the skill prescribes --taste on that folder's own taste file, and a
/// machine with none yet should still check (#89); any other missing path is left to the reader to refuse.
pub fn taste_files(args: &[String]) -> Vec<PathBuf> {
let Some(t) = flag(args, "--taste").map(PathBuf::from) else { return vec![] };
if t.extension().is_some_and(|x| x == "ts") {
let home = taste_dir().map(std::path::absolute).and_then(Result::ok);
if !t.is_file() && t.parent().map(std::path::absolute).and_then(Result::ok) == home {
eprintln!("note: no taste yet ({} isn't there); checking without it", t.display());
return vec![];
}
return vec![t];
}
let mut v: Vec<PathBuf> = std::fs::read_dir(&t).into_iter().flatten().filter_map(|e| e.ok().map(|e| e.path())).filter(|f| f.extension().is_some_and(|x| x == "ts")).collect();
@@ -106,7 +113,7 @@ fn held(project: &Path, given: Vec<PathBuf>, host: &Host) -> (Vec<Rule>, Vec<Fin
}
}
let ws = record::up(project, ".raea/workspace");
for (dir, scope) in ws.iter().map(|w| (w.join("controllers"), "workspace")).chain([(project.join("controllers"), "project")]) {
for (dir, scope) in ws.iter().map(|w| (raea_app_registry::shared_dir(w, "controllers"), "workspace")).chain([(project.join("controllers"), "project")]) {
// a workspace's own folder is its project's too: read once
if scope == "project" && ws.as_deref() == Some(project) {
continue;
@@ -126,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));
@@ -318,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);
+45 -1
View File
@@ -38,7 +38,7 @@ pub fn rendered(args: &[String]) -> i32 {
if args.first().map(String::as_str) != Some("render") {
return 0;
}
let found = finding::taken();
let mut found = finding::taken();
let through = despite(args, std::env::var("RAEA_DESPITE").ok());
let excused: Vec<Despite> = through.iter().map(|(c, w)| Despite { check: c.clone(), why: w.clone() }).collect();
let out = raea_runtime_bundle::flag(args, "-o").or_else(|| raea_runtime_bundle::flag(args, "--review")).map(PathBuf::from);
@@ -46,6 +46,13 @@ pub fn rendered(args: &[String]) -> i32 {
let manifest = raea_runtime_bundle::flag(args, "--manifest").map(PathBuf::from).or_else(|| Some(raea_runtime_world::manifest_for(out.as_deref()?, std::path::Path::new(args.get(1)?))));
if let Some(m) = manifest {
if let Some(mut v) = std::fs::read(&m).ok().and_then(|b| serde_json::from_slice::<Value>(&b).ok()) {
// a video's text, held to the check's text rules as it finishes, a check's round sooner
if out.as_deref().and_then(|o| o.extension()).is_some_and(|x| x == "mp4" || x == "mov") {
for f in text_found(&v) {
println!("{}", f.line());
found.push(f);
}
}
v["findings"] = json!(found);
if !excused.is_empty() {
v["despite"] = json!(excused);
@@ -63,6 +70,26 @@ pub fn rendered(args: &[String]) -> i32 {
code
}
/// What a video render's text breaks, from its manifest (raea-app-check-text, the rules `raea check` holds it to): text
/// off the frame is an error, as the check has it; text in a UI zone a warn, by the default zones, since the platform's
/// are the check's to decide (`--platform`); reading time waits for the check, which has the transcript to tell a
/// caption the voice reads out from one that has to be read.
fn text_found(manifest: &Value) -> Vec<Finding> {
let runs = raea_app_check_text::text_runs(manifest);
let (w, h, fps) = (manifest["width"].as_f64().unwrap_or(1080.0), manifest["height"].as_f64().unwrap_or(1920.0), manifest["fps"].as_f64().unwrap_or(30.0));
let (mut issues, mut passed) = (Vec::new(), Vec::new());
raea_app_check_text::text_rules(&runs, None, w, h, None, None, &mut issues, &mut passed);
let mut found = Vec::new();
for mut i in issues.into_iter().filter(|i| i.rule != "reading") {
if i.rule == "safe-area" {
i.p = 2;
i.says.push_str(" (by the default zones: `raea check --platform P` holds it to the platform's)");
}
found.push(i.finding("raea render", fps));
}
found
}
#[cfg(test)]
mod tests {
use super::*;
@@ -71,6 +98,23 @@ mod tests {
v.iter().map(|a| a.to_string()).collect()
}
/// A video's text off the frame fails its render, as the check fails it; text in a UI zone is a warn by the
/// default zones; a word on screen too briefly is left to the check, which has the transcript
#[test]
fn a_video_render_holds_its_text_to_the_check_s_rules() {
let text = |t: &str, b: [f64; 4]| json!({"text": t, "box": b, "opacity": 1.0, "size": 60.0, "color": "rgb(255, 255, 255)"});
let frames: Vec<Value> = (0..48).map(|f| json!({"frame": f, "videos": [], "text": [
text("OFF THE EDGE", [900.0, 800.0, 400.0, 80.0]),
text("Per month", [700.0, 1233.0, 318.0, 44.0]),
if f < 3 { text("Two words", [200.0, 900.0, 300.0, 80.0]) } else { json!({"text": "", "box": [0, 0, 0, 0]}) },
]})).collect();
let found = text_found(&json!({"width": 1080, "height": 1920, "fps": 24, "frames": frames}));
let got: Vec<(&str, Level)> = found.iter().map(|f| (f.check.as_str(), f.level)).collect();
assert_eq!(got, vec![("clipped", Level::Error), ("safe-area", Level::Warn)], "{found:?}");
assert!(found[1].says.contains("--platform"));
assert_eq!(found[0].frames, Some([0, 1]));
}
#[test]
fn an_error_fails_the_render_unless_it_is_let_through_and_says_by_what() {
let found = vec![Finding::new("clips", Level::Error, "rider in seat", "raea render"), Finding::new("tilted", Level::Warn, "vase leans", "raea render")];
+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();
+25
View File
@@ -0,0 +1,25 @@
[package]
name = "raea-app-fingerprint"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
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
raea-sys-fingerprint-use = { path = "../../systems/fingerprint-use" }
raea-sys-fingerprint-things = { path = "../../systems/fingerprint-things" }
# the encoders and the columns they make
raea-sys-columns = { path = "../../systems/columns" }
# raea check's floor on the file: its findings go in the summary, and a check wins over a head (FP4c)
raea-app-check = { path = "../check" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
# the draws of FP0b's few-shot curves, seeded (bootstrap.rs)
fastrand = "2"
+87
View File
@@ -0,0 +1,87 @@
//! Approvals are positives (docs/fingerprint.feature FP6a): an approved cut, a picture lock, a publish or a golden
//! reference says every moment of it is clean on every axis, except where the person left a note. `raea fingerprint
//! approve FILE... [--project P]` adds a clean row on every axis ("*") for each 2 s window of each file, skipping the
//! windows within 2 s of a pinned note on that file in its project's feed (.raea/feed/*.json), since a note there may
//! name a defect. Notes aren't read into labels here; that is FP5a.
use crate::bootstrap::WIN;
use crate::flag;
use anyhow::{Result, anyhow};
use raea_sys_columns::Encoders;
use raea_sys_fingerprint::evidence::{Row, features};
use raea_sys_fingerprint::folder::Folder;
use raea_sys_fingerprint::taxonomy::Fingerprint;
use std::path::Path;
/// The seconds a note was pinned at on `file`, from every post in its project's feed that shows a file of that name
pub(crate) fn noted(file: &Path) -> Vec<f64> {
let Some(name) = file.file_name().and_then(|n| n.to_str()) else { return Vec::new() };
let Some(feed) = file.ancestors().map(|d| d.join(".raea/feed")).find(|d| d.is_dir()) else { return Vec::new() };
let mut at = Vec::new();
for e in std::fs::read_dir(feed).into_iter().flatten().flatten() {
let Ok(text) = std::fs::read_to_string(e.path()) else { continue };
let Ok(post) = serde_json::from_str::<serde_json::Value>(&text) else { continue };
let shows = post["media"].as_array().into_iter().flatten().any(|m| m["path"].as_str().is_some_and(|p| p.ends_with(name)));
if shows {
at.extend(post["notes"].as_array().into_iter().flatten().filter_map(|n| n["pin"]["t"].as_f64()));
}
}
at
}
/// The windows an approval labels clean: every WIN seconds of the piece, away from its notes
pub(crate) fn windows(dur: f64, notes: &[f64]) -> Vec<(f64, f64)> {
let n = (dur / WIN).floor() as usize;
(0..n).map(|i| (i as f64 * WIN, (i + 1) as f64 * WIN)).filter(|(a, b)| !notes.iter().any(|t| *t > a - WIN && *t < b + WIN)).collect()
}
pub(crate) fn approve(enc: &mut Encoders, dir: &Folder, fp: &Fingerprint, args: &[String], cwd: &Path, project: impl Fn(&Path) -> String) -> Result<(String, usize)> {
let files = crate::named(args, cwd)?;
if files.is_empty() {
return Err(anyhow!("which approved work? raea fingerprint approve FILE..."));
}
let mut l = dir.ledger()?;
let mut out = String::new();
let mut added = 0;
for file in &files {
let c = enc.columns(file)?;
// an approval given again replaces the last one for that media
l.retain(|r| !(r.source == "approval" && r.media == c.media));
let notes = noted(file);
let w = windows(c.dur, &notes);
for (a, b) in &w {
let row = Row {
media: c.media.clone(),
a: *a,
b: *b,
axis: "*".into(),
bad: false,
weight: 1.0,
who: fp.who.clone().unwrap_or_else(|| "me".into()),
source: "approval".into(),
project: flag(args, "--project").map_or_else(|| project(file), str::to_string),
kind: None,
region: None,
words: None,
at: 0,
pin: None,
band: None,
};
l.push(row, &features(&c, *a, *b));
}
added += w.len();
out += &format!("approved {}: {} clean windows on every axis{}\n", file.display(), w.len(), if notes.is_empty() { String::new() } else { format!(", {} noted moments left out", notes.len()) });
}
dir.write_ledger(&l)?;
Ok((out, added))
}
#[cfg(test)]
mod tests {
#[test]
fn an_approval_leaves_out_the_windows_near_a_note() {
assert_eq!(super::windows(9.0, &[]), vec![(0.0, 2.0), (2.0, 4.0), (4.0, 6.0), (6.0, 8.0)]);
// a note at 5 s: the windows within 2 s of it go
assert_eq!(super::windows(12.0, &[5.0]), vec![(0.0, 2.0), (8.0, 10.0), (10.0, 12.0)]);
}
}
+281
View File
@@ -0,0 +1,281 @@
//! The bootstrap (FP4a, FP4b): known defects put into windows of the person's own real work, so the mechanical axes
//! learn from labels by construction, and the cheats each must still catch. Each source gives `per` 2 s windows
//! from 0.5 s to its end less 2.5 s (FP0b's protocol); each window gives a clean row ("*"), a row per picture and
//! sound defect, and a row per cheat. Only what the damage changed is embedded again: a freeze reuses the first
//! frame's vector, a flash re-embeds one frame, a sound defect leaves the picture alone.
//!
//! Then it measures what FP0b measured, in Rust: each axis's AUC from k = 4, 16 and 32 labelled windows a class, held
//! out by source (5 folds x 5 draws, the scaler fit on every plain row of the training sources), on its own
//! modality and on the one FP0b used; and each word head's AUC and catch rate with no labels (FP0g).
use raea_sys_fingerprint::evidence::{Ledger, Row, features, slice};
use raea_sys_fingerprint::head::{Logistic, Scaler, auc, quantile, share_over};
use raea_sys_fingerprint::taxonomy::Fingerprint;
use raea_sys_fingerprint::train::{C, folds};
use raea_sys_fingerprint::words::Words;
use anyhow::Result;
use raea_sys_columns::damage::{self, CHEATS, Noise, PICTURE, SOUND};
use raea_sys_columns::media::{self, Rgb};
use raea_sys_columns::window::Modality;
use raea_sys_columns::{Columns, Encoders, FPS};
use serde::Serialize;
use std::collections::{BTreeMap, BTreeSet};
use std::path::PathBuf;
/// The window, seconds
pub const WIN: f64 = 2.0;
/// Sources shorter than this are skipped (FP0b's)
pub const SHORTEST: f64 = 6.0;
pub const KS: [usize; 3] = [4, 16, 32];
/// FP0b's AUC at k = 32 for each axis, on the modality it was measured on (docs/fingerprint.md FP0b, FP0g)
pub const FP0B: [(&str, Modality, f64); 11] = [
("blur", Modality::Picture, 1.00),
("dark", Modality::Picture, 0.95),
("glow", Modality::Picture, 0.80),
("flash", Modality::Change, 0.97),
("freeze", Modality::Change, 1.00),
("noise", Modality::Events, 1.00),
("dropout", Modality::Events, 0.97),
("clip", Modality::Events, 0.98),
("noise", Modality::Sound, 1.00),
("dropout", Modality::Sound, 0.99),
("clip", Modality::Sound, 1.00),
];
#[derive(Debug, Default, Serialize)]
pub struct Made {
pub sources: usize,
pub windows: usize,
pub rows: usize,
/// windows too quiet for a gap or clipping to change them, which get only the noise damage
pub quiet: usize,
pub skipped: Vec<String>,
}
/// The rows a bootstrap makes, which the next bootstrap replaces
fn made_here(r: &Row) -> bool {
matches!(r.source.as_str(), "damage" | "cheat")
}
/// A plain damage row on `axis` ("*" for the clean windows)
fn damage_on(r: &Row, axis: &str) -> bool {
r.source == "damage" && r.axis == axis
}
/// The plain damage rows on `axis`
fn damage_rows(l: &Ledger, axis: &str) -> Vec<usize> {
(0..l.rows.len()).filter(|&i| damage_on(&l.rows[i], axis)).collect()
}
/// Each defect of a sense as (kind, axis, source): the plain ones, then their disguises
fn damages(sense: &[&'static str]) -> Vec<(&'static str, &'static str, &'static str)> {
sense.iter().map(|k| (*k, *k, "damage")).chain(CHEATS.iter().filter(|c| sense.contains(&c.1)).map(|c| (c.0, c.1, "cheat"))).collect()
}
/// Below this a window is near silence: a gap or clipping changes nothing, and a row saying it does teaches noise
const QUIET_DB: f32 = -45.0;
/// The window's loudness in dB over all of it
fn loudness(pcm: &[f32]) -> f32 {
if pcm.is_empty() {
return -100.0;
}
(10.0 * (pcm.iter().map(|x| x * x).sum::<f32>() / pcm.len() as f32).max(1e-10).log10()).max(-100.0)
}
fn zeros_to(mut v: Vec<f32>, n: usize) -> Vec<f32> {
v.resize(n, 0.0);
v
}
/// The picture columns of damaged frames, embedding only frames the damage changed
fn picture_of(enc: &mut Encoders, clean: &[Rgb], sig: &[f32], look: &[f32], d: &[Rgb]) -> Result<(Vec<f32>, Vec<f32>)> {
let (sd, ld) = (sig.len() / clean.len().max(1), look.len() / clean.len().max(1));
let mut fresh: Vec<Rgb> = Vec::new();
let mut from: Vec<Result<usize, usize>> = Vec::new();
for f in d {
match clean.iter().position(|c| c == f) {
Some(j) => from.push(Ok(j)),
None => {
fresh.push(f.clone());
from.push(Err(fresh.len() - 1));
}
}
}
let (fs, fl) = if fresh.is_empty() { (Vec::new(), Vec::new()) } else { enc.picture(&fresh)? };
let (mut s, mut l) = (Vec::with_capacity(sig.len()), Vec::with_capacity(look.len()));
for f in from {
let (ss, ll, j) = match f {
Ok(j) => (sig, look, j),
Err(k) => (&fs[..], &fl[..], k),
};
s.extend_from_slice(&ss[j * sd..(j + 1) * sd]);
l.extend_from_slice(&ll[j * ld..(j + 1) * ld]);
}
Ok((s, l))
}
/// The bootstrap's rows for `files` into the ledger, replacing any it made before. `say` hears each source's progress.
pub fn rows(enc: &mut Encoders, who: &str, files: &[PathBuf], per: usize, l: &mut Ledger, say: &mut dyn FnMut(String)) -> Result<Made> {
l.retain(|r| !made_here(r));
let mut made = Made::default();
let mut noise = Noise::new(0);
for (n, file) in files.iter().enumerate() {
let dur = media::duration(file).unwrap_or(0.0);
if dur < SHORTEST {
made.skipped.push(format!("{} ({dur:.1} s, under {SHORTEST} s)", file.display()));
continue;
}
let sha = media::sha256(file)?;
let frames = media::frames(file, FPS, 0.0, dur)?;
let (p16, p48) = (media::sound(file, 16_000)?, media::sound(file, 48_000)?);
made.sources += 1;
for w in 0..per {
let t = 0.5 + (dur - 3.0) * w as f64 / (per - 1).max(1) as f64;
let i0 = (t * FPS).round() as usize;
let Some(fr) = frames.get(i0..i0 + (WIN * FPS) as usize) else { continue };
let cut = |p: &[f32], rate: f64| zeros_to(p.get((t * rate) as usize..).unwrap_or(&[]).iter().take((WIN * rate) as usize).copied().collect(), (WIN * rate) as usize);
let (w16, w48) = (cut(&p16, 16_000.0), cut(&p48, 48_000.0));
let (sig, look) = enc.picture(fr)?;
let (clap, yam) = enc.sound(&w16, &w48)?;
let clean = Columns { media: sha.clone(), dur: WIN, sig, look, clap, yam, level: media::levels(&w16, 16_000), text: Vec::new() };
let push = |l: &mut Ledger, c: &Columns, axis: &str, kind: &str, source: &str| {
let r = Row {
media: sha.clone(),
a: t,
b: t + WIN,
axis: axis.into(),
bad: axis != "*",
weight: 1.0,
who: who.into(),
source: source.into(),
project: sha[..12].to_string(),
kind: Some(kind.into()),
region: None,
words: None,
at: 0,
pin: None,
band: None,
};
l.push(r, &features(c, 0.0, WIN));
};
push(l, &clean, "*", "clean", "damage");
for (kind, axis, source) in damages(&PICTURE) {
let (sig, look) = picture_of(enc, fr, &clean.sig, &clean.look, &damage::picture(fr, kind))?;
push(l, &Columns { sig, look, ..clean.clone() }, axis, kind, source);
}
let quiet = loudness(&w16) < QUIET_DB;
made.quiet += quiet as usize;
for (kind, axis, source) in damages(&SOUND).into_iter().filter(|s| !quiet || s.1 == "noise") {
let (d16, d48) = (damage::sound(&w16, kind, 16_000, &mut noise), damage::sound(&w48, kind, 48_000, &mut noise));
let (clap, yam) = enc.sound(&d16, &d48)?;
push(l, &Columns { clap, yam, level: media::levels(&d16, 16_000), ..clean.clone() }, axis, kind, source);
}
made.windows += 1;
}
say(format!("source {}/{} {}: {} windows so far", n + 1, files.len(), file.display(), made.windows));
}
made.rows = l.rows.iter().filter(|r| made_here(r)).count();
Ok(made)
}
#[derive(Debug, Serialize)]
pub struct Curve {
pub axis: String,
pub modality: Modality,
/// AUC at each k
pub k: BTreeMap<usize, f64>,
/// FP0b's at k = 32 on this modality, and whether this run came within 0.03 of it or beat it
pub fp0b: Option<f64>,
pub holds: Option<bool>,
}
fn sample(rng: &mut fastrand::Rng, from: &[usize], k: usize) -> Vec<usize> {
let mut v = from.to_vec();
rng.shuffle(&mut v);
v.truncate(k);
v
}
/// FP0b's few-shot curve for one axis on one modality, from the bootstrap's rows
pub fn curve(l: &Ledger, axis: &str, m: Modality, rng: &mut fastrand::Rng) -> Curve {
let s = slice(m);
let row = |i: usize| &l.features(i)[s.clone()];
let plain = |i: &usize| l.rows[*i].source == "damage";
let (clean, bad) = (damage_rows(l, "*"), damage_rows(l, axis));
let projects = l.projects(&clean);
let mut k_auc = BTreeMap::new();
for k in KS {
let mut aucs = Vec::new();
for fold in folds(&projects) {
let held = |i: &usize| fold.contains(&l.rows[*i].project);
let base: Vec<&[f32]> = (0..l.rows.len()).filter(|i| plain(i) && !held(i)).map(row).collect();
let sc = Scaler::fit(&base);
let (tc, tb): (Vec<usize>, Vec<usize>) = (clean.iter().copied().filter(|i| !held(i)).collect(), bad.iter().copied().filter(|i| !held(i)).collect());
if tc.len() < k || tb.len() < k {
continue;
}
for _ in 0..5 {
let (a, b) = (sample(rng, &tc, k), sample(rng, &tb, k));
let x: Vec<&[f32]> = a.iter().chain(&b).map(|&i| row(i)).collect();
let y: Vec<bool> = (0..2 * k).map(|i| i >= k).collect();
let f = Logistic::fit(sc.clone(), &x, &y, None, C, true);
let score = |v: &Vec<usize>| -> Vec<f32> { v.iter().filter(|i| held(i)).map(|&i| f.score(row(i))).collect() };
aucs.push(auc(&score(&bad), &score(&clean)));
}
}
let ok: Vec<f64> = aucs.into_iter().filter(|a| a.is_finite()).collect();
if !ok.is_empty() {
k_auc.insert(k, ok.iter().sum::<f64>() / ok.len() as f64);
}
}
let fp0b = FP0B.iter().find(|(a, mm, _)| *a == axis && *mm == m).map(|x| x.2);
let holds = fp0b.zip(k_auc.get(&32)).map(|(want, got)| *got >= want - 0.03);
Curve { axis: axis.into(), modality: m, k: k_auc, fp0b, holds }
}
/// Every mechanical axis's curve on its own modality and on FP0b's
pub fn curves(fp: &Fingerprint, l: &Ledger) -> Vec<Curve> {
let mut rng = fastrand::Rng::with_seed(1);
let mut out = Vec::new();
for axis in PICTURE.iter().chain(&SOUND) {
let own = fp.axis(axis).map(|a| a.modality);
let mut ms: Vec<Modality> = own.into_iter().chain(FP0B.iter().filter(|x| x.0 == *axis).map(|x| x.1)).collect();
ms.dedup();
for m in ms.into_iter().collect::<BTreeSet<_>>() {
out.push(curve(l, axis, m, &mut rng));
}
}
out
}
#[derive(Debug, Serialize)]
pub struct WordScore {
pub axis: String,
/// AUC, damaged against clean windows, with no labels
pub auc: f64,
/// the share of damaged windows over the score that flags 10% of clean ones
pub caught: f64,
/// each cheat's share over that same score
pub cheats: BTreeMap<String, f64>,
}
/// Each word head on the bootstrap's windows (FP0g)
pub fn word_scores(l: &Ledger, words: &Words) -> Vec<WordScore> {
let z = |i: usize, axis: &str| words.z(axis, l.features(i));
let of = |axis: &str, pick: &dyn Fn(&Row) -> bool| -> Vec<f32> { l.rows.iter().enumerate().filter(|(_, r)| pick(r)).filter_map(|(i, _)| z(i, axis)).collect() };
let mut out = Vec::new();
for axis in PICTURE.iter().chain(&SOUND) {
if !words.axes.iter().any(|w| w.0 == *axis) {
continue;
}
let clean = of(axis, &|r| damage_on(r, "*"));
let bad = of(axis, &|r| damage_on(r, axis));
let thr = quantile(&clean, 0.9);
let share = |v: &[f32]| share_over(v, thr);
let cheats = CHEATS.iter().filter(|c| c.1 == *axis).map(|c| (c.0.to_string(), share(&of(axis, &|r| r.source == "cheat" && r.kind.as_deref() == Some(c.0))))).collect();
out.push(WordScore { axis: axis.to_string(), auc: auc(&bad, &clean), caught: share(&bad), cheats });
}
out
}
+160
View File
@@ -0,0 +1,160 @@
//! `raea fingerprint` (docs/fingerprint.feature FP3a): a person's fingerprint made, bootstrapped, taught and used to
//! score a piece. The encoders take seconds to load, so the verbs run in a resident service (`raea fingerprint
//! serve`, serve.rs) that keeps them loaded: the first verb starts it, on localhost, and later verbs reach it in
//! milliseconds (earshot's CLI reloads its models on every call, 20-40 s). It leaves after 30 idle minutes, or on
//! `raea fingerprint stop`. RAEA_FINGERPRINT_HERE=1 runs a verb in this process instead.
mod approve;
mod bootstrap;
mod moving;
mod notes;
mod pairing;
mod pick;
mod postmortem;
mod profiles;
mod reembed;
mod serve;
mod things;
mod verbs;
use std::path::Path;
pub use serve::serve;
pub const USAGE: &str = "raea fingerprint new NAME [--who W] [--about TEXT] [--extends FP] [--kinds K,K] [--tags T,T] | raea fingerprint bootstrap FILE... [--from LIST] [--per N] | raea fingerprint teach FILE --axis A --at T [--bad|--good] [--span S] [--box x0,y0,x1,y1] [--words W] [--project P] | raea fingerprint approve FILE... [--project P] | raea fingerprint pair WORSE BETTER --axis A [--at T] [--then T2] | raea fingerprint versions V1 V2... | raea fingerprint profile REFS... --as NAME [--against LIST] | raea fingerprint score FILE [--was OLD] [--json] [--sheet out.png] [--timeline] [--profile NAME] | raea fingerprint report [--json] | raea fingerprint which [PATH] [--json] | raea fingerprint use NAME [--in project|workspace] [PATH] | raea fingerprint diff A B [--json] | raea fingerprint share NAME [--in project|workspace] [PATH] | raea fingerprint reembed PLACE... | raea fingerprint read PROJECT [--by kimi|claude] | raea fingerprint readings [PROJECT] [--ask N] [--tally] | raea fingerprint learn-notes [PROJECT] | raea fingerprint move [--fp CHILD] [--to PARENT] [--axis A] [--source S] [--project P] | raea fingerprint postmortem [PROJECT] [--ask N] [--tally] | raea fingerprint things FILE [--project P] [--json] | raea fingerprint stop [--fp NAME] (a person's sense of good work as axes with small heads over on-device encoders, docs/fingerprint.md: new makes ~/.raea/fingerprints/NAME with raea's base taxonomy in fingerprint.ts (or FP's axes with --extends), what it's for, the kinds of piece and project tags it judges, and every axis scoring from its words; bootstrap puts known defects into windows of real work and trains the mechanical axes, held out by source, and patch heads that say where in the frame a picture defect is; teach adds a label at a moment; approve makes approved work clean on every axis, away from its notes; pair says one moment is better than another on an axis (a pick, a hand edit); versions makes weak pairs of noted moments the next version changed; score prints the moments it expects a note on first (where in the frame, and the layers there, when its patch head points held out), then every axis per window with --json, a sheet PNG with --sheet, or the piece second by second in words with --timeline, and with --was OLD whether each of OLD's gating flags is fixed, still there, or looks disguised (nearer the axis's disguised defects than clean work); profile takes the ranges of work you admire (loudness, tilt, cut rate, motion, brightness, contrast, saturation, sharpness), checked leave-one-out, and score --profile says what falls outside them, where and which way; report says each head's held-out score, labels, cheats, gate and what it can't judge; which says the one that judges a piece (its project's, its workspace's, then yours) and why, use pins one there, diff lists the axes two fingerprints rank the same evidence most differently on, and share copies one's taxonomy and evidence (no heads, no media) into a project or workspace for its team; reembed moves a fingerprint's evidence to this machine's encoders, re-embedding the rows whose media it finds; read has a fresh kimi or claude session read a project's pinned notes into kinds and axes, readings puts them to you to check and tallies your answers, and learn-notes makes the defects and praise evidence once you've agreed with 45 kinds and 40 axes in 50, each project's in the fingerprint that judges it; move takes a child's own labels (by axis, source or project) up into a fingerprint it extends, which never reads them otherwise; postmortem scores every version in a project's feed and asks you at most ten yes/no questions in the app, each with its moment playing, where the fingerprint disagrees with your labels or is least sure, and --tally makes your answers evidence and says how each head's held-out score moved; things finds a piece's shots, its things (a render's layers, and the marks drawn on its notes) with their depth, and the camera's path, and says where a thing floats, two pass through each other, the camera lurches mid-move or nothing is on screen, as JSON for `raea check --things` with --json)";
/// Evaluates a .ts file's default export to its JSON (the CLI's spec host)
pub type Eval = fn(&Path) -> Result<String, String>;
/// The flags each verb takes, and whether each takes a value
pub(crate) const FLAGS: [(&str, bool); 31] = [
("--fp", true),
("--was", true),
("--to", true),
("--source", true),
("--kinds", true),
("--tags", true),
("--who", true),
("--about", true),
("--extends", true),
("--from", true),
("--per", true),
("--axis", true),
("--at", true),
("--then", true),
("--span", true),
("--box", true),
("--words", true),
("--project", true),
("--sheet", true),
("--in", true),
("--as", true),
("--against", true),
("--profile", true),
("--by", true),
("--ask", true),
("--tally", false),
("--bad", false),
("--good", false),
("--json", false),
("--timeline", false),
("--here", false),
];
/// A flag's value
pub(crate) fn flag<'a>(args: &'a [String], name: &str) -> Option<&'a str> {
args.iter().position(|a| a == name).and_then(|i| args.get(i + 1)).map(String::as_str)
}
pub(crate) fn has(args: &[String], name: &str) -> bool {
args.iter().any(|a| a == name)
}
/// A path as given, against the folder the verb ran in (an absolute one stays itself)
pub(crate) fn at(cwd: &Path, p: &str) -> std::path::PathBuf {
cwd.join(p)
}
/// The files a verb names, against the folder it ran in
pub(crate) fn named(args: &[String], cwd: &Path) -> anyhow::Result<Vec<std::path::PathBuf>> {
Ok(words(args).map_err(anyhow::Error::msg)?.iter().map(|f| at(cwd, f)).collect())
}
/// The files a list names, one a line against the list's own folder; blank lines and # lines are skipped
pub(crate) fn listed(cwd: &Path, list: &str) -> anyhow::Result<Vec<std::path::PathBuf>> {
use anyhow::Context;
let list = at(cwd, list);
let text = std::fs::read_to_string(&list).with_context(|| list.display().to_string())?;
let base = list.parent().unwrap_or(cwd);
Ok(text.lines().map(str::trim).filter(|l| !(l.is_empty() || l.starts_with('#'))).map(|l| at(base, l)).collect())
}
/// The words that aren't flags or their values; an unknown flag is an error
pub(crate) fn words(args: &[String]) -> Result<Vec<&str>, String> {
let mut out = Vec::new();
let mut it = args.iter();
while let Some(a) = it.next() {
match FLAGS.iter().find(|(f, _)| f == a) {
Some((_, true)) => {
it.next().ok_or_else(|| format!("{a} takes a value"))?;
}
Some(_) => {}
None if a.starts_with("--") => return Err(format!("no flag {a}")),
None => out.push(a.as_str()),
}
}
Ok(out)
}
/// `raea fingerprint VERB ...`, printed; its exit code (1: the verb failed, 2: the command was wrong)
pub fn cli(args: &[String], eval: Eval) -> i32 {
let verb = match args.first().map(String::as_str) {
None | Some("--help" | "-h" | "help") => {
println!("{USAGE}");
return 0;
}
Some(v) => v,
};
if let Err(e) = words(&args[1..]) {
eprintln!("raea fingerprint: {e}\n{USAGE}");
return 2;
}
match verb {
"serve" => match serve(eval) {
Ok(()) => 0,
Err(e) => {
eprintln!("raea fingerprint serve: {e:#}");
1
}
},
"report" => verbs::report_here(args),
"which" => pick::which_here(&args[1..], &std::env::current_dir().unwrap_or_default()),
"diff" => pick::diff_here(&args[1..]),
"read" => notes::read_here(&args[1..], &std::env::current_dir().unwrap_or_default()),
"readings" => notes::readings_here(&args[1..], &std::env::current_dir().unwrap_or_default()),
"share" => pick::share_here(&args[1..], &std::env::current_dir().unwrap_or_default()),
"use" => pick::use_here(&args[1..], &std::env::current_dir().unwrap_or_default()),
"new" | "bootstrap" | "teach" | "approve" | "pair" | "versions" | "learn-notes" | "move" | "postmortem" | "things" | "reembed" | "profile" | "score" | "stop" => {
let cwd = std::env::current_dir().unwrap_or_default();
let here = has(args, "--here") || std::env::var_os("RAEA_FINGERPRINT_HERE").is_some();
let (out, code) = if here { serve::here(args, &cwd, eval) } else { serve::call(args, &cwd) };
if !out.is_empty() {
println!("{}", out.trim_end());
}
code
}
v => {
eprintln!("raea fingerprint: no verb {v}\n{USAGE}");
2
}
}
}
#[cfg(test)]
mod tests {
#[test]
fn the_usage_names_every_flag() {
let missing: Vec<_> = super::FLAGS.iter().filter(|(f, _)| *f != "--here" && !super::USAGE.contains(f)).collect();
assert!(missing.is_empty(), "raea fingerprint takes flags its usage doesn't name: {missing:?}");
}
}
+86
View File
@@ -0,0 +1,86 @@
//! `raea fingerprint move [--fp CHILD] [--to PARENT] [--axis A] [--source S] [--project P]` (docs/fingerprint.feature
//! FP14d). A note or mark teaches the fingerprint that judged the piece, and a parent never reads a child's evidence
//! (inherit.rs), so one client's taste doesn't move the person's own. Moving labels up is the person's call: the
//! child's own rows that match leave its ledger for a fingerprint it extends (its nearest unless --to names one). A
//! row on an axis the parent hasn't, or on one the child says otherwise, stays: in the parent it would mean something
//! else.
use crate::{Eval, flag};
use anyhow::{Result, anyhow, bail};
use raea_sys_fingerprint::evidence::{Ledger, Row};
use raea_sys_fingerprint::folder::Folder;
use raea_sys_fingerprint::inherit;
use raea_sys_fingerprint::taxonomy::Fingerprint;
use std::collections::BTreeSet;
/// The rows `pick` takes from `child` into `parent`; returns how many moved
pub fn rows(child: &mut Ledger, parent: &mut Ledger, pick: &dyn Fn(&Row) -> bool) -> usize {
let mut n = 0;
for i in 0..child.rows.len() {
if pick(&child.rows[i]) {
parent.push(child.rows[i].clone(), child.features(i));
n += 1;
}
}
child.retain(|r| !pick(r));
n
}
/// The axes a row may carry into `parent`: the parent's own and inherited ones, less those the child overrides
pub fn carried(parent: &Fingerprint, eval: Eval, over: &BTreeSet<String>) -> BTreeSet<String> {
let full = inherit::axes(parent, &inherit::parents(parent, Some(eval)));
full.axes.iter().map(|a| a.name.clone()).filter(|a| !over.contains(a)).chain(["*".to_string()]).collect()
}
/// Moves the child's matching rows up and writes both ledgers; returns the parent's name and what it did
pub(crate) fn up(dir: &Folder, child: &Fingerprint, args: &[String], eval: Eval) -> Result<(String, String)> {
let (axis, source, project) = (flag(args, "--axis"), flag(args, "--source"), flag(args, "--project"));
if axis.is_none() && source.is_none() && project.is_none() {
bail!("say which labels: --axis A, --source S (note, teach, approval, pair, damage) or --project P");
}
let parents = inherit::parents(child, Some(eval));
let (pdir, parent) = match flag(args, "--to") {
Some(n) => parents.iter().find(|(_, p)| p.name == n).ok_or_else(|| anyhow!("{} doesn't extend {n}: labels only move up", child.name))?,
None => parents.first().ok_or_else(|| anyhow!("{} extends nothing, so its labels have nowhere to move up to", child.name))?,
};
let keep = carried(parent, eval, &inherit::overrides(child, &parents));
let wanted = |r: &Row| axis.is_none_or(|a| r.axis == a) && source.is_none_or(|s| r.source == s) && project.is_none_or(|p| r.project == p);
let (mut lc, mut lp) = (dir.ledger()?, pdir.ledger()?);
let stay = lc.rows.iter().filter(|r| wanted(r) && !keep.contains(&r.axis)).count();
let n = rows(&mut lc, &mut lp, &|r| wanted(r) && keep.contains(&r.axis));
if n == 0 && stay == 0 {
bail!("none of {}'s own labels match", child.name);
}
pdir.write_ledger(&lp)?;
dir.write_ledger(&lc)?;
let mut out = format!("{n} labels moved from {} up to {}\n", child.name, parent.name);
if stay > 0 {
out += &format!("{stay} stay: their axes are {}'s own, and would mean something else in {}\n", child.name, parent.name);
}
Ok((parent.name.clone(), out))
}
#[cfg(test)]
mod tests {
use super::*;
fn row(axis: &str, source: &str) -> Row {
Row { media: "m".into(), a: 0.0, b: 2.0, axis: axis.into(), bad: true, weight: 1.0, who: "me".into(), source: source.into(), project: "p".into(), kind: None, region: None, words: None, at: 0, pin: None, band: None }
}
#[test]
fn only_picked_rows_move_and_keep_their_features() {
let w = raea_sys_fingerprint::evidence::width();
let (mut c, mut p) = (Ledger::default(), Ledger::default());
c.push(row("blur", "note"), &vec![1.0; w]);
c.push(row("glow", "note"), &vec![2.0; w]);
c.push(row("blur", "damage"), &vec![3.0; w]);
p.push(row("hiss", "teach"), &vec![4.0; w]);
let n = rows(&mut c, &mut p, &|r| r.source == "note" && r.axis == "blur");
assert_eq!(n, 1);
assert_eq!(c.rows.iter().map(|r| r.axis.as_str()).collect::<Vec<_>>(), ["glow", "blur"]);
assert_eq!((c.features(0)[0], c.features(1)[0]), (2.0, 3.0), "the child's rows keep their own features");
assert_eq!(p.rows.len(), 2);
assert_eq!(p.features(1)[0], 1.0, "a moved row carries its features");
}
}
+308
View File
@@ -0,0 +1,308 @@
//! Notes become evidence (docs/fingerprint.feature FP5a, FP5b). `raea fingerprint read PROJECT [--by kimi|claude]`
//! has a fresh agent session read each pinned note on the project's videos into a kind (defect, direction, praise or
//! both) and an axis from the fingerprint's own axes, kept in the fingerprint's readings.jsonl. Nothing trains on them
//! yet: `raea fingerprint readings --ask N` puts N readings to the person as questions in the app (`raea show
//! --question`, answers to the "fingerprint" inbox), `readings --tally` counts how often the person agreed, and only
//! once the kind is right 45 times in 50 and the axis 40 (FP5b) does `raea fingerprint learn-notes` make each defect
//! or praise an evidence row over its span (1.5 s before the pin to 0.5 s after). A direction goes to the brief and the
//! agent, never into a head. A note's marks (FP11b) make its row a region label: the box around its marks, boxes and
//! lassos; a span pin sets the row's time. On a render with a layer pass, a reading keeps the layers under its pin,
//! and the reader is told them.
use crate::{flag, has, words};
use raea_sys_fingerprint::folder::Folder;
use raea_sys_fingerprint::taxonomy::Fingerprint;
pub use raea_sys_fingerprint_use::reading::{Reading, agreement, earned};
use raea_sys_fingerprint_use::reading::span;
use serde_json::{Value, json};
use std::path::{Path, PathBuf};
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 = 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())
}
/// Every video in the project's feed, each version's, found on this machine (FP7a's postmortem looks back on them)
pub fn videos(project: &Path) -> Vec<PathBuf> {
let mut out: Vec<PathBuf> = Vec::new();
for e in std::fs::read_dir(project.join(".raea/feed")).into_iter().flatten().flatten() {
let Some(post) = std::fs::read_to_string(e.path()).ok().and_then(|t| serde_json::from_str::<Value>(&t).ok()) else { continue };
for m in post["media"].as_array().into_iter().flatten().filter(|m| m["kind"] == "video") {
if let Some(v) = media(project, m).filter(|v| !out.contains(v)) {
out.push(v);
}
}
}
out.sort();
out
}
/// Every person's pinned note on a video in the project's feed
pub fn pinned(project: &Path) -> Vec<Reading> {
let name = project.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default();
let mut out = Vec::new();
for e in std::fs::read_dir(project.join(".raea/feed")).into_iter().flatten().flatten() {
let Ok(post) = std::fs::read_to_string(e.path()).ok().and_then(|t| serde_json::from_str::<Value>(&t).ok()).ok_or(()) else { continue };
let Some(video) = post["media"].as_array().into_iter().flatten().find(|m| m["kind"] == "video").and_then(|m| media(project, m)) else { continue };
for n in post["notes"].as_array().into_iter().flatten() {
let (Some(t), Some(text)) = (n["pin"]["t"].as_f64(), n["text"].as_str()) else { continue };
if n["author"]["kind"] != "person" {
continue;
}
let to = n["pin"]["to"].as_f64().filter(|&to| to > t);
let at = n["pin"]["x"].as_f64().zip(n["pin"]["y"].as_f64()).map(|(x, y)| [x - 0.01, y - 0.01, x + 0.01, y + 0.01].map(|v| v.clamp(0.0, 1.0)));
let layers = at.map(|b| raea_sys_fingerprint_things::located::layers(&video, t, b)).unwrap_or_default();
out.push(Reading { note: n["id"].as_str().unwrap_or("").into(), text: text.into(), who: n["author"]["name"].as_str().unwrap_or("me").into(), media: video.clone(), t, project: name.clone(), to, region: raea_sys_fingerprint_use::grow::marked(&n["pin"]), layers, band: raea_sys_fingerprint_use::grow::sound_band(&n["pin"]), ..Default::default() });
}
}
out
}
/// The reading prompt: the axes with their words, then the notes, and the JSON to answer
pub fn prompt(fp: &Fingerprint, notes: &[Reading]) -> String {
let axes = fp.axes.iter().map(|a| format!("- {}: {}", a.name, a.words.join("; "))).collect::<Vec<_>>().join("\n");
let on = |n: &Reading| if n.layers.is_empty() { String::new() } else { format!(" (pinned on {})", n.layers.join(", ")) };
let list = notes.iter().map(|n| format!("{}: {}{}", n.note, n.text.replace('\n', " "), on(n))).collect::<Vec<_>>().join("\n");
format!(
"You read a person's review notes on their videos. Read each note only; open no file and change nothing.\n\
For each note say its kind: \"defect\" (it names something wrong at that moment), \"direction\" (it asks for a creative change, \
not a fault), \"praise\" (it says something is good) or \"both\" (a defect and a direction). Then the axis it is about, from \
these and only these, or null when none fits:\n{axes}\n\nThe notes, one a line, id first:\n{list}\n\n\
End with only this JSON, nothing after it: [{{\"id\": \"\", \"kind\": \"defect|direction|praise|both\", \"axis\": \"name or null\"}}]"
)
}
/// The JSON array an answer ends with
pub fn answer(text: &str) -> Option<Vec<Value>> {
let end = text.rfind(']')?;
let start = text[..end].rfind("[{").or_else(|| text[..end].rfind('['))?;
serde_json::from_str(&text[start..=end]).ok()
}
/// Fold an answer into the notes: a kind it doesn't know or an axis not in the fingerprint is dropped
pub fn fold(notes: &mut [Reading], fp: &Fingerprint, ans: &[Value], by: &str) {
for a in ans {
let Some(id) = a["id"].as_str() else { continue };
let Some(n) = notes.iter_mut().find(|n| n.note == id) else { continue };
let kind = a["kind"].as_str().unwrap_or("");
if !matches!(kind, "defect" | "direction" | "praise" | "both") {
continue;
}
n.kind = kind.into();
n.axis = a["axis"].as_str().filter(|x| fp.axis(x).is_some()).map(str::to_string);
n.by = by.into();
}
}
/// One fresh session's words: kimi's or claude's stream, the assistant's text joined
fn ask(by: &str, p: &str) -> Result<String, String> {
let mut c = std::process::Command::new(by);
match by {
"kimi" => c.args(["-p", p, "--output-format", "stream-json"]),
"claude" => c.args(["-p", p, "--output-format", "stream-json", "--verbose", "--allowedTools", ""]),
o => return Err(format!("--by {o}: kimi or claude")),
};
let out = c.output().map_err(|e| format!("couldn't run {by}: {e}"))?;
let mut text = String::new();
for line in String::from_utf8_lossy(&out.stdout).lines() {
let Ok(v) = serde_json::from_str::<Value>(line) else { continue };
let content = if v["role"] == "assistant" { &v["content"] } else if v["type"] == "assistant" { &v["message"]["content"] } else if v["type"] == "result" { &v["result"] } else { continue };
match content {
Value::String(s) => text += s,
Value::Array(a) => a.iter().filter_map(|p| p["text"].as_str()).for_each(|s| text += s),
_ => {}
}
text.push('\n');
}
if text.trim().is_empty() {
return Err(format!("{by} said nothing: {}", String::from_utf8_lossy(&out.stderr).lines().last().unwrap_or("")));
}
Ok(text)
}
pub fn readings_of(dir: &Folder) -> Vec<Reading> {
std::fs::read_to_string(dir.dir.join("readings.jsonl")).unwrap_or_default().lines().filter_map(|l| serde_json::from_str(l).ok()).collect()
}
pub fn write_readings(dir: &Folder, r: &[Reading]) -> std::io::Result<()> {
std::fs::write(dir.dir.join("readings.jsonl"), r.iter().filter_map(|x| serde_json::to_string(x).ok()).map(|l| l + "\n").collect::<String>())
}
/// `raea fingerprint read PROJECT [--by kimi|claude]`
pub(crate) fn read_here(args: &[String], cwd: &Path) -> i32 {
let run = || -> Result<String, String> {
let w = words(args)?;
let project = w.first().map_or(cwd.to_path_buf(), |p| cwd.join(p));
let by = flag(args, "--by").unwrap_or("kimi");
let dir = crate::pick::chosen(args, Some(&crate::pick::piece_in(args, cwd))).0;
let fp = dir.read(None).map_err(|e| e.to_string())?;
let mut notes = pinned(&project);
let mut kept = readings_of(&dir);
notes.retain(|n| !kept.iter().any(|k| k.note == n.note && k.media == n.media));
if notes.is_empty() {
return Ok(format!("no new pinned notes in {}", project.display()));
}
for chunk in notes.chunks_mut(40) {
let text = ask(by, &prompt(&fp, chunk))?;
let ans = answer(&text).ok_or_else(|| format!("{by} answered no readings JSON"))?;
fold(chunk, &fp, &ans, by);
eprintln!("read {} notes", chunk.len());
}
let read = notes.iter().filter(|n| !n.kind.is_empty()).count();
kept.extend(notes.into_iter().filter(|n| !n.kind.is_empty()));
write_readings(&dir, &kept).map_err(|e| e.to_string())?;
Ok(format!("{read} notes read into labels by {by}, kept in {}; none trains a head until you've checked them: raea fingerprint readings --ask 50", dir.dir.join("readings.jsonl").display()))
};
match run() {
Ok(o) => {
println!("{o}");
0
}
Err(e) => {
eprintln!("raea fingerprint read: {e}");
1
}
}
}
/// The choices a reading is checked with, and what each says about kind and axis
pub const CHOICES: [(&str, bool, bool); 4] = [("Right", true, true), ("Right kind, wrong axis", true, false), ("Wrong kind", false, false), ("Right axis, wrong kind", false, true)];
/// `raea fingerprint readings [PROJECT] [--ask N] [--tally]`: the readings kept in the fingerprint that judges PROJECT
pub(crate) fn readings_here(args: &[String], cwd: &Path) -> i32 {
let dir = crate::pick::chosen(args, Some(&crate::pick::piece_in(args, cwd))).0;
let mut r = readings_of(&dir);
if let Some(n) = flag(args, "--ask").and_then(|n| n.parse::<usize>().ok()) {
let todo: Vec<usize> = r.iter().enumerate().filter(|(_, x)| x.kind_ok.is_none()).map(|(i, _)| i).take(n).collect();
let mut cmd = std::process::Command::new(std::env::current_exe().unwrap_or_else(|_| "raea".into()));
cmd.args(["show", "--title", "Check how raea read your notes", "--inbox", INBOX]);
for &i in &todo {
let x = &r[i];
let q = format!("[{}] \"{}\" read as {} on {}", x.note, x.text.replace('\n', " "), x.kind, x.axis.as_deref().unwrap_or("no axis"));
cmd.args(["--question", &q, "--preview", &x.media.display().to_string()]);
for (c, _, _) in CHOICES {
cmd.args(["--choice", c]);
}
}
if todo.is_empty() {
println!("every reading is checked");
return 0;
}
let Ok(out) = cmd.output() else { return 1 };
let said = String::from_utf8_lossy(&out.stdout).into_owned();
// the item raea show made, so the answers can be matched to the notes asked, in order
let Some(item) = said.split(|c: char| c.is_whitespace() || c == '(' || c == ')' || c == ',').find(|w| w.starts_with("i-show-")) else {
eprintln!("raea fingerprint readings: raea show didn't say its item: {said}{}", String::from_utf8_lossy(&out.stderr));
return 1;
};
let mut 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();
asked.insert(item.to_string(), json!(todo.iter().map(|&i| [r[i].note.clone(), r[i].media.display().to_string()]).collect::<Vec<_>>()));
let _ = std::fs::write(dir.dir.join("asked.json"), serde_json::to_vec_pretty(&asked).unwrap_or_default());
println!("{} readings put to you in the app ({item}); `raea fingerprint readings --tally` counts your answers", todo.len());
return 0;
}
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 = 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 };
for (k, who) in batch.iter().enumerate() {
let Some(a) = v["answers"][format!("q{}", k + 1)].as_str() else { continue };
let Some((_, ok_kind, ok_axis)) = CHOICES.iter().find(|c| c.0 == a) else { continue };
if let Some(x) = r.iter_mut().find(|x| who[0].as_str() == Some(x.note.as_str()) && who[1].as_str() == Some(&x.media.display().to_string())) {
(x.kind_ok, x.axis_ok) = (Some(*ok_kind), Some(*ok_axis));
}
}
}
let _ = write_readings(&dir, &r);
}
let (k, a, n) = agreement(&r);
let f = |x: Option<f64>| x.map_or("-".into(), |v| format!("{:.0}%", v * 100.0));
println!("{} readings, {n} checked: kind right {}, axis right {} (FP5b needs 50 checked, 90% and 80%): {}", r.len(), f(k), f(a), if earned(&r) { "notes may train" } else { "notes don't train yet" });
println!("{}", json!({"readings": r.len(), "checked": n, "kind": k, "axis": a, "earned": earned(&r)}));
0
}
/// `learn-notes`: each checked-off reading's defect or praise as an evidence row over its span, once the readings
/// have earned it; a reading already learned is replaced, so learning again is safe
pub(crate) fn learn(enc: &mut raea_sys_columns::Encoders, dir: &Folder, l: &mut raea_sys_fingerprint::evidence::Ledger) -> anyhow::Result<String> {
let r = readings_of(dir);
if !earned(&r) {
let (k, a, n) = agreement(&r);
anyhow::bail!("notes don't train yet: {n} readings checked, kind right {:?}, axis right {:?} (FP5b needs 50 checked, 90% and 80%: raea fingerprint readings --ask 50)", k, a);
}
// only these readings' rows are remade: notes another fingerprint's person moved up here (FP14d) stay
let ids: std::collections::BTreeSet<&str> = r.iter().map(|x| x.note.as_str()).collect();
l.retain(|x| x.source != "note" || !x.kind.as_deref().is_some_and(|k| ids.contains(k)));
let mut made = 0;
for x in r.iter().filter(|x| x.kind_ok != Some(false) && x.axis_ok != Some(false)) {
let bad = match x.kind.as_str() {
"defect" | "both" => true,
"praise" => false,
_ => continue,
};
let axis = match (&x.axis, bad) {
(Some(a), _) => a.clone(),
(None, false) => "*".into(),
(None, true) => continue,
};
let c = enc.columns(&x.media)?;
// a span is the label's time (a scene's, a box's on the sound: FP11c), half a second at least; a moment, 1.5 s
// before the pin to 0.5 s after (FP11b)
let (a, b) = x.to.map_or(((x.t - 1.5).max(0.0), (x.t + 0.5).min(c.dur)), |to| span(x.t, to, c.dur));
if b - a < 0.5 {
continue;
}
// a defect's marks, grown into the thing by EdgeTAM and followed through its shot: a row for each 2 s it stays
// in, with its box there (grow.rs through); else the mark's own box over the label
let seed = x.region.filter(|_| bad);
let shot = seed.and_then(|s| raea_sys_fingerprint_use::grow::through(&x.media, x.t, c.dur, s, 2.0).ok().flatten()).filter(|w| !w.is_empty());
for (a, b, region) in shot.map_or_else(|| vec![(a, b, seed)], |w| w.into_iter().map(|(a, b, r)| (a, b, Some(r))).collect()) {
let (media, axis, who, project, kind, words) = (c.media.clone(), axis.clone(), x.who.clone(), x.project.clone(), Some(x.note.clone()), Some(x.text.clone()));
// a defect's box on the sound keeps its pitch band (FP11c)
let band = x.band.filter(|_| bad);
let row = raea_sys_fingerprint::evidence::Row { media, a, b, axis, bad, weight: 1.0, who, source: "note".into(), project, kind, region, words, at: 0, pin: None, band };
l.push(row, &raea_sys_fingerprint::evidence::features(&c, a, b));
}
made += 1;
}
Ok(format!("{made} notes are evidence now (defects and praise; directions stay with the brief)\n"))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn a_reading_keeps_only_kinds_and_axes_it_knows() {
let fp = raea_sys_fingerprint::taxonomy::base("me");
let mut n = vec![Reading { note: "n1".into(), ..Default::default() }, Reading { note: "n2".into(), ..Default::default() }, Reading { note: "n3".into(), ..Default::default() }];
let ans = answer("I read them.\n[{\"id\": \"n1\", \"kind\": \"defect\", \"axis\": \"glitch\"}, {\"id\": \"n2\", \"kind\": \"direction\", \"axis\": \"made up\"}, {\"id\": \"n3\", \"kind\": \"rant\", \"axis\": null}]").unwrap();
fold(&mut n, &fp, &ans, "kimi");
assert_eq!((n[0].kind.as_str(), n[0].axis.as_deref()), ("defect", Some("glitch")));
assert_eq!((n[1].kind.as_str(), n[1].axis.as_deref()), ("direction", None), "an axis the fingerprint hasn't is dropped");
assert_eq!(n[2].kind, "", "a kind it doesn't know is no reading");
n[0].layers = vec!["Floor".into()];
assert!(prompt(&fp, &n).contains("n1: ") && prompt(&fp, &n).contains("(pinned on Floor)"), "the reader is told the layer");
}
#[test]
fn a_box_on_the_sound_is_a_reading_s_span_and_band_not_a_region() {
let dir = std::env::temp_dir().join(format!("fp11c-{}", std::process::id()));
std::fs::create_dir_all(dir.join(".raea/feed")).unwrap();
std::fs::write(dir.join("a.mp4"), b"").unwrap();
let note = json!({"id": "n1", "text": "that hiss", "author": {"kind": "person", "name": "me"}, "pin": {"kind": "time", "t": 2.0, "to": 4.0, "marks": [{"kind": "box", "on": "sound", "points": [[0.2, 0.9], [0.4, 0.6]]}]}});
std::fs::write(dir.join(".raea/feed/p.json"), json!({"media": [{"kind": "video", "path": "a.mp4"}], "notes": [note]}).to_string()).unwrap();
let r = pinned(&dir);
std::fs::remove_dir_all(&dir).ok();
assert_eq!(r.len(), 1);
assert_eq!((r[0].t, r[0].to, r[0].band, r[0].region), (2.0, Some(4.0), Some([0.6, 0.9]), None));
}
}
+91
View File
@@ -0,0 +1,91 @@
//! Pairs from what the person already does (docs/fingerprint.feature FP6b, FP6c). `raea fingerprint pair WORSE BETTER
//! --axis A [--at T] [--then T2]` records a pick between real options or a hand edit's before and after: the better
//! window against the worse on that axis. `raea fingerprint versions V1 V2...` (the files in version order) makes a
//! weak pair (weight 0.5, every axis) of each noted moment whose picture or sound changed in the next version (cosine
//! distance 0.01 or more) and wasn't noted again within 1 s there.
use crate::approve::noted;
use crate::flag;
use anyhow::{Context, Result, anyhow, bail};
use raea_sys_columns::Encoders;
use raea_sys_columns::window::Modality;
use raea_sys_fingerprint::evidence::{Ledger, Row, features, slice};
use raea_sys_fingerprint::pairs::difference;
use std::path::Path;
fn row(media: &str, a: f64, b: f64, axis: &str, weight: f32, who: &str, project: String, words: Option<String>) -> Row {
Row { media: media.into(), a, b, axis: axis.into(), bad: true, weight, who: who.into(), source: "pair".into(), project, kind: None, region: None, words, at: 0, pin: None, band: None }
}
/// `pair`: one row, the worse window's features minus the better one's
pub(crate) fn pair(enc: &mut Encoders, l: &mut Ledger, who: &str, args: &[String], cwd: &Path, project: impl Fn(&Path) -> String) -> Result<String> {
let f = crate::named(args, cwd)?;
let [worse, better] = f.as_slice() else { bail!("raea fingerprint pair WORSE BETTER --axis A [--at T] [--then T2]") };
let axis = flag(args, "--axis").ok_or_else(|| anyhow!("--axis A: the axis the better one is better on"))?;
let span: f64 = flag(args, "--span").map_or(Ok(2.0), str::parse).context("--span takes seconds")?;
let t: f64 = flag(args, "--at").map_or(Ok(span / 2.0), str::parse).context("--at takes seconds")?;
let t2: f64 = flag(args, "--then").map_or(Ok(t), str::parse).context("--then takes seconds")?;
let (cw, cb) = (enc.columns(worse)?, enc.columns(better)?);
let win = |dur: f64, t: f64| {
let a = (t - span / 2.0).clamp(0.0, (dur - span).max(0.0));
(a, (a + span).min(dur))
};
let ((a, b), (a2, b2)) = (win(cw.dur, t), win(cb.dur, t2));
let d = difference(&features(&cw, a, b), &features(&cb, a2, b2));
l.push(row(&cw.media, a, b, axis, 1.0, who, flag(args, "--project").map_or_else(|| project(worse), str::to_string), flag(args, "--words").map(str::to_string)), &d);
Ok(format!("paired on {axis}: {} at {a:.1} s is worse than {} at {a2:.1} s\n", worse.display(), better.display()))
}
fn distance(x: &[f32], y: &[f32]) -> f32 {
let d: f32 = x.iter().zip(y).map(|(a, b)| a * b).sum();
1.0 - d / (x.iter().map(|a| a * a).sum::<f32>().sqrt() * y.iter().map(|b| b * b).sum::<f32>().sqrt()).max(1e-9)
}
/// Whether a noted moment changed in the next version and wasn't noted there again
pub(crate) fn weak(before: &[f32], after: &[f32], t: f64, next_notes: &[f64]) -> bool {
let changed = [Modality::Picture, Modality::Sound].iter().any(|&m| distance(&before[slice(m)], &after[slice(m)]) >= 0.01);
changed && !next_notes.iter().any(|n| (n - t).abs() <= 1.0)
}
/// `versions`: weak pairs along a chain of versions
pub(crate) fn versions(enc: &mut Encoders, l: &mut Ledger, who: &str, args: &[String], cwd: &Path, project: impl Fn(&Path) -> String) -> Result<String> {
let f = crate::named(args, cwd)?;
if f.len() < 2 {
bail!("raea fingerprint versions V1 V2... takes the versions in order");
}
let mut made = 0;
for w in f.windows(2) {
let (now, next) = (&w[0], &w[1]);
let (cn, cx) = (enc.columns(now)?, enc.columns(next)?);
let next_notes = noted(next);
for t in noted(now) {
let (a, b) = ((t - 1.5).max(0.0), (t + 0.5).min(cn.dur.min(cx.dur)));
if b - a < 1.0 {
continue;
}
let (fb, fa) = (features(&cn, a, b), features(&cx, a, b));
if weak(&fb, &fa, t, &next_notes) {
l.push(row(&cn.media, a, b, "*", 0.5, who, flag(args, "--project").map_or_else(|| project(now), str::to_string), None), &difference(&fb, &fa));
made += 1;
}
}
}
Ok(format!("{made} weak pairs from {} versions: noted moments the next version changed and nobody noted again\n", f.len()))
}
#[cfg(test)]
mod tests {
use raea_sys_fingerprint::evidence::width;
#[test]
fn a_changed_moment_not_noted_again_is_a_weak_pair() {
let a = vec![1.0; width()];
let mut b = a.clone();
assert!(!super::weak(&a, &b, 5.0, &[]), "unchanged: no pair");
b.iter_mut().enumerate().for_each(|(i, x)| *x = if i % 2 == 0 { 1.0 } else { -1.0 });
assert!(super::weak(&a, &b, 5.0, &[]));
assert!(!super::weak(&a, &b, 5.0, &[5.6]), "noted again within 1 s: no pair");
assert!(super::weak(&a, &b, 5.0, &[7.0]));
}
}
+151
View File
@@ -0,0 +1,151 @@
//! Which fingerprint judges a piece (docs/fingerprint.feature FP14c): `raea fingerprint which PATH` says the one
//! chosen, what it's for and why; `raea fingerprint use NAME [--in project|workspace] [PATH]` pins one by writing that
//! level's `default`. score and teach use the chosen one unless --fp names another. No encoders are needed.
use crate::{flag, has, words};
use raea_sys_fingerprint::folder::{Folder, root};
use raea_sys_fingerprint_use::which::{Choice, default_file, levels, piece, which};
use std::path::{Path, PathBuf};
/// The fingerprint a verb uses: --fp, else the one that judges `file`, else the account's default, else "me"
pub(crate) fn chosen(args: &[String], file: Option<&Path>) -> (Folder, Option<Choice>) {
if let Some(n) = flag(args, "--fp") {
return (Folder::named(n), None);
}
if let Some(c) = file.and_then(which) {
return (Folder { dir: c.dir.clone() }, Some(c));
}
let n = std::fs::read_to_string(root().join("default")).ok().map(|s| s.trim().to_string()).filter(|s| !s.is_empty()).unwrap_or_else(|| "me".into());
(Folder::named(&n), None)
}
/// A piece in the project a verb names (its first word, else the current folder), so `read`, `readings` and
/// `learn-notes` keep a project's notes in the fingerprint that judges it (FP14d)
pub(crate) fn piece_in(args: &[String], cwd: &Path) -> PathBuf {
here(cwd, args, 0).join("piece.mp4")
}
fn here(cwd: &Path, args: &[String], at: usize) -> PathBuf {
let w = words(args).unwrap_or_default();
w.get(at).map_or_else(|| cwd.to_path_buf(), |p| cwd.join(p))
}
pub(crate) fn which_here(args: &[String], cwd: &Path) -> i32 {
let path = here(cwd, args, 0);
let Some(c) = which(&path) else {
eprintln!("raea fingerprint which: you have no fingerprint yet (`raea fingerprint new me` makes one)");
return 1;
};
if has(args, "--json") {
let p = piece(&path);
println!("{}", serde_json::json!({"chosen": c, "piece": p, "looked_in": levels(&p).iter().map(|(l, d)| serde_json::json!({"level": l, "dir": d})).collect::<Vec<_>>()}));
} else {
println!("{} {}", c.name, c.about.as_deref().unwrap_or(""));
println!(" why: {}", c.why);
println!(" at: {}", c.dir.display());
}
0
}
pub(crate) fn use_here(args: &[String], cwd: &Path) -> i32 {
let Some(name) = words(args).ok().and_then(|w| w.first().map(|s| s.to_string())) else {
eprintln!("raea fingerprint use: which one? raea fingerprint use NAME [--in project|workspace] [PATH]");
return 2;
};
let level = flag(args, "--in").unwrap_or("account");
if !matches!(level, "project" | "workspace" | "account") {
eprintln!("raea fingerprint use: --in takes project or workspace, not {level}");
return 2;
}
let path = here(cwd, args, 1);
let Some(file) = default_file(&path, level) else {
eprintln!("raea fingerprint use: {} isn't in a {level} (no .raea/{level} above it)", path.display());
return 1;
};
let p = piece(&path);
let all = levels(&p);
let from = all.iter().position(|(l, _)| *l == level).unwrap_or(0);
if !all[from..].iter().any(|(_, d)| Folder { dir: d.join(&name) }.exists()) {
eprintln!("raea fingerprint use: no fingerprint {name} at the {level} or above it");
return 1;
}
let wrote = std::fs::create_dir_all(file.parent().unwrap_or(cwd)).and(std::fs::write(&file, &name));
if let Err(e) = wrote {
eprintln!("raea fingerprint use: {}: {e}", file.display());
return 1;
}
println!("{name} judges this {level}'s pieces now ({})", file.display());
0
}
/// `raea fingerprint diff A B [--json]` (FP8b): the axes two fingerprints rank the same evidence most differently on
pub(crate) fn diff_here(args: &[String]) -> i32 {
let w = words(args).unwrap_or_default();
let [a, b] = w.as_slice() else {
eprintln!("raea fingerprint diff: which two? raea fingerprint diff A B");
return 2;
};
match raea_sys_fingerprint_use::diff::diff(&Folder::named(a), &Folder::named(b), 3) {
Ok(d) if has(args, "--json") => {
println!("{}", serde_json::to_string_pretty(&d).unwrap_or_default());
0
}
Ok(d) => {
println!("where {a} and {b} differ, most apart first (0 agree, 1 unrelated, 2 opposed):");
for x in &d {
println!(" {:16} {:.2} over {} windows", x.axis, x.apart, x.windows);
for m in &x.moments {
println!(" {} {:.1}-{:.1}s: {a} ranks it {:.0}%, {b} {:.0}%", &m.media[..m.media.len().min(12)], m.a, m.b, m.rank_a * 100.0, m.rank_b * 100.0);
}
}
0
}
Err(e) => {
eprintln!("raea fingerprint diff: {e:#}");
1
}
}
}
/// `raea fingerprint share NAME --in project|workspace [PATH]` (FP8a): the fingerprint's taxonomy, words and evidence
/// copied into that level's .raea/fingerprints, to travel with its repo; never its heads (each machine retrains them)
/// and never media (the rows hold embeddings, spans and labels)
pub(crate) fn share_here(args: &[String], cwd: &Path) -> i32 {
let Some(name) = words(args).ok().and_then(|w| w.first().map(|s| s.to_string())) else {
eprintln!("raea fingerprint share: which one? raea fingerprint share NAME --in project|workspace [PATH]");
return 2;
};
let level = flag(args, "--in").unwrap_or("project");
let path = here(cwd, args, 1);
let Some(to) = default_file(&path, level).and_then(|f| f.parent().map(|d| d.join(&name))) else {
eprintln!("raea fingerprint share: {} isn't in a {level} (no .raea/{level} above it)", path.display());
return 1;
};
let from = Folder::named(&name);
let run = || -> anyhow::Result<usize> {
from.read(None)?;
let dest = Folder { dir: to.clone() };
if dest.exists() {
anyhow::bail!("{} has a fingerprint {name} already", to.display());
}
std::fs::create_dir_all(&to)?;
for f in ["fingerprint.ts", "fingerprint.json", "words.json", "words.f16"] {
if from.dir.join(f).is_file() {
std::fs::copy(from.dir.join(f), to.join(f))?;
}
}
let l = from.ledger()?;
dest.write_ledger(&l)?;
Ok(l.rows.len())
};
match run() {
Ok(n) => {
println!("shared {name} into {} with {n} evidence rows, no heads and no media; commit it with the {level}", to.display());
0
}
Err(e) => {
eprintln!("raea fingerprint share: {e:#}");
1
}
}
}
+58
View File
@@ -0,0 +1,58 @@
//! `raea fingerprint postmortem [PROJECT] [--ask N] [--tally]` (docs/fingerprint.feature FP7a; the picking, the clips
//! and the questions are raea-sys-fingerprint-use's postmortem.rs). It scores every version of the project's pieces with
//! the fingerprint that judges the project and asks at most ten yes/no questions in the app; `--tally` makes each answer
//! an evidence row, retrains, and says how each head's held-out score moved.
use crate::{Eval, flag, has};
use anyhow::{Result, anyhow, bail};
use raea_sys_columns::Encoders;
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;
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());
let name = project.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default();
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(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
l.retain(|r| r.source != "postmortem");
for (x, yes) in &answers {
let c = enc.columns(&x.file)?;
let (a, b) = (x.a.min(c.dur), x.b.min(c.dur));
if b - a < 0.5 {
continue;
}
let who = fp.who.clone().unwrap_or_else(|| "me".into());
let row = Row { media: c.media.clone(), a, b, axis: x.axis.clone(), bad: *yes, weight: 1.0, who, source: "postmortem".into(), project: name.clone(), kind: None, region: None, words: Some(x.words.clone()), at: 0, pin: None, band: None };
l.push(row, &features(&c, a, b));
}
dir.write_ledger(&l)?;
let after = retrain(&dir, &fp, &w, &l, None)?;
let f = |v: Option<f64>| v.map_or("-".into(), |v| format!("{v:.2}"));
let mut out = format!("{} answers are evidence now\n", answers.len());
for (axis, was, now) in pm::moved(&before, &after) {
out += &format!(" {axis}: held out {} -> {}\n", f(was), f(now));
}
return Ok((out, 0));
}
let n = flag(args, "--ask").map_or(Ok(MOST), str::parse).map_err(|_| anyhow!("--ask takes a count"))?.min(MOST);
let files = crate::notes::videos(&project);
if files.is_empty() {
bail!("{} has no videos in its feed to look back on", project.display());
}
let scored = files.iter().map(|f| -> Result<Scored> { Ok(score(&fp, Some(&w), Some(&before), &enc.columns(f)?, &f.display().to_string())) }).collect::<Result<Vec<_>>>()?;
let asks = pm::picks(&scored, &before, &fp, &dir.ledger()?, n);
if asks.is_empty() {
return Ok((format!("nothing to ask: on {} versions, no head disagrees with you or sits near its flag\n", files.len()), 0));
}
let item = pm::ask(&std::env::current_exe()?, &dir.dir, &name, &asks)?;
let against = asks.iter().filter(|x| x.why == "disagrees with you").count();
Ok((format!("{} questions on {} versions put to you in the app ({item}): {against} where it disagrees with you, the rest where it's least sure; `raea fingerprint postmortem --tally` adds your answers\n", asks.len(), files.len()), 0))
}
+80
View File
@@ -0,0 +1,80 @@
//! `raea fingerprint profile REFS... --as NAME [--against LIST]` and `score FILE --profile NAME` (docs/fingerprint.feature
//! FP6e): a profile's measures taken from work the person admires, kept in the fingerprint's profiles/NAME.json, and a
//! piece critiqued against it, measure by measure, with where and which way to move.
use crate::{flag, listed, named};
use anyhow::{Context, Result, anyhow, bail};
use raea_sys_columns::{Encoders, media};
use raea_sys_fingerprint::folder::Folder;
use raea_sys_fingerprint_use::profile::{Measures, NAMES, Out, Profile, critique, measures, profile};
use raea_sys_fingerprint_use::score::clock;
use std::path::{Path, PathBuf};
const BINS: usize = 12;
/// The windows the critique says "where" with, seconds
const WIN: f64 = 4.0;
/// A piece's measures, whole and in windows
pub(crate) fn measured(enc: &mut Encoders, file: &Path) -> Result<(Measures, Vec<((f64, f64), Measures)>)> {
let c = enc.columns(file)?;
let pcm = media::sound(file, 16_000).unwrap_or_default();
let cols = ((c.dur * 10.0) as usize).max(1);
let spec = media::spectrogram(&pcm, 16_000, cols, BINS);
let whole = measures(&c, &spec, BINS, 0.0, c.dur);
let n = (c.dur / WIN).ceil() as usize;
let windows = (0..n).map(|i| {
let (a, b) = (i as f64 * WIN, ((i + 1) as f64 * WIN).min(c.dur));
((a, b), measures(&c, &spec, BINS, a, b))
}).collect();
Ok((whole, windows))
}
fn path(dir: &Folder, name: &str) -> PathBuf {
dir.dir.join("profiles").join(format!("{name}.json"))
}
pub(crate) fn make(enc: &mut Encoders, dir: &Folder, args: &[String], cwd: &Path) -> Result<String> {
let name = flag(args, "--as").ok_or_else(|| anyhow!("name it: raea fingerprint profile REFS... --as NAME"))?;
let refs = named(args, cwd)?;
if refs.len() < 2 {
bail!("a profile needs two references or more (three for its leave-one-out check)");
}
let mut r = Vec::new();
for f in &refs {
r.push((f.display().to_string(), measured(enc, f)?.0));
}
let mut other = Vec::new();
if let Some(list) = flag(args, "--against") {
for f in listed(cwd, list)? {
other.push(measured(enc, &f)?.0);
}
}
let p = profile(name, r, &other);
std::fs::create_dir_all(dir.dir.join("profiles"))?;
std::fs::write(path(dir, name), serde_json::to_vec_pretty(&p)?)?;
let mut out = format!("profile {name} from {} references:\n", p.refs.len());
for (k, words) in NAMES {
if let Some((lo, hi)) = p.ranges.get(k) {
out += &format!(" {words:40} {lo:.2} to {hi:.2}\n");
}
}
out += &match (p.inside_own, p.inside_other) {
(Some(o), Some(x)) => format!("leave-one-out: a reference falls in the others' ranges {:.0}% of the time, unrelated work {:.0}%: {}\n", o * 100.0, x * 100.0, if p.tells == Some(true) { "it tells this taste apart" } else { "it does NOT tell this taste apart" }),
(Some(o), None) => format!("leave-one-out: a reference falls in the others' ranges {:.0}% of the time (give --against LIST to compare with unrelated work)\n", o * 100.0),
_ => "leave-one-out needs three references\n".into(),
};
Ok(out)
}
/// The critique of a piece against a saved profile, as lines
pub(crate) fn against(enc: &mut Encoders, dir: &Folder, name: &str, file: &Path) -> Result<(String, Vec<Out>)> {
let p: Profile = serde_json::from_slice(&std::fs::read(path(dir, name)).with_context(|| format!("no profile {name} (raea fingerprint profile REFS... --as {name})"))?)?;
let (whole, windows) = measured(enc, file)?;
let out = critique(&p, &whole, &windows);
let words = |k: &str| NAMES.iter().find(|n| n.0 == k).map_or(k.to_string(), |n| n.1.to_string());
let mut t = format!("against the {name} profile: {}\n", if out.is_empty() { "every measure in range".to_string() } else { format!("{} out of range", out.len()) });
for o in &out {
t += &format!(" {} {:.2} is outside {:.2} to {:.2}: {} it{}\n", words(&o.measure), o.value, o.range.0, o.range.1, o.move_, o.at.map_or(String::new(), |(a, _)| format!(", most at {}", clock(a))));
}
Ok((t, out))
}
+90
View File
@@ -0,0 +1,90 @@
//! Encoder upgrades keep the evidence (docs/fingerprint.feature FP8c). When this machine's encoders aren't the ones a
//! fingerprint was trained on, `raea fingerprint reembed PLACE...` re-embeds every row whose media it finds under
//! those files and folders (matched by content hash), moves the fingerprint to the new encoders and retrains. A row
//! whose media isn't found keeps its old pin and trains no head until it's re-embedded or labelled again; a bootstrap's
//! damaged rows are remade by running the bootstrap again.
use crate::words;
use anyhow::{Result, anyhow};
use raea_sys_columns::{Encoders, media};
use raea_sys_fingerprint::evidence::features;
use raea_sys_fingerprint::folder::Folder;
use raea_sys_fingerprint::taxonomy::Fingerprint;
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
const MEDIA: [&str; 9] = ["mp4", "mov", "m4v", "webm", "mkv", "wav", "mp3", "m4a", "flac"];
/// An encoder set's short name, as a row's pin
pub(crate) fn pin_of(p: &BTreeMap<String, String>) -> String {
p.iter().map(|(k, v)| format!("{k}:{}", &v[..v.len().min(8)])).collect::<Vec<_>>().join(",")
}
/// The media files under each place, two folders deep
fn files(places: &[PathBuf]) -> Vec<PathBuf> {
fn walk(d: &Path, depth: usize, out: &mut Vec<PathBuf>) {
for e in std::fs::read_dir(d).into_iter().flatten().flatten() {
let p = e.path();
if p.is_dir() && depth > 0 {
walk(&p, depth - 1, out);
} else if MEDIA.iter().any(|m| p.extension().is_some_and(|x| x.eq_ignore_ascii_case(m))) {
out.push(p);
}
}
}
let mut out = Vec::new();
for p in places {
if p.is_dir() { walk(p, 2, &mut out) } else { out.push(p.clone()) }
}
out
}
/// Rows moved to `here`'s encoders where their media is found; returns the fingerprint as it is now and what happened
pub(crate) fn reembed(enc: &mut Encoders, dir: &Folder, mut fp: Fingerprint, here: BTreeMap<String, String>, args: &[String], cwd: &Path) -> Result<(Fingerprint, String)> {
let places: Vec<PathBuf> = words(args).map_err(|e| anyhow!(e))?.iter().map(|f| cwd.join(f)).collect();
let mut l = dir.ledger()?;
if fp.encoders != here {
let old = pin_of(&fp.encoders);
l.rows.iter_mut().filter(|r| r.pin.is_none()).for_each(|r| r.pin = Some(old.clone()));
fp.encoders = here;
dir.rewrite(&fp)?;
}
let waiting: std::collections::BTreeSet<String> = l.rows.iter().filter(|r| r.pin.is_some() && !matches!(r.source.as_str(), "damage" | "cheat")).map(|r| r.media.clone()).collect();
let mut done = 0;
for f in files(&places) {
if waiting.is_empty() {
break;
}
let Ok(sha) = media::sha256(&f) else { continue };
if !waiting.contains(&sha) {
continue;
}
let c = enc.columns(&f)?;
for i in 0..l.rows.len() {
let r = &l.rows[i];
if r.media == sha && r.pin.is_some() && !matches!(r.source.as_str(), "damage" | "cheat") {
let x = features(&c, r.a, r.b);
l.set_features(i, &x);
l.rows[i].pin = None;
done += 1;
}
}
}
dir.write_ledger(&l)?;
let left = l.rows.iter().filter(|r| r.pin.is_some()).count();
let damage = l.rows.iter().filter(|r| r.pin.is_some() && matches!(r.source.as_str(), "damage" | "cheat")).count();
let mut out = format!("re-embedded {done} rows on this machine's encoders; {left} wait on their old ones");
if damage > 0 {
out += &format!(" ({damage} from a bootstrap: run raea fingerprint bootstrap again to remake them)");
}
Ok((fp, out + "\n"))
}
#[cfg(test)]
mod tests {
#[test]
fn a_pin_names_each_encoder_and_its_hash() {
let p = std::collections::BTreeMap::from([("clap".to_string(), "0123456789abcdef".to_string()), ("siglip".to_string(), "fedcba".to_string())]);
assert_eq!(super::pin_of(&p), "clap:01234567,siglip:fedcba");
}
}
+141
View File
@@ -0,0 +1,141 @@
//! The resident service: the encoders loaded once, on 127.0.0.1 at a port the host file names
//! (~/.raea/fingerprints/.serve.json). A request is one JSON line, {"args": [...], "cwd": "..."}; the answer is
//! progress lines, {"say": "..."}, then {"out": "...", "code": N}. One request at a time, in order.
use crate::{Eval, verbs};
use anyhow::{Context, Result};
use raea_sys_columns::Encoders;
use raea_sys_fingerprint::folder::root;
use serde_json::{Value, json};
use std::io::{BufRead, BufReader, Write};
use std::net::{TcpListener, TcpStream};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::sync::atomic::{AtomicU64, Ordering};
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
/// The service leaves after this long with no request
const IDLE: Duration = Duration::from_secs(30 * 60);
/// How long a verb waits for a service it started to come up (the first run fetches the models)
const UP: Duration = Duration::from_secs(900);
fn host() -> PathBuf {
root().join(".serve.json")
}
fn now() -> u64 {
SystemTime::now().duration_since(UNIX_EPOCH).map(|d| d.as_secs()).unwrap_or(0)
}
/// `raea fingerprint serve`: load the encoders, listen, answer until idle or stopped
pub fn serve(eval: Eval) -> Result<()> {
let started = Instant::now();
let mut enc = Encoders::load().context("loading the encoders")?;
let listener = TcpListener::bind("127.0.0.1:0")?;
let port = listener.local_addr()?.port();
std::fs::create_dir_all(root())?;
std::fs::write(host(), json!({"port": port, "pid": std::process::id()}).to_string())?;
eprintln!("raea fingerprint serve: encoders loaded in {:.1} s, on 127.0.0.1:{port}", started.elapsed().as_secs_f64());
let last = Arc::new(AtomicU64::new(now()));
let seen = last.clone();
std::thread::spawn(move || {
loop {
std::thread::sleep(Duration::from_secs(60));
if now().saturating_sub(seen.load(Ordering::Relaxed)) > IDLE.as_secs() {
let _ = std::fs::remove_file(host());
eprintln!("raea fingerprint serve: idle for {} min, leaving", IDLE.as_secs() / 60);
std::process::exit(0);
}
}
});
for stream in listener.incoming() {
let Ok(mut s) = stream else { continue };
last.store(now(), Ordering::Relaxed);
let mut line = String::new();
if BufReader::new(&s).read_line(&mut line).is_err() {
continue;
}
let req: Value = serde_json::from_str(&line).unwrap_or_default();
let args: Vec<String> = serde_json::from_value(req["args"].clone()).unwrap_or_default();
let cwd = PathBuf::from(req["cwd"].as_str().unwrap_or("."));
if args.first().is_some_and(|v| v == "stop") {
let _ = writeln!(s, "{}", json!({"out": "raea fingerprint serve: stopped", "code": 0}));
let _ = std::fs::remove_file(host());
return Ok(());
}
let mut say = |m: String| {
let _ = writeln!(s, "{}", json!({ "say": m }));
};
let (out, code) = verbs::run(&mut enc, &args, &cwd, eval, &mut say);
let _ = writeln!(s, "{}", json!({"out": out, "code": code}));
last.store(now(), Ordering::Relaxed);
}
Ok(())
}
/// A verb run in this process, with the encoders loaded for it
pub(crate) fn here(args: &[String], cwd: &Path, eval: Eval) -> (String, i32) {
match Encoders::load() {
Ok(mut enc) => verbs::run(&mut enc, args, cwd, eval, &mut |m| eprintln!("{m}")),
Err(e) => (format!("raea fingerprint: loading the encoders: {e:#}"), 1),
}
}
fn reach() -> Option<TcpStream> {
let h: Value = serde_json::from_slice(&std::fs::read(host()).ok()?).ok()?;
TcpStream::connect(("127.0.0.1", h["port"].as_u64()? as u16)).ok()
}
/// The service started in the background, its output in ~/.raea/fingerprints/.serve.log; its stream once it's up
fn start() -> Result<TcpStream, String> {
let _ = std::fs::remove_file(host());
std::fs::create_dir_all(root()).map_err(|e| e.to_string())?;
let log = root().join(".serve.log");
let file = std::fs::File::create(&log).map_err(|e| e.to_string())?;
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
let mut cmd = std::process::Command::new(exe);
cmd.args(["fingerprint", "serve"]).stdin(std::process::Stdio::null()).stdout(file.try_clone().map_err(|e| e.to_string())?).stderr(file);
#[cfg(unix)]
std::os::unix::process::CommandExt::process_group(&mut cmd, 0);
let mut child = cmd.spawn().map_err(|e| format!("starting the service: {e}"))?;
eprintln!("raea fingerprint: starting the service (loading the encoders once; its log is {})", log.display());
let t = Instant::now();
while t.elapsed() < UP {
if let Some(s) = reach() {
return Ok(s);
}
if let Ok(Some(status)) = child.try_wait() {
let tail = std::fs::read_to_string(&log).unwrap_or_default();
return Err(format!("the service stopped ({status}):\n{}", tail.lines().rev().take(12).collect::<Vec<_>>().into_iter().rev().collect::<Vec<_>>().join("\n")));
}
std::thread::sleep(Duration::from_millis(200));
}
let _ = child.kill();
Err(format!("the service didn't come up in {} s (see {})", UP.as_secs(), log.display()))
}
/// A verb sent to the service, started if it isn't running; its progress printed as it comes
pub(crate) fn call(args: &[String], cwd: &Path) -> (String, i32) {
let stream = match reach() {
Some(s) => Ok(s),
None if args.first().is_some_and(|v| v == "stop") => return ("raea fingerprint: no service running".into(), 0),
None => start(),
};
let mut s = match stream {
Ok(s) => s,
Err(e) => return (format!("raea fingerprint: {e}"), 1),
};
if writeln!(s, "{}", json!({"args": args, "cwd": cwd})).is_err() {
return ("raea fingerprint: the service closed the connection".into(), 1);
}
for line in BufReader::new(s).lines() {
let Ok(line) = line else { break };
let v: Value = serde_json::from_str(&line).unwrap_or_default();
if let Some(m) = v["say"].as_str() {
eprintln!("{m}");
} else if v.get("code").is_some() {
return (v["out"].as_str().unwrap_or("").to_string(), v["code"].as_i64().unwrap_or(1) as i32);
}
}
("raea fingerprint: the service ended without an answer (see ~/.raea/fingerprints/.serve.log)".into(), 1)
}
+31
View File
@@ -0,0 +1,31 @@
//! `raea fingerprint things FILE [--project P] [--json]` (docs/fingerprint.feature FP13a, FP13c): a piece's shots,
//! their things (a render's layers, and every mark a person drew on a note of it in P's feed, P the folder it runs in
//! by default) and the camera's path, with what floats, passes through, lurches or is empty
//! (raea-sys-fingerprint-things). `--json` prints it all for `raea check --things`.
use crate::{flag, has};
use anyhow::Result;
use raea_sys_columns::Encoders;
use raea_sys_fingerprint_things::things::{Mark, things};
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 = dunce::canonicalize(&file).ok();
let marks: Vec<Mark> = crate::notes::pinned(&project)
.into_iter()
.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)?;
if has(args, "--json") {
return Ok((serde_json::to_string_pretty(&t)?, 0));
}
let n: usize = t.shots.iter().map(|s| s.things.len()).sum();
let mut out = format!("{}: {} shots, {n} things seen ({} marked), {} findings\n", PathBuf::from(&t.file).display(), t.shots.len(), marks.len(), t.issues.len());
for i in &t.issues {
out += &format!(" {:>6.1} s {} {}\n", i.at, i.rule, i.says);
}
Ok((out, 0))
}
+398
View File
@@ -0,0 +1,398 @@
//! The verbs, run with the encoders loaded: new, bootstrap, teach and score; and report, which needs no encoders.
use crate::{Eval, at, flag, has, listed, named, words};
use anyhow::{Context, Result, anyhow, bail};
use raea_sys_columns::{Encoders, FPS, media};
use raea_sys_fingerprint::evidence::{Ledger, Row, features};
use raea_sys_fingerprint::folder::{Folder, root};
use raea_sys_fingerprint::inherit;
use raea_sys_fingerprint_use::score::{Scored, clock, score, summary, timeline};
use raea_sys_fingerprint_use::sheet::{Tick, sheet};
use raea_sys_fingerprint::taxonomy::{Applies, Fingerprint, base, words_of};
use raea_sys_fingerprint::words::Words;
use crate::bootstrap;
use raea_sys_fingerprint::{report_text, retrain};
use serde_json::json;
use std::path::Path;
/// The fingerprint a verb is about: --fp, else the one `new` made first, else "me"
/// A verb's answer and exit code
pub(crate) fn run(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval, say: &mut dyn FnMut(String)) -> (String, i32) {
let rest = &args[1..];
let ran = match args[0].as_str() {
"new" => new(enc, rest),
"bootstrap" => boot(enc, rest, cwd, eval, say),
"teach" => teach(enc, rest, cwd, eval),
"approve" => approved(enc, rest, cwd, eval),
"reembed" => reembedded(enc, rest, cwd, eval),
"pair" | "versions" => paired(enc, args[0].as_str(), rest, cwd, eval),
"learn-notes" => learned(enc, rest, cwd, eval),
"move" => moved(enc, rest, eval),
"postmortem" => crate::postmortem::run(enc, rest, cwd, eval),
"things" => crate::things::run(enc, rest, cwd),
"profile" => {
let dir = crate::pick::chosen(rest, None).0;
crate::profiles::make(enc, &dir, rest, cwd).map(|o| (o, 0))
}
"score" => scored(enc, rest, cwd, eval),
v => Err(anyhow!("no verb {v}")),
};
ran.unwrap_or_else(|e| (format!("raea fingerprint {}: {e:#}", args[0]), 1))
}
/// A new fingerprint as `new` makes it: raea's base axes, or the axes of the one it --extends, with --who and --about,
/// and the kinds of piece and project tags it judges (--kinds, --tags, each comma-separated)
pub(crate) fn shaped(short: &str, args: &[String], parent: Option<Fingerprint>) -> Fingerprint {
let mut fp = base(short);
if let Some(p) = parent {
fp.axes = p.axes;
fp.extends = Some(p.name);
}
fp.who = flag(args, "--who").map(str::to_string).or_else(|| std::env::var("USER").ok());
fp.about = flag(args, "--about").map(str::trim).filter(|a| !a.is_empty()).map(str::to_string);
let (kinds, tags) = (flag(args, "--kinds").map(words_of).unwrap_or_default(), flag(args, "--tags").map(words_of).unwrap_or_default());
if !kinds.is_empty() || !tags.is_empty() {
fp.applies = Some(Applies { kinds, tags });
}
fp
}
fn new(enc: &mut Encoders, args: &[String]) -> Result<(String, i32)> {
let n = *words(args).map_err(|e| anyhow!(e))?.first().ok_or_else(|| anyhow!("name it: raea fingerprint new NAME"))?;
let dir = Folder::named(n);
let short = dir.dir.file_name().map(|s| s.to_string_lossy().into_owned()).unwrap_or_else(|| n.into());
let parent = match flag(args, "--extends") {
Some(p) => Some(Folder::named(p).read(None).with_context(|| format!("--extends {p}"))?),
None => None,
};
let from = parent.as_ref().map(|p| format!("{}'s axes", p.name)).unwrap_or_else(|| "raea's base taxonomy".into());
let mut fp = shaped(&short, args, parent);
fp.encoders = enc.pins();
dir.create(&fp)?;
let w = Words::build(enc, &fp)?;
dir.write_words(&w)?;
retrain(&dir, &fp, &w, &Ledger::default(), None)?;
if !root().join("default").exists() && dir.dir.parent() == Some(root().as_path()) {
std::fs::write(root().join("default"), &short)?;
}
Ok((
format!(
"made {}: {} axes from {from}, {} scoring from their words today (advice until they earn a gate)\n edit {} to add, remove or reword axes\n next: raea fingerprint bootstrap FILE... with your own finished work trains the mechanical axes",
dir.dir.display(),
fp.axes.len(),
w.axes.len(),
dir.ts().display()
),
0,
))
}
/// The fingerprint, its encoders checked against this machine's, and its words, made again when they changed
/// The fingerprint a verb uses (pick.rs: --fp, else the one that judges the file), its axes with its parents', and its
/// words
pub(crate) fn open(enc: &mut Encoders, args: &[String], eval: Eval, file: Option<&Path>) -> Result<(Folder, Fingerprint, Words)> {
let dir = crate::pick::chosen(args, file).0;
let mut raw = dir.read(Some(eval))?;
let here = enc.pins();
if raw.encoders.is_empty() {
raw.encoders = here;
dir.rewrite(&raw)?;
} else if here.iter().filter(|(k, v)| raw.encoders.get(*k) == Some(*v)).count() == raw.encoders.len() && raw.encoders != here {
// an encoder added since (EmbeddingGemma 2, FP1b) doesn't change the ones it was trained on
raw.encoders = here;
dir.rewrite(&raw)?;
} else if raw.encoders != here {
bail!(
"{} was trained on other encoders ({:?}) than this machine has ({:?}); its heads refuse these columns. `raea fingerprint reembed FOLDER...` moves its evidence to these, re-embedding the rows whose media it finds",
dir.ts().display(),
raw.encoders,
here
);
}
// a fingerprint that extends another judges with its parents' axes too (FP14b)
let fp = inherit::axes(&raw, &inherit::parents(&raw, Some(eval)));
let w = match dir.words().filter(|w| !w.stale(&fp)) {
Some(w) => w,
None => {
let w = Words::build(enc, &fp)?;
dir.write_words(&w)?;
w
}
};
// a shared fingerprint arrives with evidence and no heads: this machine trains its own (FP8a)
if !dir.dir.join("heads.safetensors").is_file() {
let l = dir.ledger()?;
if !l.rows.is_empty() {
retrain(&dir, &fp, &w, &l, None)?;
}
}
Ok((dir, fp, w))
}
fn boot(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval, say: &mut dyn FnMut(String)) -> Result<(String, i32)> {
let (dir, fp, w) = open(enc, args, eval, None)?;
let mut files = named(args, cwd)?;
if let Some(list) = flag(args, "--from") {
files.extend(listed(cwd, list)?);
}
if files.is_empty() {
bail!("give it real finished work: raea fingerprint bootstrap FILE... or --from LIST (no placeholder footage)");
}
let per: usize = flag(args, "--per").map_or(Ok(10), str::parse).context("--per takes a count")?;
let mut l = dir.ledger()?;
let who = fp.who.clone().unwrap_or_else(|| "me".into());
let made = bootstrap::rows(enc, &who, &files, per, &mut l, say)?;
dir.write_ledger(&l)?;
say(format!("{} windows from {} sources; measuring held out by source", made.windows, made.sources));
let curves = bootstrap::curves(&fp, &l);
let ws = bootstrap::word_scores(&l, &w);
let patches = raea_sys_fingerprint_things::located::bootstrap(enc, &dir.dir, &files, per, say)?;
let b = json!({"made": made, "per": per, "sources": files, "curves": curves, "words": ws, "patches": patches});
retrain(&dir, &fp, &w, &l, Some(b))?;
Ok((report_text(&dir.report().unwrap_or_default()), 0))
}
/// The project a file belongs to: the folder holding .raea/project above it, else the folder it's in
fn project_of(file: &Path) -> String {
let mut d = file.parent();
while let Some(p) = d {
if p.join(".raea/project").exists() {
return p.file_name().map(|s| s.to_string_lossy().into_owned()).unwrap_or_default();
}
d = p.parent();
}
file.parent().and_then(|p| p.file_name()).map(|s| s.to_string_lossy().into_owned()).unwrap_or_default()
}
/// `approve`: approved work as clean rows on every axis (approve.rs, FP6a), then the heads retrained
fn approved(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let first = words(args).map_err(|e| anyhow!(e))?.first().map(|f| at(cwd, f));
let (dir, fp, w) = open(enc, args, eval, first.as_deref())?;
let (mut out, _) = crate::approve::approve(enc, &dir, &fp, args, cwd, project_of)?;
let tr = retrain(&dir, &fp, &w, &dir.ledger()?, None)?;
out += &format!("{} axes gating\n", tr.heads.iter().filter(|h| h.state == "gating").count());
Ok((out, 0))
}
/// `reembed`: the evidence moved to this machine's encoders (reembed.rs, FP8c), the words remade and the heads retrained
fn reembedded(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let dir = crate::pick::chosen(args, None).0;
let raw = dir.read(Some(eval))?;
let (fp, out) = crate::reembed::reembed(enc, &dir, raw, enc.pins(), args, cwd)?;
let fp = inherit::axes(&fp, &inherit::parents(&fp, Some(eval)));
let w = Words::build(enc, &fp)?;
dir.write_words(&w)?;
retrain(&dir, &fp, &w, &dir.ledger()?, None)?;
Ok((out, 0))
}
/// `pair` and `versions` (pairing.rs, FP6b, FP6c), then the heads retrained
fn paired(enc: &mut Encoders, verb: &str, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let first = words(args).map_err(|e| anyhow!(e))?.first().map(|f| at(cwd, f));
let (dir, fp, w) = open(enc, args, eval, first.as_deref())?;
let who = fp.who.clone().unwrap_or_else(|| "me".into());
let mut l = dir.ledger()?;
let out = if verb == "pair" { crate::pairing::pair(enc, &mut l, &who, args, cwd, project_of)? } else { crate::pairing::versions(enc, &mut l, &who, args, cwd, project_of)? };
dir.write_ledger(&l)?;
retrain(&dir, &fp, &w, &l, None)?;
Ok((out, 0))
}
/// `learn-notes [PROJECT]` (notes.rs, FP5a): checked readings as evidence in the fingerprint that judges the project
/// (FP14d), then its heads retrained
fn learned(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let (dir, fp, w) = open(enc, args, eval, Some(&crate::pick::piece_in(args, cwd)))?;
let mut l = dir.ledger()?;
let out = crate::notes::learn(enc, &dir, &mut l)?;
dir.write_ledger(&l)?;
retrain(&dir, &fp, &w, &l, None)?;
Ok((out, 0))
}
/// `move` (moving.rs, FP14d): a child's own labels up into a fingerprint it extends, then both retrained
fn moved(enc: &mut Encoders, args: &[String], eval: Eval) -> Result<(String, i32)> {
let (dir, fp, w) = open(enc, args, eval, None)?;
let (to, out) = crate::moving::up(&dir, &dir.read(Some(eval))?, args, eval)?;
retrain(&dir, &fp, &w, &dir.ledger()?, None)?;
let (pd, pfp, pw) = open(enc, &["--fp".into(), to], eval, None)?;
retrain(&pd, &pfp, &pw, &pd.ledger()?, None)?;
Ok((out, 0))
}
fn teach(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let file = at(cwd, words(args).map_err(|e| anyhow!(e))?.first().ok_or_else(|| anyhow!("which file?"))?);
let (dir, fp, w) = open(enc, args, eval, Some(&file))?;
let axis = flag(args, "--axis").ok_or_else(|| anyhow!("--axis A (or \"*\" for every axis)"))?;
if axis != "*" && fp.axis(axis).is_none() {
bail!("no axis {axis:?} in {}: its axes are {}", dir.ts().display(), fp.axes.iter().map(|a| a.name.as_str()).collect::<Vec<_>>().join(", "));
}
let t: f64 = flag(args, "--at").ok_or_else(|| anyhow!("--at SECONDS"))?.parse().context("--at takes seconds")?;
let span: f64 = flag(args, "--span").map_or(Ok(2.0), str::parse).context("--span takes seconds")?;
let region = flag(args, "--box").map(|b| -> Result<[f32; 4]> {
let v: Vec<f32> = b.split(',').map(str::parse).collect::<Result<_, _>>().context("--box takes x0,y0,x1,y1 in 0-1")?;
v.try_into().map_err(|_| anyhow!("--box takes four numbers"))
});
let c = enc.columns(&file)?;
let a = (t - span / 2.0).clamp(0.0, (c.dur - span).max(0.0));
let b = (a + span).min(c.dur);
let bad = !has(args, "--good");
let row = Row {
media: c.media.clone(),
a,
b,
axis: axis.into(),
bad,
weight: 1.0,
who: fp.who.clone().unwrap_or_else(|| "me".into()),
source: "teach".into(),
project: flag(args, "--project").map_or_else(|| project_of(&file), str::to_string),
kind: None,
region: region.transpose()?,
words: flag(args, "--words").map(str::to_string),
at: 0,
pin: None,
band: None,
};
let mut l = dir.ledger()?;
l.push(row, &features(&c, a, b));
dir.write_ledger(&l)?;
let tr = retrain(&dir, &fp, &w, &l, None)?;
let h = tr.heads.iter().find(|h| h.axis == axis);
let (p, n) = l.for_axis(axis).iter().fold((0, 0), |(p, n), &i| if l.rows[i].bad { (p + 1, n) } else { (p, n + 1) });
Ok((
format!(
"taught {axis}: {} at {} in {}\n {axis} has {p} defect and {n} clean labels; its head: {}",
if bad { "the defect" } else { "clean" },
clock(t),
file.display(),
h.map_or("every axis's clean labels grew".to_string(), |h| format!("{} ({})", h.state, h.why))
),
0,
))
}
/// raea check's findings on the file, in seconds: (rule, from, to, what)
fn checks(file: &Path) -> Vec<(String, f64, f64, String)> {
let Ok(found) = raea_app_check::floor(&[file.display().to_string()], &[], &[]) else { return Vec::new() };
found.into_iter().map(|f| {
let (a, b) = f.frames.map_or((0.0, 0.0), |[a, b]| (a as f64 / 30.0, b as f64 / 30.0));
(f.check, a, b, f.says)
}).collect()
}
/// A check wins over a head (FP4c): a moment on an axis a check measures is no gate unless the check found it too
fn arbitrate(s: &mut Scored, fp: &Fingerprint, found: &[(String, f64, f64, String)]) {
for m in &mut s.moments {
let Some(rule) = fp.axis(&m.axis).and_then(|a| a.check.as_deref()) else { continue };
let agrees = found.iter().any(|(r, a, b, _)| r == rule && *a <= m.b + 1.0 && *b >= m.a - 1.0);
if !agrees {
m.gating = false;
m.state = format!("{}; the {rule} check found none", m.state);
}
}
}
fn scored(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<(String, i32)> {
let file = at(cwd, words(args).map_err(|e| anyhow!(e))?.first().ok_or_else(|| anyhow!("which file?"))?);
let (dir, fp, w) = open(enc, args, eval, Some(&file))?;
let why = crate::pick::chosen(args, Some(&file)).1.map_or_else(|| "named with --fp, or the account's default".to_string(), |c| c.why);
let c = enc.columns(&file)?;
let trained = dir.trained()?.map(|(t, _)| t);
let mut s = score(&fp, Some(&w), trained.as_ref(), &c, &file.display().to_string());
let found = checks(&file);
arbitrate(&mut s, &fp, &found);
raea_sys_fingerprint_things::located::locate(enc, &file, &raea_sys_fingerprint_use::patch::load(&dir.dir), &mut s)?;
// FP9a: each gating flag on the cut before, judged on this one, and its axis's disguises rerun on the fix
let fixes = match flag(args, "--was") {
Some(old) => {
let was = at(cwd, old);
let mut ws = score(&fp, Some(&w), trained.as_ref(), &enc.columns(&was)?, &was.display().to_string());
arbitrate(&mut ws, &fp, &checks(&was));
Some(raea_sys_fingerprint_use::fixed::fixes(&ws, &s, &fp, &dir.ledger()?, &c))
}
None => None,
};
let mut out = if has(args, "--json") {
serde_json::to_string_pretty(&json!({"fingerprint": {"name": fp.name, "about": fp.about, "why": why}, "scored": s, "checks": found.iter().map(|(r, a, b, says)| json!({"check": r, "a": a, "b": b, "says": says})).collect::<Vec<_>>(), "fixes": fixes}))?
} else if let Some(f) = &fixes {
let mut t = format!("judged by {}: {why}\n", fp.name);
t += &raea_sys_fingerprint_use::fixed::said(f);
t += &summary(&s);
t
} else {
let mut t = format!("judged by {}: {why}\n", fp.name);
t += &summary(&s);
t += &format!("checks: {}\n", if found.is_empty() { "no findings".to_string() } else { format!("{} findings", found.len()) });
for (r, a, _, says) in &found {
t += &format!(" {} {r}: {says}\n", clock(*a));
}
t
};
if has(args, "--timeline") {
out += &timeline(&s);
}
if let Some(p) = flag(args, "--profile") {
out += &crate::profiles::against(enc, &dir, p, &file)?.0;
}
if let Some(png) = flag(args, "--sheet") {
let png = at(cwd, png);
let frames: Vec<media::Rgb> = (0..12).filter_map(|i| media::frames(&file, FPS, c.dur * (i as f64 + 0.5) / 12.0, 0.25).ok()?.into_iter().next()).collect();
let pcm = media::sound(&file, 16_000)?;
let ticks: Vec<Tick> = found.iter().map(|(r, a, b, _)| Tick { a: *a, b: *b, what: r.clone() }).collect();
sheet(&s, &frames, &pcm, &ticks, &|axis| fp.axis(axis).map(|a| a.modality), &png)?;
out += &format!("sheet: {}\n", png.display());
}
let unfixed = fixes.iter().flatten().any(|f| f.verdict != "fixed");
Ok((out, i32::from(unfixed || s.moments.iter().any(|m| m.gating))))
}
/// `raea fingerprint report`: report.json, read; no encoders needed
pub(crate) fn report_here(args: &[String]) -> i32 {
let dir = crate::pick::chosen(args, None).0;
match dir.report() {
Some(r) if has(args, "--json") => {
println!("{}", serde_json::to_string_pretty(&r).unwrap_or_default());
0
}
Some(r) => {
println!("{}", report_text(&r).trim_end());
0
}
None => {
eprintln!("raea fingerprint report: no report at {} (`raea fingerprint new NAME` makes one)", dir.dir.display());
1
}
}
}
#[cfg(test)]
mod tests {
use super::shaped;
use raea_sys_fingerprint::taxonomy::{Applies, base};
fn args(xs: &[&str]) -> Vec<String> {
xs.iter().map(|x| x.to_string()).collect()
}
/// FP14a: a new fingerprint says what it's for, and one that extends another starts from its axes
#[test]
fn a_new_fingerprint_says_what_its_for_and_what_it_builds_on() {
let own = shaped("me", &args(&["me", "--who", "w"]), None);
assert_eq!((own.about.as_deref(), own.extends.as_deref(), own.who.as_deref()), (None, None, Some("w")));
assert_eq!(own.axes, base("me").axes);
let mut parent = base("me");
parent.axes.truncate(2);
parent.axes[0].words = vec!["a soft picture".into()];
let ads = shaped("ads", &args(&["ads", "--about", " Short ads for one brand ", "--extends", "me"]), Some(parent.clone()));
assert_eq!(ads.name, "ads");
assert_eq!(ads.about.as_deref(), Some("Short ads for one brand"));
assert_eq!(ads.extends.as_deref(), Some("me"));
assert_eq!(ads.axes, parent.axes);
assert_eq!(shaped("x", &args(&["x", "--about", " "]), None).about, None);
assert_eq!(own.applies, None);
let judged = shaped("ads", &args(&["ads", "--kinds", "ad, Playable", "--tags", "brand,"]), None);
assert_eq!(judged.applies, Some(Applies { kinds: vec!["ad".into(), "playable".into()], tags: vec!["brand".into()] }));
}
}
+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" }
+12 -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;
@@ -32,9 +32,14 @@ pub const USAGE: &str = "raea export-game EDIT.tsx -o OUT [--target mac-app|mac-
/// `raea export-game EDIT.tsx -o OUT ...`
pub fn export(args: &[String]) -> R<String> {
// its targets are a Mac's, signed with codesign, and raea's Windows and Linux releases carry no game player: there
// it said "no player ... (build it: cargo build ...)", which a person can't act on
if !cfg!(target_os = "macos") {
return Err("raea export-game makes a Mac game (an .app or a command) and runs on a Mac; Windows and Linux games aren't there yet (sdk/react/docs/game-export.md)".into());
}
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 +93,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 +106,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 +257,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" }
+20 -4
View File
@@ -99,10 +99,22 @@ fn shape(expr: &str, out: &Path, meshes: &mut BTreeMap<String, String>) -> R<Val
Some(f) => f.clone(),
None => {
let f = format!("meshes/mesh{k}.glb");
let m = raea_core_shape::solid(expr)?;
raea_core_shape::export(&m, &out.join(&f).to_string_lossy(), "glb")?;
// and as an .obj, which Godot imports as a mesh of its own (a .glb comes in as a scene)
raea_core_shape::export(&m, &out.join(f.replace(".glb", ".obj")).to_string_lossy(), "obj")?;
let (glb, obj) = (out.join(&f).to_string_lossy().into_owned(), out.join(f.replace(".glb", ".obj")).to_string_lossy().into_owned());
match expr.strip_prefix("buffer:") {
// a mesh given by its own vertices (a <BufferMesh>, a three.js geometry through raea/r3f): written as it
// is, with its normals and texture coordinates, since it needn't be a closed solid
Some(b) => {
let (t, uv) = raea_core_shape::buffer_tris(b)?;
raea_core_shape::export_tris(&t, uv.as_deref(), &glb, "glb")?;
raea_core_shape::export_tris(&t, uv.as_deref(), &obj, "obj")?;
}
None => {
let m = raea_core_shape::solid(expr)?;
raea_core_shape::export(&m, &glb, "glb")?;
raea_core_shape::export(&m, &obj, "obj")?;
}
}
meshes.insert(expr.to_string(), f.clone());
f
}
@@ -237,7 +249,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())?;
@@ -310,6 +322,10 @@ mod tests {
assert!(out.join(v["file"].as_str().unwrap()).is_file());
// the same mesh twice is one file
assert_eq!(shape("difference(box(1, 1, 1), sphere(0.6))", &out, &mut m).unwrap(), v);
// a buffer mesh (an open quad, as raea/r3f gives a three.js PlaneGeometry) is a mesh file too, not refused
let q = shape(r#"buffer:{"positions": [0,0,0, 1,0,0, 1,1,0, 0,1,0], "indices": [0,1,2, 0,2,3]}"#, &out, &mut m).unwrap();
assert_eq!(q["type"], "mesh");
assert!(out.join(q["file"].as_str().unwrap()).is_file() && out.join(q["obj"].as_str().unwrap()).is_file());
let _ = std::fs::remove_dir_all(&out);
}
}
+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" => {
+18
View File
@@ -0,0 +1,18 @@
[package]
name = "raea-app-layers"
version = "0.1.0"
edition = "2024"
license = "FSL-1.1-ALv2"
publish = false
description = "`raea export layers`: a composition as its layers (captions, graphics, footage, under, sound) and the timeline that places them, layers.json, which every editor's export is written from (docs/layers.feature LA4)"
[dependencies]
raea-runtime-bundle = { path = "../../runtime/bundle" }
raea-io-alpha = { path = "../../io/alpha" }
raea-io-media = { path = "../../io/media", default-features = false, features = ["soft-audio", "apple"] }
# the renderer's own lookup of a staticFile path (/media/x), so the export finds the files the render drew
raea-core-scene = { path = "../../core/scene" }
# canonicalize without Windows' \\?\ prefix, as the rest of raea does
dunce = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
+21
View File
@@ -0,0 +1,21 @@
// docs/layers.feature LA3a: captions whose words light up as they're said, over full-frame footage
import { AbsoluteFill, Composition, Video, registerRoot, staticFile, useCurrentFrame } from "raea";
const WORDS = ["Each", "word", "lights", "up"];
function Edit() {
const f = useCurrentFrame();
const lit = Math.min(WORDS.length - 1, Math.floor(f / 12));
return (
<AbsoluteFill style={{ background: "#000" }}>
<Video src={staticFile("clip.mp4")} style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" }} />
<div data-raea-role="caption" style={{ position: "absolute", left: 0, right: 0, bottom: 80, textAlign: "center", fontSize: 60, fontWeight: 800, color: "#fff" }}>
{WORDS.map((w, i) => (
<span key={w} style={{ color: i === lit ? "#ffd400" : "#fff" }}>{w} </span>
))}
</div>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="edit" width={1280} height={720} fps={30} durationInFrames={60} component={Edit} />);
+20
View File
@@ -0,0 +1,20 @@
// docs/layers.feature LA3a: full-frame footage with a lower third (a bar and words) and captions
import { AbsoluteFill, Composition, Sequence, Video, registerRoot, staticFile } from "raea";
function Edit() {
return (
<AbsoluteFill style={{ background: "#000" }}>
<Video src={staticFile("clip.mp4")} style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" }} />
<div style={{ position: "absolute", left: 0, bottom: 200, width: 620, height: 90, background: "#ff3b30" }}>
<span style={{ position: "absolute", left: 32, top: 18, fontSize: 44, color: "#fff" }}>Jane Doe, raea</span>
</div>
<Sequence from={10} durationInFrames={40}>
<div data-raea-role="caption" style={{ position: "absolute", left: 0, right: 0, bottom: 60, textAlign: "center", fontSize: 52, color: "#fff", textShadow: "0 2px 6px #000" }}>
The words as they're said
</div>
</Sequence>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="edit" width={1280} height={720} fps={30} durationInFrames={60} component={Edit} />);
+15
View File
@@ -0,0 +1,15 @@
// docs/layers.feature LA3a: footage as a picture in picture on a coloured card, over a background
import { AbsoluteFill, Composition, Video, registerRoot, staticFile } from "raea";
function Edit() {
return (
<AbsoluteFill style={{ background: "#14161c" }}>
<div style={{ position: "absolute", left: 120, top: 120, width: 700, height: 420, background: "#2050ff", borderRadius: 24 }}>
<Video src={staticFile("clip.mp4")} style={{ position: "absolute", left: 30, top: 30, width: 640, height: 360 }} />
</div>
<div style={{ position: "absolute", left: 880, top: 160, fontSize: 56, fontWeight: 800, color: "#fff" }}>On the card</div>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="edit" width={1280} height={720} fps={30} durationInFrames={60} component={Edit} />);
+29
View File
@@ -0,0 +1,29 @@
// docs/layers.feature LA3a: 3D with a title over it and a caption (the 3D is in the graphics layer, never the captions')
import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
import { Entity } from "raea/3d";
import { StandardMaterial } from "raea/pbr";
import { Cuboid, Mesh3d } from "raea/mesh";
import { AmbientLight, DirectionalLight } from "raea/light";
import { Quat, Transform } from "raea/transform";
import { Camera3d } from "raea/camera";
function Edit() {
const turn = (useCurrentFrame() / 30) * (Math.PI / 3);
return (
<AbsoluteFill style={{ background: "#14161c" }}>
<Camera3d transform={Transform.fromXyz(0, 1.6, 6).lookingAt([0, 0.5, 0])} projection={{ Perspective: { fov: (40 * Math.PI) / 180 } }} />
<AmbientLight brightness={160} />
<DirectionalLight transform={Transform.fromXyz(3, 5, 4).lookingAt([0, 0, 0])} illuminance={11200} />
<Entity transform={Transform.IDENTITY.withRotation(Quat.fromEuler("XYZ", 0, turn, 0))}>
<Mesh3d transform={Transform.fromXyz(0, 0.6, 0)}>
<Cuboid half_size={[0.6, 0.6, 0.6]} />
<StandardMaterial base_color="#e8b04a" perceptual_roughness={0.35} />
</Mesh3d>
</Entity>
<div style={{ position: "absolute", top: 60, width: "100%", textAlign: "center", fontSize: 64, fontWeight: 800, color: "#fff" }}>Made to be seen</div>
<div data-raea-role="caption" style={{ position: "absolute", bottom: 60, width: "100%", textAlign: "center", fontSize: 48, color: "#ff0" }}>a caption over 3D</div>
</AbsoluteFill>
);
}
registerRoot(() => <Composition id="edit" width={1280} height={720} fps={30} durationInFrames={60} component={Edit} />);
+204
View File
@@ -0,0 +1,204 @@
//! docs/layers.feature LA3a: the layers put back together are the render. Each fixture (apps/layers/fixtures) is
//! exported in layers by a built raea, its passes' frames kept; at each clip's first, middle and last frame the layers
//! are composited bottom to top (under, footage as layers.json places it, graphics, captions) and compared with the
//! reference render's frame. A test of the method, run by hand on a machine with a GPU:
//! cargo test -p raea-app-layers composite -- --ignored --nocapture (RAEA_BIN: the raea, default target/release/raea;
//! RAEA_LAYERS_PROJECT=DIR/EDIT.tsx checks that composition, its media/ beside it, in place of the fixtures, and
//! RAEA_LAYERS_COMPOSITION=ID one of its compositions by id)
use std::path::{Path, PathBuf};
use std::process::Command;
use crate::model::{Clip, Key, Layer, Layers, key_at};
/// The least PSNR (dB) a composited frame has against the reference render's: the reference is an H.264 movie and the
/// footage is decoded and scaled here as the page does it, so a frame is never exact.
const MIN_PSNR: f64 = 30.0;
/// An RGB picture, 0..1, row by row.
struct Picture {
w: usize,
h: usize,
px: Vec<[f32; 3]>,
}
impl Picture {
fn black(w: usize, h: usize) -> Picture {
Picture { w, h, px: vec![[0.0; 3]; w * h] }
}
/// `rgba` (straight alpha, 8 bits) laid over this at full size, times `opacity`.
fn over(&mut self, rgba: &[u8], opacity: f32) {
for (k, p) in self.px.iter_mut().enumerate() {
let a = rgba[k * 4 + 3] as f32 / 255.0 * opacity;
for c in 0..3 {
p[c] = p[c] * (1.0 - a) + rgba[k * 4 + c] as f32 / 255.0 * a;
}
}
}
/// A picture of `mw` x `mh` (RGBA) as a footage clip shows it at `key` (layers.json's place for that frame): where
/// plan::picture draws it and keeps it, or stretched over its box for object-fit: fill (as raea draws it; an editor
/// fits it inside), sampled bilinearly, times its opacity.
fn draw(&mut self, rgba: &[u8], mw: usize, mh: usize, key: &Key, fit: &str) {
let (canvas, media) = ((self.w as f64, self.h as f64), (mw as f64, mh as f64));
// where the whole picture is, and the edges of what of it shows
let ([ox, oy, dw, dh], [l, t, r, b]) = if fit == "fill" {
let [x, y, w, h] = crate::plan::shown(&key.r#box, &key.clip);
(key.r#box, [x, y, x + w, y + h])
} else {
let (p, _) = crate::plan::picture(&key.r#box, &key.clip, fit, &key.position, media, canvas);
let [dx, dy, dw, dh] = p.drawn;
(p.drawn, [dx + p.kept[0] * dw, dy + p.kept[1] * dh, dx + p.kept[2] * dw, dy + p.kept[3] * dh])
};
let (sx, sy, opacity) = (dw / media.0, dh / media.1, key.opacity as f32);
let (x0, y0) = (l.max(0.0) as usize, t.max(0.0) as usize);
let (x1, y1) = ((r.ceil().max(0.0) as usize).min(self.w), (b.ceil().max(0.0) as usize).min(self.h));
let at = |x: usize, y: usize, c: usize| rgba[(y.min(mh - 1) * mw + x.min(mw - 1)) * 4 + c] as f32 / 255.0;
for y in y0..y1 {
for x in x0..x1 {
let (u, v) = ((x as f64 + 0.5 - ox) / sx - 0.5, (y as f64 + 0.5 - oy) / sy - 0.5);
if u < -0.5 || v < -0.5 || u > mw as f64 - 0.5 || v > mh as f64 - 0.5 {
continue;
}
let (u, v) = (u.max(0.0), v.max(0.0));
let (iu, iv, fu, fv) = (u as usize, v as usize, (u.fract()) as f32, (v.fract()) as f32);
let p = &mut self.px[y * self.w + x];
for (c, ch) in p.iter_mut().enumerate() {
let s = at(iu, iv, c) * (1.0 - fu) * (1.0 - fv) + at(iu + 1, iv, c) * fu * (1.0 - fv) + at(iu, iv + 1, c) * (1.0 - fu) * fv + at(iu + 1, iv + 1, c) * fu * fv;
*ch = *ch * (1.0 - opacity) + s * opacity;
}
}
}
}
/// Peak signal-to-noise ratio against `rgba`, in dB (infinite when they're the same).
fn psnr(&self, rgba: &[u8]) -> f64 {
let mut se = 0.0f64;
for (k, p) in self.px.iter().enumerate() {
for c in 0..3 {
let d = p[c] as f64 - rgba[k * 4 + c] as f64 / 255.0;
se += d * d;
}
}
let mse = se / (self.px.len() * 3) as f64;
if mse == 0.0 { f64::INFINITY } else { 10.0 * (1.0 / mse).log10() }
}
}
/// A movie's frame at `secs`, as RGBA, with its size.
fn frame(path: &Path, secs: f64) -> Result<(Vec<u8>, usize, usize), String> {
let mut d = raea_io_media::preferred().into_iter().find_map(|b| b.open_video(path).ok()).ok_or_else(|| format!("{}: no backend opens it", path.display()))?;
let f = d.frame_at(secs).map_err(|e| format!("{}: {e}", path.display()))?;
Ok((f.rgba.to_vec(), f.width as usize, f.height as usize))
}
/// Frame `f` of the export in `dir` composited from its layers, bottom to top.
fn composite(dir: &Path, l: &Layers, f: i64) -> Result<Picture, String> {
let mut pic = Picture::black(l.width as usize, l.height as usize);
let on = |c: &&Clip| c.start <= f && f < c.end();
for t in l.tracks.iter().rev() {
for c in t.clips.iter().filter(on) {
match t.layer {
Layer::Sound => {}
Layer::Footage => {
let file = &l.files[c.file];
// the source frame at or before the time, as raea shows it (a take faster than the edit has one
// between two of its frames): only a hair past the time, for the manifest's whole milliseconds
let secs = c.source_in + (f - c.start) as f64 / l.fps * c.speed + 1e-4;
let (rgba, w, h) = frame(Path::new(&file.path), secs)?;
let first = Key { frame: 0, r#box: c.r#box.unwrap_or([0.0, 0.0, l.width as f64, l.height as f64]), clip: c.clip, position: c.position, opacity: c.opacity };
let key = key_at(&c.keys, f - c.start).unwrap_or(first);
pic.draw(&rgba, w, h, &key, c.fit.as_deref().unwrap_or("fill"));
}
_ => {
// a layer's movie is NAME.CODEC.mov, its frames NAME.frames
let name = l.files[c.file].path.split('.').next().unwrap_or_default().to_string();
let png = dir.join(format!("{name}.frames/frame-{f:05}.png"));
let (rgba, _, _) = raea_io_alpha::read_png(&png)?;
pic.over(&rgba, 1.0);
}
}
}
}
Ok(pic)
}
/// Each fixture exported by `bin` into its own folder under `work`: its layers.json and the folder.
fn export(bin: &Path, fixture: &Path, work: &Path) -> Result<(Layers, PathBuf), String> {
let name = fixture.file_stem().unwrap().to_string_lossy().into_owned();
let src = work.join(&name);
let _ = std::fs::remove_dir_all(&src);
std::fs::create_dir_all(src.join("media")).map_err(|e| e.to_string())?;
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
// a project of its own is exported where it is; a fixture is copied with the test clip beside it
let (src, edit) = if fixture.parent() == Some(&Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures")) {
std::fs::copy(fixture, src.join("edit.tsx")).map_err(|e| e.to_string())?;
std::fs::copy(root.join("engine/rune/media/tests/fixtures/clip.mp4"), src.join("media/clip.mp4")).map_err(|e| e.to_string())?;
(src, "edit.tsx".to_string())
} else {
(fixture.parent().unwrap().to_path_buf(), fixture.file_name().unwrap().to_string_lossy().into_owned())
};
let out = work.join(&name).join("layers");
let comp: Vec<String> = std::env::var("RAEA_LAYERS_COMPOSITION").map(|c| vec!["--composition".to_string(), c]).unwrap_or_default();
let run = Command::new(bin)
.args(["export", "layers", edit.as_str()])
.args(&comp)
.arg("-o")
.arg(&out)
.current_dir(&src)
.env("RAEA_LAYERS_KEEP_FRAMES", "1")
.env("RAEA_EXPORT_CACHE", "0")
.output()
.map_err(|e| format!("{}: {e}", bin.display()))?;
if !run.status.success() {
return Err(format!("{name}: {}{}", String::from_utf8_lossy(&run.stdout), String::from_utf8_lossy(&run.stderr)));
}
println!("{name}: {}", String::from_utf8_lossy(&run.stdout).trim());
let l: Layers = serde_json::from_str(&std::fs::read_to_string(out.join("layers.json")).map_err(|e| e.to_string())?).map_err(|e| e.to_string())?;
Ok((l, out))
}
#[test]
#[ignore]
fn composite_the_layers_back_and_they_are_the_render() {
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
let bin = std::env::var_os("RAEA_BIN").map_or_else(|| root.join("target/release/raea"), PathBuf::from);
let work = std::env::temp_dir().join(format!("raea-layers-la3a-{}", std::process::id()));
let mut fixtures: Vec<PathBuf> = match std::env::var_os("RAEA_LAYERS_PROJECT") {
Some(p) => vec![PathBuf::from(p)],
None => std::fs::read_dir(Path::new(env!("CARGO_MANIFEST_DIR")).join("fixtures")).unwrap().flatten().map(|e| e.path()).filter(|p| p.extension().is_some_and(|x| x == "tsx")).collect(),
};
fixtures.sort();
let mut failed = Vec::new();
for fx in &fixtures {
let name = fx.file_stem().unwrap().to_string_lossy().into_owned();
let (l, dir) = match export(&bin, fx, &work) {
Ok(x) => x,
Err(e) => {
failed.push(e);
continue;
}
};
// each clip's first, middle and last frame
let mut at: Vec<i64> = l.tracks.iter().filter(|t| t.layer != Layer::Sound).flat_map(|t| t.clips.iter()).flat_map(|c| [c.start, c.start + c.frames / 2, c.end() - 1]).filter(|f| (0..l.frames).contains(f)).collect();
at.sort();
at.dedup();
for f in at {
let got = composite(&dir, &l, f).and_then(|pic| frame(&dir.join(&l.reference), (f as f64 + 0.25) / l.fps).map(|r| (pic, r)));
match got {
Ok((pic, (reference, w, h))) if (w, h) == (pic.w, pic.h) => {
let db = pic.psnr(&reference);
println!(" {name} frame {f}: {db:.1} dB");
if db < MIN_PSNR {
failed.push(format!("{name} frame {f}: the layers composited are {db:.1} dB from the reference (at least {MIN_PSNR})"));
}
}
Ok((pic, (_, w, h))) => failed.push(format!("{name} frame {f}: the reference is {w}x{h}, the layers {}x{}", pic.w, pic.h)),
Err(e) => failed.push(format!("{name} frame {f}: {e}")),
}
}
}
let _ = std::fs::remove_dir_all(&work);
assert!(failed.is_empty(), "{}", failed.join("\n"));
}
+420
View File
@@ -0,0 +1,420 @@
//! `raea export layers EDIT.tsx` (docs/layers.feature LA4a): a composition as its layers and layers.json, the timeline
//! that places them, which every editor's export is written from. Its renders, each by this same program:
//! 1. as it is, with its manifest: the reference render, and what shows when (each file's runs, each sound clip, the
//! words a caption says);
//! 2. RAEA_LAYER=graphics: what the page draws over the footage, less the captions, transparent;
//! 3. RAEA_LAYER=under, when there is footage or 3D: what's drawn under the page's footage and graphics (the
//! backgrounds holding footage, and the 3D), opaque, kept unless it's black;
//! 4. RAEA_LAYER=captions, when a frame shows a caption: the captions alone, and the words as SubRip;
//! 5. RAEA_LAYER=behind:FILE, for each file shown as a picture in picture: what's drawn behind it (its card), kept
//! only where it's a picture in picture, on a track between it and the footage under it.
//!
//! The footage and sounds are clips of their own files where they are; each layer is clips of its movie, cut where it
//! draws something. A render that isn't an export draws once, as it always has (LA2o).
pub mod model;
pub mod plan;
pub mod srt;
pub mod xml;
#[cfg(test)]
mod composite;
#[cfg(test)]
mod tests;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::process::Command;
use model::{Clip, File, FileKind, Layer, Layers, Track};
use raea_runtime_bundle::flag;
use serde_json::Value;
pub type R<T> = Result<T, String>;
pub const USAGE: &str = "raea export layers EDIT.tsx [--composition ID] [-o DIR] [--name NAME] [--alpha-codec prores|hevc|rle|png] (the composition as its layers and the timeline that places them, layers.json: the captions and the graphics as transparent movies, what's under the footage (and any 3D) as an opaque one, the footage and sounds as clips of their own files where they are, the captions also as SubRip, and the reference render; into out/layers/NAME, or DIR)";
pub const USAGE_XML: &str = "raea export xml EDIT.tsx [--composition ID] [-o DIR] [--name NAME] [--alpha-codec prores|hevc|rle|png] (the composition as an FCP7 XML project for Premiere Pro (File, Import) and DaVinci Resolve (File, Import, Timeline): its layers as raea export layers writes them, NAME.premiere.xml and NAME.resolve.xml beside them placing them on a timeline, each as that editor writes it, the footage and sounds as clips of their own files where they are, each clip's own sound linked to it; into out/xml/NAME, or DIR)";
/// `export layers ...` and `export xml ...`; None for anything else.
pub fn cli(args: &[String]) -> Option<R<String>> {
if args.first().map(String::as_str) != Some("export") {
return None;
}
match args.get(1).map(String::as_str) {
Some("layers") => Some(export(&args[2..]).map(|(_, said)| said)),
Some("xml") => Some(export_xml(&args[2..])),
_ => None,
}
}
/// `raea export xml`: the layers into DIR (out/xml/NAME unless -o says), then NAME.xml beside them (LA5a).
fn export_xml(args: &[String]) -> R<String> {
let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE_XML)?;
let edit = dunce::canonicalize(PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?;
let name = named(args, &edit);
let dir = flag(args, "-o").map_or_else(|| edit.parent().unwrap().join("out/xml").join(&name), PathBuf::from);
let mut layer_args = args.to_vec();
if flag(args, "-o").is_none() {
layer_args.extend(["-o".into(), dir.display().to_string()]);
}
let (layers, _) = export(&layer_args)?;
let dir = dunce::canonicalize(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
// an XML an editor, the same but for what they read differently (xml::Editor)
let mut notes: Vec<String> = Vec::new();
for e in [xml::Editor::Premiere, xml::Editor::Resolve] {
let (text, n) = xml::write(&layers, &dir, e);
let out = dir.join(format!("{name}.{}.xml", e.name()));
std::fs::write(&out, text).map_err(|e| format!("{}: {e}", out.display()))?;
for n in n {
if !notes.contains(&n) {
notes.push(n);
}
}
}
let _ = std::fs::remove_file(dir.join(format!("{name}.xml")));
let count = |l: Layer| layers.tracks.iter().filter(|t| t.layer == l).count();
let mut said = format!(
"APPLIED FCP7 XML \"{name}\" at {}: {name}.premiere.xml for Premiere Pro (File, Import), {name}.resolve.xml for DaVinci Resolve (File, Import, Timeline); {} video tracks, {} audio tracks; the layers, layers.json{} and the reference render beside them",
dir.display(),
layers.tracks.len() - count(Layer::Sound),
count(Layer::Sound),
layers.srt.as_ref().map_or(String::new(), |s| format!(", {s} (captions to upload)")),
);
for n in layers.notes.iter().chain(&notes) {
said.push_str(&format!("\n note {n}"));
}
Ok(said)
}
/// `raea render ARGS` by this same program with only `env`'s layer settings: none of the person's own RAEA_LAYER or
/// RAEA_HIDE_MEDIA reaches a render it didn't ask for. Its failure is the export's.
pub fn render(args: &[String], env: &[(&str, &str)]) -> R<()> {
let exe = std::env::current_exe().map_err(|e| e.to_string())?;
let mut c = Command::new(exe);
c.arg("render").args(args).env_remove("RAEA_LAYER").env_remove("RAEA_HIDE_MEDIA");
for (k, v) in env {
c.env(k, v);
}
let out = c.output().map_err(|e| e.to_string())?;
if !out.status.success() {
let said = format!("{}{}", String::from_utf8_lossy(&out.stdout), String::from_utf8_lossy(&out.stderr));
return Err(format!("the render failed:\n{}", said.trim()));
}
Ok(())
}
/// What every layer's pass renders from: the edit, its composition flags, the export's folder, the movies' codec and
/// the rate.
struct Passes<'a> {
tsx: &'a Path,
comp: &'a [String],
dir: &'a Path,
codec: raea_io_alpha::Codec,
fps: f64,
}
impl Passes<'_> {
/// A layer's movie, rendered with RAEA_LAYER=`layer` into DIR/NAME.CODEC.mov (`name` the layer's own, or one of
/// many's), its frames in DIR/NAME.frames, removed unless `keep` (LA3a's test reads them); none when `also` says
/// its frames aren't worth a movie.
fn pass(&self, name: &str, layer: &str, keep: bool, also: impl FnOnce(&Path) -> bool) -> R<Option<(PathBuf, raea_io_alpha::Made)>> {
// the layer under the page is the bottom one, so it's drawn opaque: over 3D the page's background is the 3D's
// clear, which --alpha would clear to nothing
let alpha: &[String] = if layer == "under" { &[] } else { &["--alpha".to_string()] };
let frames = self.dir.join(format!("{name}.frames"));
let _ = std::fs::remove_dir_all(&frames);
let out = self.dir.join(format!("{name}.{}.mov", codec_ext(self.codec)));
let done = render(&[[self.tsx.display().to_string(), "-o".into(), format!("{}/", frames.display())].as_slice(), alpha, self.comp].concat(), &[("RAEA_LAYER", layer)])
.and_then(|_| if also(&frames) { raea_io_alpha::encode_dir(&frames, &out, self.codec, self.fps, 0.9).map(|m| Some((out, m))) } else { Ok(None) });
// the frames' render leaves its manifest beside them: the reference's is the export's
let _ = std::fs::remove_file(self.dir.join(format!("{name}.render.json")));
if !keep {
let _ = std::fs::remove_dir_all(&frames);
}
done
}
}
/// The export's name: --name's, else the edit's file stem.
fn named(args: &[String], edit: &Path) -> String {
flag(args, "--name").unwrap_or_else(|| edit.file_stem().map_or_else(|| "edit".to_string(), |s| s.to_string_lossy().into_owned()))
}
/// The export: the layers and layers.json in DIR, and what it says.
pub fn export(args: &[String]) -> R<(Layers, String)> {
let tsx = args.first().filter(|a| !a.starts_with('-')).ok_or(USAGE)?;
let tsx = dunce::canonicalize(PathBuf::from(tsx)).map_err(|e| format!("{tsx}: {e}"))?;
let edit_dir = tsx.parent().unwrap().to_path_buf();
let codec = raea_io_alpha::Codec::chosen(flag(args, "--alpha-codec").as_deref())?;
let name = named(args, &tsx);
let dir = flag(args, "-o").map_or_else(|| edit_dir.join("out/layers").join(&name), PathBuf::from);
std::fs::create_dir_all(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
let dir = dunce::canonicalize(&dir).map_err(|e| format!("{}: {e}", dir.display()))?;
let comp: Vec<String> = flag(args, "--composition").map(|c| vec!["--composition".into(), c]).unwrap_or_default();
// LA3a's test keeps each pass's frames to composite them back
let keep = std::env::var_os("RAEA_LAYERS_KEEP_FRAMES").is_some();
// 1. as it is: the reference render and its manifest
let (reference, manifest_path) = (dir.join("reference.mp4"), dir.join("render.json"));
render(&[[tsx.display().to_string(), "-o".into(), reference.display().to_string(), "--manifest".into(), manifest_path.display().to_string()].as_slice(), &comp].concat(), &[])?;
let manifest: Value = serde_json::from_str(&std::fs::read_to_string(&manifest_path).map_err(|e| e.to_string())?).map_err(|e| e.to_string())?;
let (w, h, fps) = (manifest["width"].as_u64().unwrap_or(0) as u32, manifest["height"].as_u64().unwrap_or(0) as u32, manifest["fps"].as_f64().unwrap_or(30.0));
let length = manifest["frames"].as_array().map_or(0, Vec::len) as i64;
let runs = plan::runs(&manifest, fps);
let said = srt::said(&manifest);
// 2-4. the layers' passes
// (its frames kept until the footage it covers is found)
let passes = Passes { tsx: &tsx, comp: &comp, dir: &dir, codec, fps };
let graphics = passes.pass("graphics", "graphics", true, |_| true)?;
// footage the graphics cover (opaque over most of its box at its middle frame) goes above them: the composition
// draws it under something it draws in front of it
let covered: Vec<bool> = runs.iter().map(|r| graphics.is_some() && opaque_over(&dir.join("graphics.frames"), r)).collect();
if !keep {
let _ = std::fs::remove_dir_all(dir.join("graphics.frames"));
}
// what's under the page: the backgrounds holding footage, and the 3D, which the whole page is drawn over
let under = if runs.is_empty() && manifest["has3d"] != true { None } else { passes.pass("under", "under", keep, lit)? };
let captions = if said.iter().any(|s| !s.is_empty()) { passes.pass("captions", "captions", keep, |_| true)? } else { None };
// what's behind each file shown as a picture in picture (its card), between it and the footage under it (LA2c):
// a pass for each such file, kept only where it's a picture in picture
let full = |r: &plan::Run| plan::full(&plan::shown(&r.bx, &r.clip), w as f64, h as f64);
let mut pips: Vec<String> = runs.iter().zip(&covered).filter(|(r, c)| !**c && !full(r)).map(|(r, _)| r.src.clone()).collect();
pips.dedup();
pips.sort();
pips.dedup();
let mut behind = Vec::new();
for (k, src) in pips.iter().enumerate() {
let made = passes.pass(&format!("behind-{}", k + 1), &format!("behind:{src}"), keep, |_| true)?;
let shown: Vec<(i64, i64)> = runs.iter().zip(&covered).filter(|(r, c)| !**c && !full(r) && r.src == *src).map(|(r, _)| (r.start, r.end)).collect();
behind.push((made, shown));
}
let srt_lines = srt::lines(&said);
let srt_name = (!srt_lines.is_empty()).then(|| format!("{name}.srt"));
if let Some(n) = &srt_name {
std::fs::write(dir.join(n), srt::write(&srt_lines, fps)).map_err(|e| e.to_string())?;
}
// the timeline, top to bottom
let mut files: Vec<File> = Vec::new();
let mut index: HashMap<PathBuf, usize> = HashMap::new();
let mut notes: Vec<String> = Vec::new();
let mut sounds = plan::sounds(&manifest);
let mut ids = Ids::default();
let (mut main, mut rest, mut over, mut linked) = (Vec::new(), Vec::new(), Vec::new(), Vec::new());
for (r, cov) in runs.iter().zip(&covered) {
let path = plan::resolve(&edit_dir, &r.src);
let f = add(&mut files, &mut index, &path, video)?;
let what = format!("{} (frames {}-{})", r.src, r.start, r.end - 1);
if r.fit == "fill" && files[f].width > 0 && ((r.bx[2] / r.bx[3].max(1.0)) - (files[f].width as f64 / files[f].height.max(1) as f64)).abs() > 0.01 * (files[f].width as f64 / files[f].height.max(1) as f64) {
notes.push(format!("{what}: stretched to its {:.0}x{:.0} box (object-fit: fill); an editor may fit it inside instead", r.bx[2], r.bx[3]));
}
if *cov {
notes.push(format!("{what}: raea draws over all of it from outside what holds it (a layer before it in the page); placed above the graphics, so their drawing over it is hidden in an editor"));
}
let keys = r.keys.iter().map(|k| model::Key { frame: k.frame - r.start, ..k.clone() }).collect();
let mut clip = Clip { r#box: Some(r.bx), fit: Some(r.fit.clone()), clip: r.clip, position: r.position, opacity: r.opacity, keys, speed: r.rate.unwrap_or(1.0).max(0.01), ..Clip::new(ids.next("v"), f, r.start, r.end - r.start, r.at) };
// its own sound: the manifest's sound clip of the same file over the same frames from the same time
if let Some(k) = sounds.iter().position(|c| plan::resolve(&edit_dir, &c.src) == path && (c.from - r.start).abs() <= 1 && (c.to - r.end).abs() <= 1 && (c.at - r.at).abs() <= 1.5 / fps) {
let s = sounds.remove(k);
let a = Clip { gain_db: s.gain_db, fade_in: s.fade_in, fade_out: s.fade_out, speed: s.rate, link: Some(clip.id.clone()), ..Clip::new(ids.next("a"), f, s.from, s.to - s.from, s.at) };
clip.link = Some(a.id.clone());
linked.push(a);
}
match (*cov, plan::full(&plan::shown(&r.bx, &r.clip), w as f64, h as f64)) {
(true, _) => over.push(clip),
(false, true) => main.push(clip),
(false, false) => rest.push(clip),
}
}
let mut tracks: Vec<Track> = Vec::new();
let movie = |files: &mut Vec<File>, made: &Option<(PathBuf, raea_io_alpha::Made)>, layer: Layer, name: &str, ids: &mut Ids, within: Option<&[(i64, i64)]>| -> Vec<Track> {
let Some((path, m)) = made else { return Vec::new() };
// where it draws something, and (behind a picture in picture) only within the frames given
let spans: Vec<(i64, i64)> = match within {
None => plan::spans(&m.drawn),
Some(w) => plan::spans(&m.drawn).into_iter().flat_map(|(a, b)| w.iter().map(move |&(c, d)| (a.max(c), b.min(d)))).filter(|(a, b)| a < b).collect(),
};
if spans.is_empty() {
let _ = std::fs::remove_file(path);
return Vec::new();
}
files.push(File { path: path.file_name().unwrap().to_string_lossy().into_owned(), kind: FileKind::Video, seconds: m.frames as f64 / fps, width: m.width, height: m.height, has_audio: false, channels: 2, sample_rate: 48_000, rotation: 0 });
let k = files.len() - 1;
let clips = spans.iter().map(|&(a, b)| Clip::new(ids.next(&name[..1]), k, a, b - a, a as f64 / fps)).collect();
model::lay(layer, name, clips)
};
tracks.extend(movie(&mut files, &captions, Layer::Captions, "captions", &mut ids, None));
tracks.extend(model::lay(Layer::Footage, "footage over", over));
tracks.extend(movie(&mut files, &graphics, Layer::Graphics, "graphics", &mut ids, None));
tracks.extend(model::lay(Layer::Footage, "picture in picture", rest));
// every file's backing on as few tracks as hold them, under the pictures in picture
let mut backing: Vec<Clip> = Vec::new();
for (made, shown) in &behind {
backing.extend(movie(&mut files, made, Layer::Backing, "behind picture in picture", &mut ids, Some(shown)).into_iter().flat_map(|t| t.clips));
}
backing.sort_by_key(|c| c.start);
tracks.extend(model::lay(Layer::Backing, "behind picture in picture", backing));
tracks.extend(model::lay(Layer::Footage, "footage", main));
tracks.extend(movie(&mut files, &under, Layer::Under, "under", &mut ids, None));
// a phone's take is stored turned and Resolve crops it mirrored (xml::Editor); ffprobe says how a file is turned
if !runs.is_empty() && Command::new("ffprobe").arg("-version").output().is_err() {
notes.push("ffprobe isn't installed, so how each take is turned wasn't read: all are taken as upright, and Resolve may crop a phone's take on the wrong side".to_string());
}
let mut audio = linked;
for c in sounds {
let f = add(&mut files, &mut index, &plan::resolve(&edit_dir, &c.src), sound)?;
let frames = plan::heard_frames(&c, files[f].seconds, fps);
if frames <= 0 {
continue;
}
audio.push(Clip { gain_db: c.gain_db, fade_in: c.fade_in, fade_out: c.fade_out, speed: c.rate, ..Clip::new(ids.next("a"), f, c.from, frames, c.at) });
}
audio.sort_by_key(|c| c.start);
// the first sound track is the top one, so later ones are listed after it (lay lists the last laid first)
let mut sound_tracks = model::lay(Layer::Sound, "sound", audio);
sound_tracks.reverse();
tracks.extend(sound_tracks);
let notes_made = manifest["sounds"]["notes"].as_array().map_or(0, Vec::len);
if notes_made > 0 {
notes.push(format!("the Tone graph's music ({notes_made} notes) has no file to place: it is in the reference render's sound"));
}
let layers = Layers { version: model::VERSION, name: name.clone(), width: w, height: h, fps, frames: length, reference: "reference.mp4".into(), srt: srt_name.clone(), files, tracks, notes };
let json = serde_json::to_string_pretty(&layers).map_err(|e| e.to_string())?;
std::fs::write(dir.join("layers.json"), json + "\n").map_err(|e| e.to_string())?;
let count = |l: Layer| layers.tracks.iter().filter(|t| t.layer == l).map(|t| t.clips.len()).sum::<usize>();
let mut said = format!(
"APPLIED layers \"{name}\" at {}: {} tracks; {}, {}, {}{}, {}, {}{}; {:.2} s at {fps} fps, {w}x{h}",
dir.display(),
layers.tracks.len(),
many(count(Layer::Captions), "captions clip"),
many(count(Layer::Graphics), "graphics clip"),
many(count(Layer::Footage), "footage clip"),
Some(count(Layer::Backing)).filter(|&k| k > 0).map_or(String::new(), |k| format!(", {} behind a picture in picture", many(k, "clip"))),
if count(Layer::Under) == 1 { "1 clip under the footage".to_string() } else { format!("{} clips under the footage", count(Layer::Under)) },
many(count(Layer::Sound), "sound"),
srt_name.as_ref().map_or(String::new(), |n| format!("; {} in {n}", many(srt_lines.len(), "caption line"))),
length as f64 / fps,
);
for n in &layers.notes {
said.push_str(&format!("\n note {n}"));
}
Ok((layers, said))
}
/// Clip ids by kind: v1, v2... for footage, a1... for sounds, c1, g1, u1... for the captions', graphics' and under's.
#[derive(Default)]
struct Ids(HashMap<String, usize>);
impl Ids {
fn next(&mut self, kind: &str) -> String {
let n = self.0.entry(kind.to_string()).or_default();
*n += 1;
format!("{kind}{n}")
}
}
/// "1 clip", "4 clips"
/// "1 clip", "3 clips".
pub fn many(k: usize, what: &str) -> String {
if k == 1 { format!("1 {what}") } else { format!("{k} {what}s") }
}
/// A file's place in `files`, probed the first time it's named.
fn add(files: &mut Vec<File>, index: &mut HashMap<PathBuf, usize>, p: &Path, probe: fn(&Path) -> R<File>) -> R<usize> {
if let Some(i) = index.get(p) {
return Ok(*i);
}
files.push(probe(p)?);
index.insert(p.to_path_buf(), files.len() - 1);
Ok(files.len() - 1)
}
/// A video file: its upright size and length from the first of raea's media backends that opens it, and whether a short
/// window of its sound decodes to samples.
pub fn video(path: &Path) -> R<File> {
let mut why = Vec::new();
for b in raea_io_media::preferred() {
match b.open_video(path) {
Ok(d) => {
let i = d.info();
let (has_audio, channels, sample_rate) = heard(path);
// one whose rotation can't be read is taken as upright (export notes it: only Resolve's crop turns on it)
let rotation = rotation(path).unwrap_or(0);
return Ok(File { path: path.display().to_string(), kind: FileKind::Video, seconds: i.duration, width: i.width, height: i.height, has_audio, channels, sample_rate, rotation });
}
Err(e) => why.push(format!("{}: {e}", b.name())),
}
}
Err(format!("{} didn't open as video ({})", path.display(), why.join("; ")))
}
/// A sound file: its length from its container.
pub fn sound(path: &Path) -> R<File> {
let seconds = raea_io_media::probe_seconds(path).ok_or_else(|| format!("{}: no sound length", path.display()))?;
let (_, channels, sample_rate) = heard(path);
Ok(File { path: path.display().to_string(), kind: FileKind::Audio, seconds, width: 0, height: 0, has_audio: true, channels, sample_rate, rotation: 0 })
}
/// Whether a short window of a file's sound decodes to samples, and its channels and sample rate (stereo at 48 kHz
/// when it has none to read).
/// How far a video's pictures are turned to stand upright, from its container's display matrix (ffprobe's rotation,
/// counter-clockwise), as 0, 90, 180 or 270 (to the nearest quarter turn); None when ffprobe can't say (it isn't there).
fn rotation(path: &Path) -> Option<u32> {
let out = Command::new("ffprobe").args(["-v", "error", "-select_streams", "v:0", "-show_entries", "stream_side_data=rotation", "-of", "csv=p=0"]).arg(path).output().ok().filter(|o| o.status.success())?;
let deg = String::from_utf8_lossy(&out.stdout).lines().find_map(|l| l.trim().parse::<f64>().ok()).unwrap_or(0.0);
Some(((deg / 90.0).round() as i64).rem_euclid(4) as u32 * 90)
}
fn heard(path: &Path) -> (bool, u32, u32) {
match raea_io_media::decode_audio_window(path, 0.0, 0.05) {
Ok(a) if a.len() > 0 => (true, (a.channels.len() as u32).max(1), a.rate),
_ => (false, 2, 48_000),
}
}
pub fn codec_ext(c: raea_io_alpha::Codec) -> &'static str {
match c {
raea_io_alpha::Codec::ProRes => "prores",
raea_io_alpha::Codec::Hevc => "hevc",
raea_io_alpha::Codec::Rle => "rle",
raea_io_alpha::Codec::Png => "png",
}
}
/// Whether the graphics are opaque over 90% of what shows of a run at its middle frame (a grid of points inside it).
fn opaque_over(frames: &Path, r: &plan::Run) -> bool {
let mid = (r.start + r.end - 1) / 2;
let Ok((px, w, h)) = raea_io_alpha::read_png(&frames.join(format!("frame-{mid:05}.png"))) else { return false };
let k = r.at(mid);
let [bx, by, bw, bh] = plan::shown(&k.r#box, &k.clip);
let (mut n, mut opaque) = (0, 0);
for j in 0..16 {
for i in 0..16 {
let x = (bx + bw * (i as f64 + 0.5) / 16.0) as i64;
let y = (by + bh * (j as f64 + 0.5) / 16.0) as i64;
if x < 0 || y < 0 || x >= w as i64 || y >= h as i64 {
continue;
}
n += 1;
opaque += usize::from(px[((y as usize) * w as usize + x as usize) * 4 + 3] >= 250);
}
}
n > 0 && opaque * 10 >= n * 9
}
/// Whether any frame in `frames` draws anything but black, at any alpha (a grid of points on each).
pub fn lit(frames: &Path) -> bool {
raea_io_alpha::frames_in(frames).iter().any(|p| {
let Ok((px, w, h)) = raea_io_alpha::read_png(p) else { return true };
(0..32).any(|j| {
(0..32).any(|i| {
let (x, y) = ((w as usize * (2 * i + 1)) / 64, (h as usize * (2 * j + 1)) / 64);
let k = (y * w as usize + x) * 4;
px[k + 3] >= 8 && px[k..k + 3].iter().any(|&c| c >= 8)
})
})
})
}
Loaded 100 of 1391 files, more files were not shown because too many files have changed in this diff. Show more