mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f6113845 | ||
|
|
1ff507df80 | ||
|
|
5cc53609a8 | ||
|
|
b4aede8ae6 | ||
|
|
3df38e170a | ||
|
|
b593ebb070 | ||
|
|
9a6cd12d5f | ||
|
|
0b8171cdae | ||
|
|
2c54a94c00 | ||
|
|
6ee015071d | ||
|
|
8d44a1e865 | ||
|
|
c93042ff7f | ||
|
|
3db55f345d | ||
|
|
43e35b2302 | ||
|
|
9c5ab64141 | ||
|
|
620cfe0744 | ||
|
|
de4d619270 | ||
|
|
e946a5a0d7 | ||
|
|
6c390a4a17 | ||
|
|
ab2a085a05 | ||
|
|
b7f796aa5e | ||
|
|
e8ce27fd62 | ||
|
|
9202d88e69 | ||
|
|
2a5bb19904 | ||
|
|
09c2df6e8c | ||
|
|
2a98bbcb03 | ||
|
|
8443ecf2e7 | ||
|
|
4a8c5c04ad | ||
|
|
57e0737edd | ||
|
|
75c6e74d6d | ||
|
|
4b1cb9ec9a | ||
|
|
db3cbfcaf5 | ||
|
|
25afb7cbf5 | ||
|
|
1046ee9a83 | ||
|
|
dc2e7a56bb | ||
|
|
977ec312aa | ||
|
|
9aee93e518 | ||
|
|
32dcec11b9 | ||
|
|
3a646fa4bb | ||
|
|
28f4c2289b | ||
|
|
80fbde3c58 | ||
|
|
c30bcfbbef | ||
|
|
3ad88f635a | ||
|
|
3cd7f72b4b | ||
|
|
2262e1cc7d | ||
|
|
4f354e97fc | ||
|
|
1afb2de58d | ||
|
|
b0cd52fd85 | ||
|
|
b5425278b3 | ||
|
|
373b47b964 | ||
|
|
2b9a95366a | ||
|
|
4a27753595 | ||
|
|
ab0fc62c4c | ||
|
|
0cf78fb053 | ||
|
|
6d8a15ac55 | ||
|
|
cdebceb9d9 | ||
|
|
523fd30929 | ||
|
|
688e99c971 | ||
|
|
71b354007f | ||
|
|
8883c30c53 | ||
|
|
9586aa9689 | ||
|
|
760aea017d | ||
|
|
1c004cc225 | ||
|
|
a0f85c9023 | ||
|
|
fc32762987 | ||
|
|
9365faa43b | ||
|
|
7c32e7cec9 | ||
|
|
e8ee46d96e | ||
|
|
4b1686f254 | ||
|
|
fbcc03fc38 | ||
|
|
14180f3dfe | ||
|
|
6665a2e5a8 | ||
|
|
80d3edb1de | ||
|
|
20290ff51c | ||
|
|
2a8ea0b81b | ||
|
|
f3bc3db45a | ||
|
|
3f37f7c2a2 | ||
|
|
fcd055cca3 | ||
|
|
ecef2fee13 | ||
|
|
10f0c61354 | ||
|
|
f2372ad82b | ||
|
|
b2f2f2af3d | ||
|
|
190ced1d1f | ||
|
|
3e391e2afa | ||
|
|
ca825d79ae | ||
|
|
68f70eb1e6 | ||
|
|
e67910028a | ||
|
|
6a2646b5a5 | ||
|
|
f1292b4db0 | ||
|
|
53b5da60b3 | ||
|
|
6ef6c573fd | ||
|
|
dbe00072b6 | ||
|
|
f2429a0b97 | ||
|
|
66f8c17a1d | ||
|
|
80d07fda07 | ||
|
|
47a93b740a | ||
|
|
24fadef05e | ||
|
|
05356f6b70 | ||
|
|
8f49748322 | ||
|
|
186098d162 | ||
|
|
ae905b9fd1 | ||
|
|
4edb80b80d | ||
|
|
840de67569 | ||
|
|
f7b1cdad92 | ||
|
|
eb43664245 | ||
|
|
5fc163ba9f | ||
|
|
2598a75942 | ||
|
|
8a333c02c4 | ||
|
|
0226bbb21b | ||
|
|
744c5a2a1f | ||
|
|
db9dcda0a8 | ||
|
|
090cfeff1a | ||
|
|
4d79a3f12f | ||
|
|
fef9a1bd38 | ||
|
|
371751d5ed | ||
|
|
33a803733b | ||
|
|
7d893bb612 | ||
|
|
34339ba0d9 | ||
|
|
41780e9784 | ||
|
|
f5f7b72912 | ||
|
|
af1a2c4199 | ||
|
|
4fc9d5251b | ||
|
|
9055f7273f | ||
|
|
e7f16a86bc | ||
|
|
1f02317e87 | ||
|
|
1d04a18d54 | ||
|
|
9dbb9b5400 | ||
|
|
ede2903d4a | ||
|
|
415391a9e1 | ||
|
|
fc3bba9b1a | ||
|
|
8df71aceba | ||
|
|
12f0eb09a0 | ||
|
|
dc4558dc7a | ||
|
|
5b52eb4aed | ||
|
|
e2b41e8df6 | ||
|
|
bfbfc91d40 | ||
|
|
7af167433d | ||
|
|
52ccddd1df | ||
|
|
fcd8105d93 | ||
|
|
4259cd9c01 | ||
|
|
d88d19e149 | ||
|
|
5c788473f7 | ||
|
|
8cfb2241c2 | ||
|
|
2f89374c47 | ||
|
|
04b06c500b | ||
|
|
7ef89d4c13 | ||
|
|
11931d4958 | ||
|
|
4110989ed4 | ||
|
|
878cfe1dac | ||
|
|
dc8038add1 | ||
|
|
f9b9aeff95 | ||
|
|
0076952a6b | ||
|
|
3525e74875 | ||
|
|
c3bc7d7bc7 | ||
|
|
984be1686a | ||
|
|
016ef5347e | ||
|
|
ccf6eda50b | ||
|
|
102352c44d | ||
|
|
face0fe8bc | ||
|
|
159fcbdb94 | ||
|
|
1b22805edc | ||
|
|
250b8fed84 | ||
|
|
19ff72740c | ||
|
|
712b1c73e9 | ||
|
|
406a1417fa | ||
|
|
ec33701acf | ||
|
|
67f33b2460 | ||
|
|
7551eb17b9 | ||
|
|
c735bd06a2 | ||
|
|
c0f1c3786c | ||
|
|
6d49104881 | ||
|
|
2ebe989c05 | ||
|
|
d2f6ec0831 | ||
|
|
d991b4e9d2 | ||
|
|
c53605cd51 | ||
|
|
e9b22ad3eb | ||
|
|
ef46cab89f | ||
|
|
1dee5992e5 | ||
|
|
3073fc5739 | ||
|
|
914fabd377 | ||
|
|
19c877037a | ||
|
|
f8dd70c80a | ||
|
|
bdb77110de | ||
|
|
4f589c5597 | ||
|
|
a57c2209d2 | ||
|
|
87aa6ac0a1 | ||
|
|
73af431001 | ||
|
|
4f6bfe82d6 | ||
|
|
3bbd1469ac | ||
|
|
228984a74c | ||
|
|
56c71ed264 | ||
|
|
af8eb9ffbd | ||
|
|
ee91bf13a8 | ||
|
|
4a339cf0e3 | ||
|
|
0722ce3ae4 | ||
|
|
2d9d1cfd93 | ||
|
|
1bf0c2075a | ||
|
|
a84aedca3d | ||
|
|
d77c46ab60 | ||
|
|
24b456ecd0 | ||
|
|
d13ab74d9a | ||
|
|
8e86f0a3ba | ||
|
|
104763b1e3 | ||
|
|
0f4c6626e8 | ||
|
|
9a236c1194 | ||
|
|
3f7945b7a6 | ||
|
|
937387c3db | ||
|
|
13886ff3c5 | ||
|
|
7ac71240db | ||
|
|
2686a55190 | ||
|
|
8caedfbaa1 | ||
|
|
31876c7d1c | ||
|
|
76a11076ea | ||
|
|
a904a86429 | ||
|
|
32587e0b9d | ||
|
|
d37f835bfd | ||
|
|
b305638248 | ||
|
|
2f5ad766d7 | ||
|
|
20ccabb8dd | ||
|
|
6df5edbde0 | ||
|
|
e80bde56c2 | ||
|
|
86cf4fe12e | ||
|
|
b24a4537c0 | ||
|
|
c5d3f83c79 | ||
|
|
ef747f9b24 | ||
|
|
578bc1d159 | ||
|
|
c135130ccb | ||
|
|
ffb56a8f09 | ||
|
|
761e6b98f9 | ||
|
|
4a0dacc29b | ||
|
|
38db0f2f23 | ||
|
|
03de032a28 | ||
|
|
e24d71b3b9 | ||
|
|
55a95b4d17 | ||
|
|
f3f7207001 | ||
|
|
ee8edf43b1 | ||
|
|
f085ac07da | ||
|
|
f715c40319 | ||
|
|
705504ddf1 | ||
|
|
604064e720 | ||
|
|
f6b3188d9f | ||
|
|
853183e2f4 | ||
|
|
a68b96cf89 | ||
|
|
613645ffc6 | ||
|
|
986fae3c62 | ||
|
|
e4add11c80 | ||
|
|
c4fa90de4c | ||
|
|
ad2e7e1cd4 | ||
|
|
d870159c46 | ||
|
|
4d7fa914cc | ||
|
|
a4bb6e5c1d | ||
|
|
5f65114ce5 | ||
|
|
87bfda4ed2 | ||
|
|
3b61818eb9 | ||
|
|
1680860ff4 | ||
|
|
74ce0ff737 | ||
|
|
90891cc86f | ||
|
|
bb7dc3b79f | ||
|
|
d6d7a520a7 | ||
|
|
c05dfc946e | ||
|
|
c3b2108412 | ||
|
|
2fe9f13908 | ||
|
|
1c93300361 | ||
|
|
ef5761d300 | ||
|
|
37652ae571 | ||
|
|
0ed836095e | ||
|
|
b1b47b7cfa | ||
|
|
c939b27aee | ||
|
|
0ef7287fde | ||
|
|
fce94e630b | ||
|
|
2a38cbc2df | ||
|
|
2ce68890b8 | ||
|
|
4c392f60d6 | ||
|
|
b4e8310f1f | ||
|
|
9cffd0bf0a | ||
|
|
d190585622 | ||
|
|
912c957c9f | ||
|
|
2b9f1ad862 | ||
|
|
b1bfc9ba41 | ||
|
|
d5b8b9ab35 | ||
|
|
a10d64ab75 | ||
|
|
1f3a058ba0 | ||
|
|
c4550ad6ba | ||
|
|
afe2150d19 | ||
|
|
a77d68ef93 | ||
|
|
fad2dbcbf4 | ||
|
|
f9129e758c | ||
|
|
b95a9fab63 | ||
|
|
af752e3a27 | ||
|
|
85d331898f | ||
|
|
8e5f1d449c | ||
|
|
daa81ca944 | ||
|
|
03e3b77578 | ||
|
|
c486a7fe16 | ||
|
|
78cb452725 | ||
|
|
29a3763ecf | ||
|
|
e4a0552663 | ||
|
|
08c70a8318 | ||
|
|
d3762acbf1 | ||
|
|
d0e99b0d46 | ||
|
|
494b395442 | ||
|
|
fa884594a6 | ||
|
|
5b93a70f70 | ||
|
|
a36df13992 | ||
|
|
1190ab6953 | ||
|
|
5ab9285ed3 | ||
|
|
3185fa5adb | ||
|
|
9f553d6ecc | ||
|
|
acb4aa404d | ||
|
|
26d094c341 | ||
|
|
773047de9e | ||
|
|
4a8ad49d60 | ||
|
|
a393b366ac | ||
|
|
dc148cd3f7 | ||
|
|
48c027313d | ||
|
|
b41c609a02 | ||
|
|
90975148a0 | ||
|
|
e658ea89ea | ||
|
|
3fc0c43af0 | ||
|
|
173e397113 | ||
|
|
17fa0e5f31 | ||
|
|
8df1c72a44 | ||
|
|
e3f4c6980e | ||
|
|
7ed8faa7a6 | ||
|
|
283b1ffb87 | ||
|
|
e060c09fe2 | ||
|
|
9a93709831 | ||
|
|
ca0a14e04c | ||
|
|
8fefa2922d | ||
|
|
96f7e64580 | ||
|
|
d79c0b8cef | ||
|
|
81cf2e0386 | ||
|
|
eed69c7bb2 | ||
|
|
271376b898 | ||
|
|
e31056b6ad | ||
|
|
0b7a4203b8 | ||
|
|
95725896a2 | ||
|
|
b476ebb82b | ||
|
|
fd3a75ce72 | ||
|
|
f14232a52e | ||
|
|
43cc233f99 | ||
|
|
31f7961287 | ||
|
|
1918b36f9e | ||
|
|
387f91017c | ||
|
|
d8b51396fa | ||
|
|
0a7c064b05 | ||
|
|
3620aa1def | ||
|
|
b938833097 | ||
|
|
75c3b18c22 | ||
|
|
01076723f4 | ||
|
|
bd670d9040 | ||
|
|
5c7dac41c2 | ||
|
|
f732061d9d | ||
|
|
d7e3d8b2b2 | ||
|
|
c4d3900d68 | ||
|
|
f130f35870 | ||
|
|
2b7574de39 | ||
|
|
bbd658263e | ||
|
|
91731fab14 | ||
|
|
f36ffb903f | ||
|
|
0173108f72 | ||
|
|
bb4402e45a | ||
|
|
661adee396 | ||
|
|
73c5c93e9b | ||
|
|
2427d7c9ee | ||
|
|
e3b048e2d9 | ||
|
|
08f6f621d2 | ||
|
|
7caf1bb596 | ||
|
|
43bfbad61f | ||
|
|
beb4ce1200 | ||
|
|
7bfa7f392c | ||
|
|
47cf338cd6 | ||
|
|
b2a52f6cc1 | ||
|
|
c78ded29e8 | ||
|
|
1c3cb953bd | ||
|
|
53a5cc9ca7 | ||
|
|
3b670e79a5 | ||
|
|
530ff8e3de | ||
|
|
f2d0e0335c | ||
|
|
b4fa9ae676 | ||
|
|
5aa6c4cd36 | ||
|
|
ad8187aefd | ||
|
|
1bfd0388b0 | ||
|
|
cbd7649e02 | ||
|
|
fc83cf7446 | ||
|
|
2bbf0179fc | ||
|
|
dcd1107a9f | ||
|
|
bf07a473ae | ||
|
|
f9b6f22ecf | ||
|
|
fcd6e12c03 | ||
|
|
d7a755c08b | ||
|
|
b776edd026 | ||
|
|
9a289e072c | ||
|
|
4bc503d81d | ||
|
|
4e252226a6 | ||
|
|
ca184a08c9 | ||
|
|
cceec65c38 | ||
|
|
fac78b331b | ||
|
|
ae49b9f3c9 | ||
|
|
edf25e43c0 | ||
|
|
4a563b9cf6 | ||
|
|
ea5e9015e7 | ||
|
|
d8c392b69a | ||
|
|
035783ae0c | ||
|
|
08a3904127 | ||
|
|
cae6d2201c | ||
|
|
b8d38aa2c0 | ||
|
|
d685762382 | ||
|
|
c96de52402 | ||
|
|
b4e6f54d55 | ||
|
|
d145985058 | ||
|
|
03685d6139 | ||
|
|
620c796095 | ||
|
|
37846080a7 | ||
|
|
e24034ee10 | ||
|
|
9f4990cd90 | ||
|
|
7026280df3 | ||
|
|
df9d1d11d5 | ||
|
|
e60a8bc5fe | ||
|
|
1496780fa4 | ||
|
|
2cb2136348 | ||
|
|
e368a5dbcb | ||
|
|
e3dfcb96d1 | ||
|
|
f845ef0add | ||
|
|
cb01f542c0 | ||
|
|
054738329d | ||
|
|
e85de83289 | ||
|
|
06090e06cd | ||
|
|
7729997d96 | ||
|
|
8818eaa2ec | ||
|
|
b715d70366 | ||
|
|
2c6132a460 |
No files matched your search
+108
-11
@@ -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
|
||||
@@ -177,8 +221,13 @@ jobs:
|
||||
# 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:
|
||||
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 +244,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,14 +283,47 @@ 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:
|
||||
|
||||
Generated
+181
-2
@@ -11460,6 +11460,7 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32b0446e98cf4a784cc7a0177715ff317eeaa8463841c616cfc78aa4f953c4ea"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"objc2 0.6.5",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
@@ -11550,6 +11551,20 @@ dependencies = [
|
||||
"objc2-metal 0.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-photos"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6ea9a706f18e32cf8a0723e99855af4f135282891e07259301bae9135ae3872"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"block2 0.6.2",
|
||||
"objc2 0.6.5",
|
||||
"objc2-app-kit 0.3.2",
|
||||
"objc2-core-foundation",
|
||||
"objc2-foundation 0.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-quartz-core"
|
||||
version = "0.2.2"
|
||||
@@ -11577,6 +11592,20 @@ dependencies = [
|
||||
"objc2-metal 0.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-quick-look-thumbnailing"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac8e00da1ca87ffe3ea8d20981026f013df91072a140432f0f88da9a356d9b3c"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"block2 0.6.2",
|
||||
"objc2 0.6.5",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
"objc2-foundation 0.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-symbols"
|
||||
version = "0.2.2"
|
||||
@@ -13731,6 +13760,7 @@ name = "raea-app-check"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"raea-app-check-flash",
|
||||
"raea-app-check-inbox",
|
||||
"raea-core-brief",
|
||||
"raea-core-facts",
|
||||
"raea-io-ffmpeg",
|
||||
@@ -13743,6 +13773,14 @@ dependencies = [
|
||||
name = "raea-app-check-flash"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "raea-app-check-inbox"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"raea-io-home",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-app-ci"
|
||||
version = "0.1.0"
|
||||
@@ -13937,6 +13975,7 @@ dependencies = [
|
||||
"raea-io-media",
|
||||
"raea-runtime-bundle",
|
||||
"raea-runtime-export",
|
||||
"raea-sys-kimodo",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
@@ -14195,6 +14234,7 @@ dependencies = [
|
||||
"raea-runtime-plugins",
|
||||
"raea-runtime-react",
|
||||
"raea-runtime-sound",
|
||||
"raea-sys-index",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -14349,6 +14389,15 @@ dependencies = [
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-hands-audit"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam 0.33.12",
|
||||
"raea-sys-body",
|
||||
"raea-sys-grab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-io-alpha"
|
||||
version = "0.1.0"
|
||||
@@ -14459,10 +14508,9 @@ name = "raea-io-gen"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"image",
|
||||
"raea-core-facts",
|
||||
"raea-core-meshcheck",
|
||||
"raea-io-gen-comfy",
|
||||
"raea-io-gen-core",
|
||||
"raea-io-gen-fit",
|
||||
"raea-io-home",
|
||||
"serde_json",
|
||||
]
|
||||
@@ -14484,6 +14532,16 @@ dependencies = [
|
||||
"sha2 0.10.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-io-gen-fit"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"raea-core-facts",
|
||||
"raea-core-meshcheck",
|
||||
"raea-io-gen-core",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-io-home"
|
||||
version = "0.1.0"
|
||||
@@ -14673,10 +14731,12 @@ dependencies = [
|
||||
"blitz-traits",
|
||||
"image",
|
||||
"keyboard-types",
|
||||
"raea-io-home",
|
||||
"raea-io-media",
|
||||
"raea-io-net-calls",
|
||||
"raea-io-os",
|
||||
"raea-page",
|
||||
"raea-page-sound",
|
||||
"raea-page-stage",
|
||||
"raea-page-window",
|
||||
"raea-rune-slots",
|
||||
@@ -14693,6 +14753,16 @@ dependencies = [
|
||||
"tiny_http",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-page-sound"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"raea-runtime-js",
|
||||
"raea-sys-mix",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-page-stage"
|
||||
version = "0.1.0"
|
||||
@@ -14767,6 +14837,7 @@ dependencies = [
|
||||
"raea-sys-framepass",
|
||||
"raea-sys-grass",
|
||||
"raea-sys-grid",
|
||||
"raea-sys-hold",
|
||||
"raea-sys-look",
|
||||
"raea-sys-matchmove",
|
||||
"raea-sys-material",
|
||||
@@ -14776,6 +14847,7 @@ dependencies = [
|
||||
"raea-sys-phase",
|
||||
"raea-sys-post",
|
||||
"raea-sys-procmat",
|
||||
"raea-sys-rendermap",
|
||||
"raea-sys-rt",
|
||||
"raea-sys-sampler",
|
||||
"raea-sys-screen",
|
||||
@@ -14784,6 +14856,7 @@ dependencies = [
|
||||
"raea-sys-sprite",
|
||||
"raea-sys-text3d",
|
||||
"raea-sys-three-shader",
|
||||
"raea-sys-viewbox",
|
||||
"raea-sys-volume",
|
||||
"raea-sys-wear",
|
||||
"serde_json",
|
||||
@@ -14917,6 +14990,24 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-runtime-appscreen"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"blitz-traits",
|
||||
"keyboard-types",
|
||||
"raea-io-home",
|
||||
"raea-page",
|
||||
"raea-runtime-bundle",
|
||||
"raea-runtime-dom",
|
||||
"raea-runtime-js",
|
||||
"raea-runtime-jsengine",
|
||||
"raea-sys-fonts",
|
||||
"raea-sys-page",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-runtime-bake"
|
||||
version = "0.1.0"
|
||||
@@ -14974,6 +15065,7 @@ dependencies = [
|
||||
"raea-native",
|
||||
"raea-runtime-plugins",
|
||||
"raea-sys-fonts",
|
||||
"raea-sys-grab",
|
||||
"raea-sys-mix",
|
||||
"raea-sys-ml",
|
||||
"raea-sys-speech",
|
||||
@@ -15178,6 +15270,7 @@ dependencies = [
|
||||
"raea-runtime-react",
|
||||
"raea-runtime-sound",
|
||||
"raea-sys-frame",
|
||||
"raea-sys-hold",
|
||||
"raea-sys-mix",
|
||||
"serde_json",
|
||||
"twox-hash",
|
||||
@@ -15210,6 +15303,7 @@ dependencies = [
|
||||
"raea-io-net",
|
||||
"raea-page",
|
||||
"raea-render",
|
||||
"raea-runtime-appscreen",
|
||||
"raea-runtime-input",
|
||||
"raea-runtime-react",
|
||||
"raea-runtime-twins",
|
||||
@@ -15492,6 +15586,14 @@ dependencies = [
|
||||
"simba",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-body"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam 0.33.12",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-canvas"
|
||||
version = "0.1.0"
|
||||
@@ -15699,6 +15801,15 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-grab"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"glam 0.33.12",
|
||||
"raea-sys-body",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-grass"
|
||||
version = "0.1.0"
|
||||
@@ -15719,6 +15830,14 @@ dependencies = [
|
||||
"raea-sys-frame",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-hold"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"raea-sys-frame",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-image"
|
||||
version = "0.1.0"
|
||||
@@ -15726,6 +15845,36 @@ dependencies = [
|
||||
"bevy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-index"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"block2 0.6.2",
|
||||
"half",
|
||||
"objc2 0.6.5",
|
||||
"objc2-app-kit 0.3.2",
|
||||
"objc2-av-foundation",
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-graphics",
|
||||
"objc2-core-media",
|
||||
"objc2-core-ml",
|
||||
"objc2-core-video",
|
||||
"objc2-foundation 0.3.2",
|
||||
"objc2-image-io",
|
||||
"objc2-photos",
|
||||
"objc2-quick-look-thumbnailing",
|
||||
"ort",
|
||||
"raea-io-home",
|
||||
"raea-sys-ml",
|
||||
"rayon",
|
||||
"rusqlite",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokenizers",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-k"
|
||||
version = "0.1.0"
|
||||
@@ -15738,6 +15887,18 @@ dependencies = [
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-kimodo"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"mlx-rs",
|
||||
"raea-sys-ml",
|
||||
"raea-sys-mlx",
|
||||
"serde_json",
|
||||
"tokenizers",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-layers"
|
||||
version = "0.1.0"
|
||||
@@ -15967,6 +16128,14 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-rendermap"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"raea-sys-frame",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-rt"
|
||||
version = "0.1.0"
|
||||
@@ -16086,8 +16255,10 @@ dependencies = [
|
||||
"bevy",
|
||||
"image",
|
||||
"naga",
|
||||
"raea-sys-frame",
|
||||
"raea-sys-material",
|
||||
"raea-sys-sampler",
|
||||
"raea-sys-shader",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
@@ -16108,6 +16279,14 @@ dependencies = [
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-viewbox"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"raea-sys-frame",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "raea-sys-vision"
|
||||
version = "0.1.0"
|
||||
|
||||
+12
@@ -53,6 +53,7 @@ members = [
|
||||
"engine/rune/js",
|
||||
"engine/rune/layer",
|
||||
"engine/rune/slots",
|
||||
"engine/page/sound",
|
||||
"engine/page/stage",
|
||||
"engine/page/window",
|
||||
"io/trace",
|
||||
@@ -62,6 +63,7 @@ members = [
|
||||
"io/gen",
|
||||
"io/gen-comfy",
|
||||
"io/gen-core",
|
||||
"io/gen-fit",
|
||||
"io/home",
|
||||
"io/soft",
|
||||
"io/av1",
|
||||
@@ -79,10 +81,12 @@ members = [
|
||||
"systems/mix",
|
||||
"systems/ml",
|
||||
"systems/mlx",
|
||||
"systems/kimodo",
|
||||
"systems/speech",
|
||||
"systems/layout",
|
||||
"systems/vision",
|
||||
"systems/columns",
|
||||
"systems/index",
|
||||
"systems/fingerprint",
|
||||
"systems/fingerprint-use",
|
||||
"systems/fingerprint-things",
|
||||
@@ -103,6 +107,9 @@ members = [
|
||||
"systems/page-net",
|
||||
"systems/page-ops",
|
||||
"systems/frame",
|
||||
"systems/hold",
|
||||
"systems/body",
|
||||
"systems/grab",
|
||||
"systems/layers",
|
||||
"systems/splat",
|
||||
"systems/sprite",
|
||||
@@ -113,6 +120,8 @@ members = [
|
||||
"systems/screen",
|
||||
"systems/matchmove",
|
||||
"systems/grid",
|
||||
"systems/viewbox",
|
||||
"systems/rendermap",
|
||||
"systems/meshseq",
|
||||
"systems/environment",
|
||||
"systems/look",
|
||||
@@ -159,6 +168,7 @@ members = [
|
||||
"runtime/export",
|
||||
"runtime/live",
|
||||
"runtime/page",
|
||||
"runtime/appscreen",
|
||||
"runtime/sound",
|
||||
"runtime/look",
|
||||
"runtime/scene",
|
||||
@@ -166,6 +176,7 @@ members = [
|
||||
"runtime/shared",
|
||||
"apps/check",
|
||||
"apps/check/flash",
|
||||
"apps/check/inbox",
|
||||
"apps/direction",
|
||||
"apps/notes",
|
||||
"apps/fingerprint",
|
||||
@@ -184,6 +195,7 @@ members = [
|
||||
"apps/capcut",
|
||||
"apps/play",
|
||||
"tools/sdk-props",
|
||||
"tools/hands-audit",
|
||||
]
|
||||
exclude = [
|
||||
"engine/sandbox/rtools",
|
||||
|
||||
@@ -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,23 +0,0 @@
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
@@ -175,7 +175,6 @@ LICENSES/<crate>-<version>/.
|
||||
deterministic-hash 1.0.2: MIT
|
||||
disjoint-sets 0.4.2: MIT/Apache-2.0
|
||||
dot_vox 5.2.0: MIT
|
||||
dyn-clone 1.0.20: MIT OR Apache-2.0
|
||||
dyn-eq 0.1.3: MPL-2.0
|
||||
dyn-hash 1.0.0: MIT OR Apache-2.0
|
||||
earcut 0.4.5: ISC
|
||||
|
||||
@@ -19,4 +19,6 @@ raea-io-ffmpeg = { path = "../../io/ffmpeg" }
|
||||
raea-sys-measure = { path = "../../systems/measure" }
|
||||
# the flashing screen (WCAG 2.3.1), split out to keep this crate small
|
||||
raea-app-check-flash = { path = "flash" }
|
||||
# what the person sent from the raea app, handed to the agent (split out to keep this crate small)
|
||||
raea-app-check-inbox = { path = "inbox" }
|
||||
serde_json = "1"
|
||||
@@ -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" }
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
+14
-3
@@ -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,7 +145,15 @@ 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 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 = std::env::var("HOME").unwrap_or_default();
|
||||
let files = opened_media(cmd);
|
||||
let key = format!("{}\n{}\n{cmd}", v["session_id"].as_str().unwrap_or(""), v["cwd"].as_str().unwrap_or(""));
|
||||
@@ -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)]
|
||||
|
||||
@@ -26,6 +26,7 @@ mod text;
|
||||
use text::*;
|
||||
pub mod quick;
|
||||
pub mod hook;
|
||||
pub use raea_app_check_inbox as inbox;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ pub(crate) fn approve(enc: &mut Encoders, dir: &Folder, fp: &Fingerprint, args:
|
||||
words: None,
|
||||
at: 0,
|
||||
pin: None,
|
||||
band: None,
|
||||
};
|
||||
l.push(row, &features(&c, *a, *b));
|
||||
}
|
||||
|
||||
@@ -156,6 +156,7 @@ pub fn rows(enc: &mut Encoders, who: &str, files: &[PathBuf], per: usize, l: &mu
|
||||
words: None,
|
||||
at: 0,
|
||||
pin: None,
|
||||
band: None,
|
||||
};
|
||||
l.push(r, &features(c, 0.0, WIN));
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ 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 }
|
||||
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]
|
||||
|
||||
@@ -12,44 +12,13 @@
|
||||
use crate::{flag, has, words};
|
||||
use raea_sys_fingerprint::folder::Folder;
|
||||
use raea_sys_fingerprint::taxonomy::Fingerprint;
|
||||
use serde::{Deserialize, Serialize};
|
||||
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};
|
||||
|
||||
/// FP5b's bar, out of every 50 checked
|
||||
pub const KIND_BAR: f64 = 45.0 / 50.0;
|
||||
pub const AXIS_BAR: f64 = 40.0 / 50.0;
|
||||
pub const INBOX: &str = "fingerprint";
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct Reading {
|
||||
pub note: String,
|
||||
pub text: String,
|
||||
pub who: String,
|
||||
pub media: PathBuf,
|
||||
pub t: f64,
|
||||
pub project: String,
|
||||
/// defect, direction, praise or both
|
||||
pub kind: String,
|
||||
pub axis: Option<String>,
|
||||
/// how it was read: kimi or claude
|
||||
pub by: String,
|
||||
/// the person's check: Some(true) agreed, Some(false) not; None until asked
|
||||
#[serde(default)]
|
||||
pub kind_ok: Option<bool>,
|
||||
#[serde(default)]
|
||||
pub axis_ok: Option<bool>,
|
||||
/// a span pin's end: the label covers t..to (FP11b)
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub to: Option<f64>,
|
||||
/// where in the frame the note's marks say the thing is, x0,y0,x1,y1 in 0-1 (FP11b)
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub region: Option<[f32; 4]>,
|
||||
/// the layers under the pin's x,y in the layer pass, on a render with one (FP5a)
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub layers: Vec<String>,
|
||||
}
|
||||
|
||||
|
||||
/// A post's video on this machine: the renders library, else the project's own folder
|
||||
fn media(project: &Path, m: &Value) -> Option<PathBuf> {
|
||||
@@ -88,7 +57,7 @@ pub fn pinned(project: &Path) -> Vec<Reading> {
|
||||
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, ..Default::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
|
||||
@@ -201,18 +170,6 @@ pub(crate) fn read_here(args: &[String], cwd: &Path) -> i32 {
|
||||
}
|
||||
}
|
||||
|
||||
/// The share of checked readings the person agreed with, for kind and for axis, and how many were checked
|
||||
pub fn agreement(r: &[Reading]) -> (Option<f64>, Option<f64>, usize) {
|
||||
let share = |v: Vec<bool>| (!v.is_empty()).then(|| v.iter().filter(|x| **x).count() as f64 / v.len() as f64);
|
||||
let checked = r.iter().filter(|x| x.kind_ok.is_some()).count();
|
||||
(share(r.iter().filter_map(|x| x.kind_ok).collect()), share(r.iter().filter_map(|x| x.axis_ok).collect()), checked)
|
||||
}
|
||||
|
||||
/// Whether the readings have earned training (FP5b): 50 checked, the kind right 45 times and the axis 40
|
||||
pub fn earned(r: &[Reading]) -> bool {
|
||||
matches!(agreement(r), (Some(k), Some(a), n) if n >= 50 && k >= KIND_BAR && a >= AXIS_BAR)
|
||||
}
|
||||
|
||||
/// 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)];
|
||||
|
||||
@@ -296,8 +253,9 @@ pub(crate) fn learn(enc: &mut raea_sys_columns::Encoders, dir: &Folder, l: &mut
|
||||
(None, true) => continue,
|
||||
};
|
||||
let c = enc.columns(&x.media)?;
|
||||
// a span is the label's time; 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| (x.t.max(0.0), to.min(c.dur)));
|
||||
// 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;
|
||||
}
|
||||
@@ -307,7 +265,9 @@ pub(crate) fn learn(enc: &mut raea_sys_columns::Encoders, dir: &Folder, l: &mut
|
||||
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()));
|
||||
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 };
|
||||
// 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;
|
||||
@@ -334,13 +294,15 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn notes_train_only_once_the_person_agrees_enough() {
|
||||
let r = |k: bool, a: bool| Reading { kind_ok: Some(k), axis_ok: Some(a), ..Default::default() };
|
||||
let mut v: Vec<Reading> = (0..45).map(|_| r(true, true)).collect();
|
||||
v.extend((0..5).map(|_| r(false, false)));
|
||||
assert!(earned(&v), "45 and 45 of 50");
|
||||
v[0] = r(false, true);
|
||||
assert!(!earned(&v), "44 kinds of 50 is under the bar");
|
||||
assert!(!earned(&v[..40]), "fewer than 50 checked");
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ 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 }
|
||||
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 }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ pub(crate) fn run(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -
|
||||
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 };
|
||||
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)?;
|
||||
|
||||
@@ -252,6 +252,7 @@ fn teach(enc: &mut Encoders, args: &[String], cwd: &Path, eval: Eval) -> Result<
|
||||
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));
|
||||
|
||||
+5
-11
@@ -88,7 +88,10 @@ pub fn export(args: &[String]) -> R<String> {
|
||||
opts.push(p.display().to_string());
|
||||
}
|
||||
}
|
||||
opts.push("--lite".into());
|
||||
// on live play's runtime, or React for an edit drawing R3F (raea_runtime_live::needs_react)
|
||||
if !raea_runtime_live::needs_react(&dir) {
|
||||
opts.push("--lite".into());
|
||||
}
|
||||
let js = game.join("bundle.js");
|
||||
raea_runtime_react::scene::bundle_composition(&tsx, &js, &raea_runtime_react::scene::comp_opts(&opts)?, Some(&game))?;
|
||||
|
||||
@@ -98,10 +101,7 @@ pub fn export(args: &[String]) -> R<String> {
|
||||
gather(&mut bundle, &dir, &game, &mut got)?;
|
||||
std::fs::write(&js, &bundle).map_err(|e| e.to_string())?;
|
||||
|
||||
// an app screen needs a player with the surface runtime (the `surfaces` feature), which the size-built one leaves out
|
||||
if got.files.iter().any(|(rel, _)| rel.ends_with(raea_runtime_page::screen::BUNDLED)) && !player_has_surfaces(&player)? {
|
||||
return Err(format!("this game has an app screen (<Screen app>), and the player {} can't run one: build it with them (cargo build --profile game -p raea-app-game --bin raea-game --features player,surfaces) and export again", player.display()));
|
||||
}
|
||||
// an app screen (<Screen app>) draws on the player's own Blitz page (raea-runtime-appscreen): every player has one
|
||||
|
||||
// 3. what play works out at open, worked out now from the package itself (so the package is known to load)
|
||||
let src = std::fs::read_to_string(&tsx).unwrap_or_default();
|
||||
@@ -252,12 +252,6 @@ pub(crate) fn imported(dir: &Path, file: &Path) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Whether the player at `bin` was built with the surface runtime (app screens): its shim's text is in it.
|
||||
pub(crate) fn player_has_surfaces(bin: &Path) -> R<bool> {
|
||||
let bytes = std::fs::read(bin).map_err(|e| format!("{}: {e}", bin.display()))?;
|
||||
Ok(bytes.windows(14).any(|w| w == b"__surfaceFrame"))
|
||||
}
|
||||
|
||||
pub(crate) fn default_name(tsx: &Path) -> String {
|
||||
let stem = tsx.file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default();
|
||||
let base = if stem == "edit" { tsx.parent().and_then(|p| p.file_name()).map(|s| s.to_string_lossy().to_string()).unwrap_or(stem) } else { stem };
|
||||
|
||||
+13
-5
@@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +237,10 @@ pub(crate) fn offscreen(mut run: Run, json: Option<String>, flat_out: bool, snap
|
||||
if let Some((x, y, down)) = run.pointer {
|
||||
e["pointer"] = serde_json::json!({"x": x, "y": y, "down": down});
|
||||
}
|
||||
// what reached its app screens (the keys they took aren't the page's above), given them again in a render
|
||||
if let Some(apps) = live.app_input() {
|
||||
e["apps"] = apps;
|
||||
}
|
||||
// the session's seed and start with its first frame: a render of the log draws the same Math.random and Date
|
||||
if logged.is_empty() {
|
||||
e["session"] = live.session();
|
||||
|
||||
+59
-10
@@ -1,6 +1,7 @@
|
||||
//! `raea app bundle` on the web target: a Mac app that opens the page in raea-page-host's window. App.app/Contents has
|
||||
//! the page host, the app's script and stylesheet in Resources/, and a launcher in MacOS/ that starts the host on them
|
||||
//! at the app's title and size, signed by the developer (sign.rs, T1d).
|
||||
//! at the app's title and size, signed by the developer (sign.rs, T1d). The launcher runs the host as its child and
|
||||
//! waits for it: a launcher that execs it leaves the app without a pid in AppKit (#163, `launcher`).
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -37,6 +38,20 @@ fn sh(s: &str) -> String {
|
||||
format!("'{}'", s.replace('\'', "'\\''"))
|
||||
}
|
||||
|
||||
/// The app's executable (Contents/MacOS/NAME): the page host in Resources, on the app's script and stylesheet, in a
|
||||
/// window at the app's title and size. The host is this script's child, never exec'd in its place: when the process
|
||||
/// macOS launched execs another program, AppKit keeps the app's bundle id but loses its pid (NSRunningApplication's
|
||||
/// processIdentifier -1), so window managers that find an app's windows by its pid never see the window (#163). The
|
||||
/// host still checks in as the app, from inside it; a signal to the launcher is passed on to it.
|
||||
fn launcher(name: &str, size: (u32, u32)) -> String {
|
||||
format!(
|
||||
"#!/bin/sh\n# made by raea app bundle: the page in raea-page-host's window, the host this script's child (an exec loses the app's pid)\nR=\"$(cd \"$(dirname \"$0\")/../Resources\" && pwd)\"\n\"$R/raea-page-host\" \"$R/app.js\" --css \"$R/app.css\" --window --title {} --size {}x{} &\nhost=$!\ntrap 'kill -TERM \"$host\" 2>/dev/null' TERM INT HUP\nwait \"$host\"\n",
|
||||
sh(name),
|
||||
size.0,
|
||||
size.1
|
||||
)
|
||||
}
|
||||
|
||||
/// The bundle id from the title: ascii letters and digits, under app.raea.local
|
||||
fn bundle_id(title: &str) -> String {
|
||||
let id: String = title.chars().filter(|c| c.is_ascii_alphanumeric()).collect::<String>().to_lowercase();
|
||||
@@ -58,20 +73,54 @@ pub fn web(a: &Ask) -> Result<String, String> {
|
||||
std::fs::copy(&host, res.join("raea-page-host")).map_err(|e| format!("{}: {e}", host.display()))?;
|
||||
let name = &a.title;
|
||||
std::fs::write(contents.join("Info.plist"), plist(name, &bundle_id(name))).map_err(|e| e.to_string())?;
|
||||
let launcher = macos.join(name);
|
||||
let script = format!(
|
||||
"#!/bin/sh\n# made by raea app bundle: the page in raea-page-host's window\nR=\"$(cd \"$(dirname \"$0\")/../Resources\" && pwd)\"\nexec \"$R/raea-page-host\" \"$R/app.js\" --css \"$R/app.css\" --window --title {} --size {}x{}\n",
|
||||
sh(name),
|
||||
a.size.0,
|
||||
a.size.1
|
||||
);
|
||||
std::fs::write(&launcher, script).map_err(|e| e.to_string())?;
|
||||
let exe = macos.join(name);
|
||||
std::fs::write(&exe, launcher(name, a.size)).map_err(|e| e.to_string())?;
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
std::fs::set_permissions(&launcher, std::fs::Permissions::from_mode(0o755)).map_err(|e| e.to_string())?;
|
||||
std::fs::set_permissions(&exe, std::fs::Permissions::from_mode(0o755)).map_err(|e| e.to_string())?;
|
||||
}
|
||||
let mut said = crate::sign::sign(&out, &a.sign)?;
|
||||
said.push(format!("{} (web)", out.display()));
|
||||
Ok(said.join("\n"))
|
||||
}
|
||||
|
||||
#[cfg(all(test, unix))]
|
||||
mod tests {
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::process::Command;
|
||||
|
||||
/// The launcher run as macOS runs an app's executable, with a page host that writes down its own pid, its parent's
|
||||
/// and its arguments, and exits 3: the host must be the launcher's child (an exec ran it in the launcher's
|
||||
/// process, the pid macOS launched, and AppKit lost the app's pid: #163), on the app's files, and the launcher must
|
||||
/// end with the host's status.
|
||||
#[test]
|
||||
fn the_host_runs_as_the_launchers_child() {
|
||||
// canonical, so the launcher's own `pwd` names Resources as this test does (macOS's temp folder is a link)
|
||||
let dir = std::env::temp_dir().canonicalize().unwrap().join(format!("raea-macapp-launcher-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
let (macos, res) = (dir.join("T.app/Contents/MacOS"), dir.join("T.app/Contents/Resources"));
|
||||
std::fs::create_dir_all(&macos).unwrap();
|
||||
std::fs::create_dir_all(&res).unwrap();
|
||||
let ran = res.join("ran");
|
||||
let host = res.join("raea-page-host");
|
||||
std::fs::write(&host, format!("#!/bin/sh\necho \"$$ $PPID $*\" > '{}'\nexit 3\n", ran.display())).unwrap();
|
||||
let exe = macos.join("T");
|
||||
std::fs::write(&exe, super::launcher("My App", (800, 600))).unwrap();
|
||||
for f in [&host, &exe] {
|
||||
std::fs::set_permissions(f, std::fs::Permissions::from_mode(0o755)).unwrap();
|
||||
}
|
||||
let mut child = Command::new(&exe).spawn().unwrap();
|
||||
let launched = child.id().to_string();
|
||||
let status = child.wait().unwrap();
|
||||
let said = std::fs::read_to_string(&ran).unwrap();
|
||||
let mut words = said.split_whitespace();
|
||||
let (pid, parent) = (words.next().unwrap(), words.next().unwrap());
|
||||
assert_ne!(pid, launched, "the host ran in the launcher's own process (exec'd): {said}");
|
||||
assert_eq!(parent, launched, "the host isn't the launcher's child: {said}");
|
||||
let args = format!("{0}/app.js --css {0}/app.css --window --title My App --size 800x600", res.display());
|
||||
assert_eq!(said.trim_end().splitn(3, ' ').nth(2), Some(args.as_str()));
|
||||
assert_eq!(status.code(), Some(3), "the launcher didn't end with the host's status");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ pub fn host(args: &[String]) -> Result<String, String> {
|
||||
let p = Path::new(a);
|
||||
if p.extension().is_some_and(|x| x == "tsx" || x == "ts" || x == "jsx") && p.is_file() {
|
||||
std::fs::create_dir_all(&work).map_err(|e| format!("{}: {e}", work.display()))?;
|
||||
let (js, css) = raea_runtime_bundle::inproc::app::bundle(p, &raea_io_home::home())?;
|
||||
let (js, css) = raea_runtime_bundle::inproc::app::bundle(p, &raea_io_home::home(), raea_runtime_bundle::inproc::app::WINDOW)?;
|
||||
let script = work.join(format!("{}.js", p.file_stem().unwrap_or_default().to_string_lossy()));
|
||||
std::fs::write(&script, js).map_err(|e| format!("{}: {e}", script.display()))?;
|
||||
handed.push(script.display().to_string());
|
||||
|
||||
@@ -24,7 +24,7 @@ pub struct Built {
|
||||
pub fn build(app: &Path, dir: &Path) -> Result<Built, String> {
|
||||
let app = raea_io_home::plain(app.canonicalize().map_err(|e| format!("{}: {e}", app.display()))?);
|
||||
std::fs::create_dir_all(dir).map_err(|e| format!("{}: {e}", dir.display()))?;
|
||||
let (js, imported) = raea_runtime_bundle::inproc::app::bundle(&app, &raea_io_home::home())?;
|
||||
let (js, imported) = raea_runtime_bundle::inproc::app::bundle(&app, &raea_io_home::home(), raea_runtime_bundle::inproc::app::WINDOW)?;
|
||||
let folder = app.parent().unwrap_or(Path::new("."));
|
||||
let tw = raea_runtime_bundle::styles::tailwind(folder)?;
|
||||
let built = Built { js: dir.join("app.js"), css: dir.join("app.css") };
|
||||
|
||||
@@ -16,3 +16,7 @@ serde_json = "1"
|
||||
# the verbs' flags read as a render reads its own
|
||||
raea-runtime-bundle = { path = "../../runtime/bundle" }
|
||||
raea-runtime-export = { path = "../../runtime/export" }
|
||||
|
||||
# `raea motion`: Kimodo on MLX, Apple silicon's
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
raea-sys-kimodo = { path = "../../systems/kimodo" }
|
||||
@@ -0,0 +1,148 @@
|
||||
//! Grok Bot (xAI's desktop agent, made by Anysphere: /Applications/Grok Bot.app, bundle com.anysphere.sand) as a
|
||||
//! `raea skills install --agent grokbot` target (docs/skills.feature SK13). Read from its app.asar, 1.1.0 (11-14):
|
||||
//! Grok Bot keeps nothing on this Mac that raea could write. Its agent runs on a computer of its own in the cloud (its
|
||||
//! "box"), its skills are held there, and its MCP servers belong to the person's account (Settings → Integrations →
|
||||
//! Add a custom connector), a server's command running on that computer, not here. It has no hooks, no CLI and no ACP.
|
||||
//! What does reach this Mac is its Execution on this computer: the Bot runs a command here, through its local daemon.
|
||||
//! So raea stages its skill in a folder of its own, stamped and with a preface saying where raea runs, and gives the
|
||||
//! grokbot:// links that finish it in Grok Bot: the Execution setting, and a message to the Bot, filled in but not
|
||||
//! sent, asking it to make the skill from the staged file ("Ask your Bot to create one", as Grok Bot itself says).
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
type R<T> = Result<T, String>;
|
||||
|
||||
/// The folder raea stages Grok Bot's copy in: $RAEA_GROKBOT_HOME, else grokbot in raea's own folder in the home.
|
||||
pub fn home() -> R<PathBuf> {
|
||||
match std::env::var_os("RAEA_GROKBOT_HOME").filter(|v| !v.is_empty()) {
|
||||
Some(d) => Ok(PathBuf::from(d)),
|
||||
None => Ok(crate::agent_mcp::user_home()?.join(".raea").join("grokbot")),
|
||||
}
|
||||
}
|
||||
|
||||
/// Where the staged skills go, one folder per skill holding SKILL.md, as for every agent.
|
||||
pub fn skills_dir() -> R<PathBuf> {
|
||||
Ok(home()?.join("skills"))
|
||||
}
|
||||
|
||||
/// The app, where macOS keeps it (/Applications, or ~/Applications).
|
||||
pub fn app() -> Option<PathBuf> {
|
||||
let home = crate::agent_mcp::user_home().ok();
|
||||
[Some(PathBuf::from("/Applications")), home.map(|h| h.join("Applications"))].into_iter().flatten().map(|d| d.join("Grok Bot.app")).find(|a| a.join("Contents/Info.plist").is_file())
|
||||
}
|
||||
|
||||
/// The largest SKILL.md Grok Bot's Skills → Add new skill → Upload file takes, in bytes (256 KB).
|
||||
pub const MAX_SKILL: usize = 256_000;
|
||||
|
||||
/// After `raea skills install --agent grokbot` has copied raea's skills into `dir` (`said`, what it said doing so): the
|
||||
/// preface in raea's SKILL.md, and the links that finish it. A linked folder is the person's, left as it is. Grok Bot
|
||||
/// gets no hooks (it has none) and no MCP server (its command would run on the Bot's own computer, not this Mac).
|
||||
pub fn stage(dir: &Path, said: String) -> R<String> {
|
||||
let md = dir.join("raea/SKILL.md");
|
||||
if !dir.join("raea").is_symlink() && let Ok(text) = std::fs::read_to_string(&md) {
|
||||
let text = with_preface(&text, dir);
|
||||
if text.len() >= MAX_SKILL {
|
||||
return Err(format!("{}: {} KB, more than the 256 KB Grok Bot's Add new skill takes", md.display(), text.len() / 1000));
|
||||
}
|
||||
std::fs::write(&md, text).map_err(|e| format!("{}: {e}", md.display()))?;
|
||||
}
|
||||
Ok(format!("{said}{}", finish(dir)))
|
||||
}
|
||||
|
||||
/// SKILL.md with the preface after its front matter (or first, when it has none): raea runs on the person's Mac, not on
|
||||
/// the Bot's computer. A copy that has one keeps only one.
|
||||
pub fn with_preface(text: &str, dir: &Path) -> String {
|
||||
if text.contains("> **On Grok Bot.**") {
|
||||
return text.to_string();
|
||||
}
|
||||
let p = format!(
|
||||
"> **On Grok Bot.** raea runs on the person's Mac, not on your computer. Run every `raea` command there, and read\n> every file this skill links (3d.md, reference/cli.md and the rest) from its copy there, in {}, both\n> with Run a command on your local computer (the person turns on Settings → Computer → Execution on this computer).\n> No raea MCP server or hook is set up for you: after saving a composition run `raea check EDIT.tsx --quick` yourself,\n> and `raea show FILE` puts media in front of the person.\n",
|
||||
dir.join("raea").display()
|
||||
);
|
||||
let Some(rest) = text.strip_prefix("---\n") else { return format!("{p}\n{text}") };
|
||||
let Some(end) = rest.find("\n---\n") else { return format!("{p}\n{text}") };
|
||||
let (front, body) = (&rest[..end], rest[end + 5..].trim_start_matches('\n'));
|
||||
format!("---\n{front}\n---\n\n{p}\n{body}")
|
||||
}
|
||||
|
||||
/// A query value as Grok Bot builds its own links (encodeURIComponent): every byte but A-Z a-z 0-9 - _ . ! ~ * ' ( ).
|
||||
fn encode(v: &str) -> String {
|
||||
v.bytes().map(|b| if b.is_ascii_alphanumeric() || b"-_.!~*'()".contains(&b) { (b as char).to_string() } else { format!("%{b:02X}") }).collect()
|
||||
}
|
||||
|
||||
/// One of Grok Bot's deep links (its route table: grokbot://app/v1/ROUTE?KEY=VALUE).
|
||||
pub fn link(route: &str, key: &str, value: &str) -> String {
|
||||
format!("grokbot://app/v1/{route}?{key}={}", encode(value))
|
||||
}
|
||||
|
||||
/// The message to the Bot that makes the skill from the copy staged in `dir`: at most 1000 characters, as its prompt
|
||||
/// link takes.
|
||||
fn ask(dir: &Path) -> String {
|
||||
let md = dir.join("raea/SKILL.md");
|
||||
format!("Please make a private skill named raea from the file {} on my Mac: read it with Run a command on your local computer and keep its text as it is. raea runs on my Mac, so run every raea command there.", md.display())
|
||||
}
|
||||
|
||||
/// What `raea skills install --agent grokbot` says once the copy is staged: where it is, and the links that finish it.
|
||||
pub fn finish(dir: &Path) -> String {
|
||||
let md = dir.join("raea/SKILL.md");
|
||||
let here = match app() {
|
||||
Some(a) => format!("Grok Bot is at {}.", a.display()),
|
||||
None => "Grok Bot isn't installed on this Mac (cursor.com/download/bot); the copy is ready for when it is.".into(),
|
||||
};
|
||||
format!(
|
||||
"{here} It keeps its skills on its own computer and its MCP servers on your account, so the copy waits here: {}. No hooks, and no MCP server: Grok Bot runs a server's command on its computer, where the blender server can't reach this Mac's Blender.\nTo finish, in Grok Bot, signed in:\n 1. turn on Execution on this computer: {}\n 2. send the message this fills in, and the Bot makes the skill from the copy: {}\n or by hand: Skills → Add new skill → Upload file → {}\n`open LINK` opens a link in Grok Bot",
|
||||
dir.display(),
|
||||
link("settings", "id", "local-execution"),
|
||||
link("prompt", "text", &ask(dir)),
|
||||
md.display()
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn the_preface_goes_after_the_front_matter_once() {
|
||||
let d = Path::new("/h/.raea/grokbot/skills");
|
||||
let md = "---\nname: raea\ndescription: d\nversion: 1\n---\n\n# raea\n";
|
||||
let out = with_preface(md, d);
|
||||
assert!(out.starts_with("---\nname: raea\ndescription: d\nversion: 1\n---\n\n> **On Grok Bot.** raea runs on the person's Mac"), "{out}");
|
||||
assert!(out.contains("in /h/.raea/grokbot/skills/raea, both") && out.ends_with("\n\n# raea\n"), "{out}");
|
||||
assert_eq!(with_preface(&out, d), out);
|
||||
assert!(with_preface("# no front matter\n", d).starts_with("> **On Grok Bot.**"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn links_are_built_as_grok_bot_builds_its_own() {
|
||||
assert_eq!(link("settings", "id", "local-execution"), "grokbot://app/v1/settings?id=local-execution");
|
||||
assert_eq!(link("prompt", "text", "a b/ü&+=?#'()"), "grokbot://app/v1/prompt?text=a%20b%2F%C3%BC%26%2B%3D%3F%23'()");
|
||||
// its prompt route takes at most 1000 characters of text in a link of at most 2048, with no format characters
|
||||
let a = ask(Path::new("/h/a-home-folder-with-a-rather-long-name/.raea/grokbot/skills"));
|
||||
assert!(a.chars().count() <= 1000 && link("prompt", "text", &a).len() <= 2048, "{a}");
|
||||
assert!(a.chars().all(|c| !c.is_control() && !('\u{200B}'..='\u{200F}').contains(&c) && !('\u{202A}'..='\u{202E}').contains(&c)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stage_prefaces_the_copy_once_and_refuses_one_too_big_to_upload() {
|
||||
let d = std::env::temp_dir().join(format!("raea-grokbot-stage-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
std::fs::create_dir_all(d.join("raea")).unwrap();
|
||||
std::fs::write(d.join("raea/SKILL.md"), "---\nname: raea\nversion: 1\n---\n\n# raea\n").unwrap();
|
||||
let out = stage(&d, "copied\n".into()).unwrap();
|
||||
assert!(out.starts_with("copied\n") && out.contains("grokbot://app/v1/prompt?text="), "{out}");
|
||||
stage(&d, String::new()).unwrap();
|
||||
let md = std::fs::read_to_string(d.join("raea/SKILL.md")).unwrap();
|
||||
assert_eq!(md.matches("> **On Grok Bot.**").count(), 1, "{md}");
|
||||
std::fs::write(d.join("raea/SKILL.md"), "x".repeat(MAX_SKILL)).unwrap();
|
||||
assert!(stage(&d, String::new()).unwrap_err().contains("256 KB"));
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finish_says_where_the_copy_is_and_both_links() {
|
||||
let f = finish(Path::new("/h/.raea/grokbot/skills"));
|
||||
assert!(f.contains("the copy waits here: /h/.raea/grokbot/skills."), "{f}");
|
||||
assert!(f.contains("grokbot://app/v1/settings?id=local-execution") && f.contains("grokbot://app/v1/prompt?text=Please%20make%20a%20private%20skill"), "{f}");
|
||||
assert!(f.contains("Upload file → /h/.raea/grokbot/skills/raea/SKILL.md"), "{f}");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
//! The hooks `raea skills install` adds an agent (docs/agents.feature A5d, A5e; docs/skills.feature SK10), the same two
|
||||
//! for every harness, each written where and how that harness reads hooks: before a shell command, `raea hook AGENT`
|
||||
//! steers media opened in the Mac's viewer to `raea show`; after a file is saved, it runs the quick check on a
|
||||
//! composition. An event that already has a `raea hook` entry is left as it is.
|
||||
//! composition. Claude Code's run after every tool and as a turn ends too, to hand the session what the person sent from
|
||||
//! the raea app (apps/check/src/inbox.rs). An event that already has a `raea hook` entry keeps it, its matcher widened
|
||||
//! to this raea's when an older raea wrote a narrower one.
|
||||
use crate::agent_mcp::user_home;
|
||||
use serde_json::{Value, json};
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -15,14 +17,14 @@ struct Hook {
|
||||
secs: u64,
|
||||
}
|
||||
|
||||
/// Each harness's two hooks, by its own event and tool names.
|
||||
fn hooks(agent: &str) -> R<[Hook; 2]> {
|
||||
/// Each harness's hooks, by its own event and tool names.
|
||||
fn hooks(agent: &str) -> R<Vec<Hook>> {
|
||||
let h = |event, matcher, secs| Hook { event, matcher, secs };
|
||||
Ok(match agent {
|
||||
"claude" => [h("PreToolUse", "Bash", 30), h("PostToolUse", "Write|Edit|MultiEdit", 60)],
|
||||
"codex" => [h("PreToolUse", "^(Bash|shell|shell_command|exec_command)$", 30), h("PostToolUse", "^(apply_patch|Edit|Write)$", 60)],
|
||||
"gemini" => [h("BeforeTool", "run_shell_command", 30), h("AfterTool", "write_file|replace", 60)],
|
||||
"kimi" => [h("PreToolUse", "Bash|Shell", 30), h("PostToolUse", "Write|Edit|WriteFile|StrReplaceFile", 60)],
|
||||
"claude" => vec![h("PreToolUse", "Bash", 30), h("PostToolUse", "*", 60), h("Stop", "", 10)],
|
||||
"codex" => vec![h("PreToolUse", "^(Bash|shell|shell_command|exec_command)$", 30), h("PostToolUse", "^(apply_patch|Edit|Write)$", 60)],
|
||||
"gemini" => vec![h("BeforeTool", "run_shell_command", 30), h("AfterTool", "write_file|replace", 60)],
|
||||
"kimi" => vec![h("PreToolUse", "Bash|Shell", 30), h("PostToolUse", "Write|Edit|WriteFile|StrReplaceFile", 60)],
|
||||
a => return Err(format!("no agent {a:?}: claude, codex, kimi or gemini")),
|
||||
})
|
||||
}
|
||||
@@ -54,7 +56,14 @@ fn add_json(path: &Path, agent: &str, h: &Hook) -> R<bool> {
|
||||
let hooks = doc.as_object_mut().ok_or(format!("{at} isn't a JSON object"))?.entry("hooks").or_insert_with(|| json!({}));
|
||||
let list = hooks.as_object_mut().ok_or(format!("{at}: hooks isn't an object"))?.entry(h.event).or_insert_with(|| json!([]));
|
||||
let list = list.as_array_mut().ok_or(format!("{at}: hooks.{} isn't a list", h.event))?;
|
||||
if list.iter().any(|m| m["hooks"].as_array().into_iter().flatten().any(|x| x["command"].as_str().unwrap_or("").starts_with("raea hook"))) {
|
||||
let ours = |m: &Value| m["hooks"].as_array().into_iter().flatten().any(|x| x["command"].as_str().unwrap_or("").starts_with("raea hook"));
|
||||
if let Some(m) = list.iter_mut().find(|m| ours(m)) {
|
||||
// an older raea's narrower matcher (Claude's after-save hook, now after every tool) is widened, the rest kept
|
||||
if h.matcher == "*" && m["matcher"].as_str() != Some("*") {
|
||||
m["matcher"] = h.matcher.into();
|
||||
write(path, &(serde_json::to_string_pretty(&doc).unwrap_or_default() + "\n"))?;
|
||||
return Ok(true);
|
||||
}
|
||||
return Ok(false);
|
||||
}
|
||||
// Gemini CLI counts milliseconds and names each hook
|
||||
@@ -115,21 +124,24 @@ mod tests {
|
||||
let c = d.join("claude/settings.json");
|
||||
std::fs::create_dir_all(c.parent().unwrap()).unwrap();
|
||||
std::fs::write(&c, r#"{"model":"x","hooks":{"PostToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"other"}]},{"matcher":"Write","hooks":[{"type":"command","command":"raea hook claude"}]}]}}"#).unwrap();
|
||||
let [pre, post] = hooks("claude").unwrap();
|
||||
let [pre, post, stop] = <[Hook; 3]>::try_from(hooks("claude").unwrap()).ok().unwrap();
|
||||
assert!(add_json(&c, "claude", &pre).unwrap() && !add_json(&c, "claude", &pre).unwrap());
|
||||
assert!(!add_json(&c, "claude", &post).unwrap(), "an older raea's after-save hook stands");
|
||||
assert!(add_json(&c, "claude", &post).unwrap() && !add_json(&c, "claude", &post).unwrap(), "an older raea's after-save hook is widened to every tool, once");
|
||||
assert!(add_json(&c, "claude", &stop).unwrap() && !add_json(&c, "claude", &stop).unwrap());
|
||||
let v: Value = serde_json::from_str(&std::fs::read_to_string(&c).unwrap()).unwrap();
|
||||
assert_eq!((v["model"].as_str(), v["hooks"]["PostToolUse"].as_array().unwrap().len()), (Some("x"), 2));
|
||||
assert_eq!((v["hooks"]["PostToolUse"][0]["matcher"].as_str(), v["hooks"]["PostToolUse"][1]["matcher"].as_str()), (Some("Bash"), Some("*")));
|
||||
assert_eq!(v["hooks"]["PreToolUse"][0]["hooks"][0]["command"], "raea hook claude");
|
||||
assert_eq!(v["hooks"]["Stop"][0]["hooks"][0]["command"], "raea hook claude");
|
||||
let g = d.join("gemini/settings.json");
|
||||
let [before, _] = hooks("gemini").unwrap();
|
||||
let [before, _] = <[Hook; 2]>::try_from(hooks("gemini").unwrap()).ok().unwrap();
|
||||
assert!(add_json(&g, "gemini", &before).unwrap());
|
||||
let v: Value = serde_json::from_str(&std::fs::read_to_string(&g).unwrap()).unwrap();
|
||||
assert_eq!(v["hooks"]["BeforeTool"][0], json!({"matcher": "run_shell_command", "hooks": [{"name": "raea", "type": "command", "command": "raea hook gemini", "timeout": 30000}]}));
|
||||
let k = d.join("kimi/config.toml");
|
||||
std::fs::create_dir_all(k.parent().unwrap()).unwrap();
|
||||
std::fs::write(&k, "default_model = \"k\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash\"\ncommand = \"mine\"\n").unwrap();
|
||||
let [pre, post] = hooks("kimi").unwrap();
|
||||
let [pre, post] = <[Hook; 2]>::try_from(hooks("kimi").unwrap()).ok().unwrap();
|
||||
assert!(add_toml(&k, &pre).unwrap() && !add_toml(&k, &pre).unwrap() && add_toml(&k, &post).unwrap() && !add_toml(&k, &post).unwrap());
|
||||
let t = std::fs::read_to_string(&k).unwrap();
|
||||
assert!(t.starts_with("default_model = \"k\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash\"\ncommand = \"mine\"\n\n[[hooks]]\nevent = \"PreToolUse\"\nmatcher = \"Bash|Shell\"\ncommand = \"raea hook kimi\"\ntimeout = 30\n"), "{t}");
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
//! Where each agent `raea skills install` knows reads a person's skills, one folder per skill holding SKILL.md. Checked
|
||||
//! by hand on 11-05: claude: ~/.claude/skills (Claude Code's docs); codex: ~/.agents/skills
|
||||
//! (developers.openai.com/codex/skills, the user scope; older builds read ~/.codex/skills); kimi: $KIMI_CODE_HOME/skills,
|
||||
//! else ~/.kimi-code/skills (kimi 2.3.3's own binary; it also reads ~/.agents/skills and ~/.claude/skills); gemini:
|
||||
//! ~/.gemini/skills (geminicli.com/docs/cli/skills). grokbot (11-14): Grok Bot reads no folder here, so its copy is
|
||||
//! staged in raea's own (agent_grokbot.rs).
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// The agents, in the order `raea doctor` and the usage name them.
|
||||
pub const AGENTS: [&str; 5] = ["claude", "codex", "kimi", "gemini", "grokbot"];
|
||||
|
||||
/// The folder `agent` reads skills from.
|
||||
pub fn folder(agent: &str) -> Result<PathBuf, String> {
|
||||
let home = crate::agent_mcp::user_home()?;
|
||||
Ok(match agent {
|
||||
"claude" => home.join(".claude/skills"),
|
||||
"codex" => home.join(".agents/skills"),
|
||||
"kimi" => std::env::var_os("KIMI_CODE_HOME").filter(|v| !v.is_empty()).map(PathBuf::from).unwrap_or_else(|| home.join(".kimi-code")).join("skills"),
|
||||
"gemini" => home.join(".gemini/skills"),
|
||||
"grokbot" => crate::agent_grokbot::skills_dir()?,
|
||||
a => return Err(format!("no agent {a:?}: claude, codex, kimi, gemini or grokbot")),
|
||||
})
|
||||
}
|
||||
|
||||
/// Each agent and the folder it reads skills from, for `raea doctor` (an agent with no folder is skipped).
|
||||
pub fn agents() -> Vec<(&'static str, PathBuf)> {
|
||||
AGENTS.into_iter().filter_map(|a| folder(a).ok().map(|t| (a, t))).collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn each_agent_has_its_folder() {
|
||||
assert!(folder("claude").unwrap().ends_with(".claude/skills"));
|
||||
assert!(folder("codex").unwrap().ends_with(".agents/skills"));
|
||||
assert!(folder("gemini").unwrap().ends_with(".gemini/skills"));
|
||||
assert_eq!(folder("grokbot").unwrap(), crate::agent_grokbot::skills_dir().unwrap());
|
||||
assert!(folder("cursor").is_err());
|
||||
assert_eq!(agents().len(), AGENTS.len());
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
//! made.app, fal, Replicate, OpenRouter, Modal and ComfyUI, with sao as the local model: apps/tools/src/generate.rs).
|
||||
|
||||
pub mod generate;
|
||||
/// `raea motion`: body motion made on this Mac by Kimodo on MLX (raea-sys-kimodo)
|
||||
pub mod motion;
|
||||
pub mod song;
|
||||
pub mod sound;
|
||||
pub mod splat;
|
||||
@@ -11,5 +13,9 @@ pub mod splat;
|
||||
/// the MCP servers `raea skills install` offers an agent (blender, for a running Blender)
|
||||
pub mod agent_mcp;
|
||||
pub mod agent_hooks;
|
||||
/// Grok Bot as a `raea skills install` target: its copy staged on this Mac, and the links that finish it in Grok Bot
|
||||
pub mod agent_grokbot;
|
||||
/// where each agent reads a person's skills
|
||||
pub mod agent_skills;
|
||||
/// `raea setup blender` and `raea blender run`
|
||||
pub mod blender;
|
||||
@@ -0,0 +1,117 @@
|
||||
//! `raea motion "LINE" [--keys KEYS.json] ...`: body motion made on this Mac by Kimodo (raea-sys-kimodo, on MLX): a
|
||||
//! SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a
|
||||
//! root path: what sdk/body/tools/between.ts writes). The clip is the file sdk/body/tools/fromkimodo.ts reads, the
|
||||
//! same one the cloud runner wrote (docs/character.feature CH15b, CH15c).
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use raea_runtime_bundle::flag;
|
||||
|
||||
type R<T> = Result<T, String>;
|
||||
|
||||
pub const USAGE: &str = "raea motion \"LINE\" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--steps 100] [-o CLIP.json]";
|
||||
pub const ABOUT: &str = "body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads; the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters); a line's words are read once and kept. Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT";
|
||||
|
||||
fn number(args: &[String], name: &str, default: f64) -> R<f64> {
|
||||
match flag(args, name) {
|
||||
None => Ok(default),
|
||||
Some(v) => v.parse::<f64>().ok().filter(|n| n.is_finite() && *n >= 0.0).ok_or(format!("{name} takes a number, got `{v}`")),
|
||||
}
|
||||
}
|
||||
|
||||
fn line(args: &[String]) -> String {
|
||||
const WITH_VALUE: [&str; 6] = ["--keys", "--seconds", "--frames", "--seed", "--steps", "-o"];
|
||||
let mut out = Vec::new();
|
||||
let mut i = 1;
|
||||
while i < args.len() {
|
||||
if WITH_VALUE.contains(&args[i].as_str()) {
|
||||
i += 2;
|
||||
continue;
|
||||
}
|
||||
if !args[i].starts_with("--") {
|
||||
out.push(args[i].as_str());
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
out.join(" ")
|
||||
}
|
||||
|
||||
/// what a call asks for, read from its words and flags
|
||||
struct Ask {
|
||||
words: String,
|
||||
keys: Option<String>,
|
||||
constraints: Option<serde_json::Value>,
|
||||
frames: usize,
|
||||
seed: u64,
|
||||
steps: usize,
|
||||
out: Option<String>,
|
||||
}
|
||||
|
||||
pub fn motion(args: &[String]) -> R<String> {
|
||||
let words = line(args);
|
||||
let keys = flag(args, "--keys");
|
||||
if words.trim().is_empty() && keys.is_none() {
|
||||
return Err(format!("{USAGE}\n ({ABOUT})"));
|
||||
}
|
||||
let frames = match flag(args, "--frames") {
|
||||
Some(_) => number(args, "--frames", 150.0)? as usize,
|
||||
None => (number(args, "--seconds", 5.0)? * 30.0).round() as usize,
|
||||
};
|
||||
if !(2..=600).contains(&frames) {
|
||||
return Err(format!("a clip is 2 to 600 frames (20 s at 30 a second), asked {frames}"));
|
||||
}
|
||||
let constraints = match &keys {
|
||||
Some(p) => Some(serde_json::from_str::<serde_json::Value>(&std::fs::read_to_string(p).map_err(|e| format!("{p}: {e}"))?).map_err(|e| format!("{p}: {e}"))?),
|
||||
None => None,
|
||||
};
|
||||
let (seed, steps) = (number(args, "--seed", 1.0)? as u64, (number(args, "--steps", 100.0)? as usize).max(2));
|
||||
make(Ask { words, keys, constraints, frames, seed, steps, out: flag(args, "-o") })
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
fn make(ask: Ask) -> R<String> {
|
||||
Err(format!("raea motion runs Kimodo on MLX, on Apple silicon's GPU: {:?} can be made on a Mac", ask.words))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
fn make(ask: Ask) -> R<String> {
|
||||
// float32 as checked against PyTorch: MLX's TF32 matmuls off, before the first one
|
||||
if std::env::var_os("MLX_ENABLE_TF32").is_none() {
|
||||
unsafe { std::env::set_var("MLX_ENABLE_TF32", "0") };
|
||||
}
|
||||
let t0 = std::time::Instant::now();
|
||||
// a line every 512 MB of each file fetched
|
||||
let mut shown = std::collections::HashMap::<String, u64>::new();
|
||||
let mut progress = |file: &str, n: u64| {
|
||||
if shown.insert(file.to_string(), n >> 29) != Some(n >> 29) {
|
||||
eprintln!("raea motion: fetching {file}: {} MB", n >> 20);
|
||||
}
|
||||
};
|
||||
let mut k = raea_sys_kimodo::Kimodo::fetch(&mut progress).map_err(|e| format!("raea motion: {e}"))?;
|
||||
let (clean, emb) = k.encode(&ask.words).map_err(|e| format!("raea motion: {e}"))?;
|
||||
let load_s = t0.elapsed().as_secs_f64();
|
||||
let made_from = raea_sys_kimodo::Ask { line: &ask.words, frames: ask.frames, seed: ask.seed, steps: ask.steps, constraints: ask.constraints.as_ref(), cfg: (2.0, 2.0) };
|
||||
let t1 = std::time::Instant::now();
|
||||
let made = k.make(&made_from, emb.as_deref(), None).map_err(|e| format!("raea motion: {e}"))?;
|
||||
let gen_s = t1.elapsed().as_secs_f64();
|
||||
let clip = raea_sys_kimodo::decode::clip_json(&made.motion, &k.skeleton, ask.seed, ask.steps, &clean, ask.constraints.is_some());
|
||||
// without -o, the line's words name the file
|
||||
let out = PathBuf::from(ask.out.unwrap_or_else(|| {
|
||||
let slug = clean.split(|c: char| !c.is_ascii_alphanumeric()).filter(|w| !w.is_empty()).map(str::to_lowercase).collect::<Vec<_>>().join("-");
|
||||
format!("{}.clip.json", if slug.is_empty() { "keys".to_string() } else { slug.chars().take(60).collect() })
|
||||
}));
|
||||
std::fs::write(&out, serde_json::to_string(&clip).unwrap_or_default()).map_err(|e| format!("{}: {e}", out.display()))?;
|
||||
let r = &made.motion.root;
|
||||
let (a, b) = (r[0], r[r.len() - 1]);
|
||||
let travel = ((b[0] - a[0]).powi(2) + (b[2] - a[2]).powi(2)).sqrt();
|
||||
Ok(format!(
|
||||
"APPLIED motion {:?}{}, {} frames ({:.1} s), seed {}, {} steps -> {} (made on this Mac in {gen_s:.1} s after {load_s:.1} s loading and reading the line; the hips end {travel:.2} m from where they start)",
|
||||
clean,
|
||||
if ask.keys.is_some() { " with keys" } else { "" },
|
||||
ask.frames,
|
||||
ask.frames as f64 / 30.0,
|
||||
ask.seed,
|
||||
ask.steps,
|
||||
out.display()
|
||||
))
|
||||
}
|
||||
@@ -129,12 +129,10 @@ fn doctor_finds_old_briefs_and_old_skills() {
|
||||
fn the_root_with_none_set() {
|
||||
let home = scratch("home-root");
|
||||
assert_eq!(default_root(&home), home.join("Documents/raea"));
|
||||
// an empty ~/Studio isn't one; one with a workspace stays the root
|
||||
std::fs::create_dir_all(home.join("Studio/notes")).unwrap();
|
||||
assert_eq!(default_root(&home), home.join("Documents/raea"));
|
||||
// never ~/Studio, even with a workspace in it (Shane 11-14: "no internal no studio"; raea.root says otherwise)
|
||||
std::fs::create_dir_all(home.join("Studio/acme/.raea")).unwrap();
|
||||
std::fs::write(home.join("Studio/acme/.raea/workspace"), "").unwrap();
|
||||
assert_eq!(default_root(&home), home.join("Studio"));
|
||||
assert_eq!(default_root(&home), home.join("Documents/raea"));
|
||||
// iCloud keeping Documents: ~/raea
|
||||
let synced = scratch("home-icloud");
|
||||
std::fs::create_dir_all(synced.join("Library/Mobile Documents/com~apple~CloudDocs/Documents")).unwrap();
|
||||
|
||||
@@ -100,31 +100,19 @@ pub fn root() -> PathBuf {
|
||||
}
|
||||
}
|
||||
|
||||
/// Where workspaces go with no raea.root set: ~/Studio where workspaces are already (the root before 11-10), else
|
||||
/// ~/Documents/raea, or ~/raea when iCloud keeps the Documents folder (a workspace's git history and footage don't
|
||||
/// belong in a synced folder). The feed's host says the same (raea-feed host/workspace.ts defaultRoot).
|
||||
/// Where a workspace someone names goes with no raea.root set: ~/Documents/raea, or ~/raea when iCloud keeps the
|
||||
/// Documents folder (a workspace's git history and footage don't belong in a synced folder). Nothing is made there
|
||||
/// until the person or an agent sets a workspace up (`raea workspace init NAME`); ~/Studio, the root on raea's own Mac
|
||||
/// before 11-10, is no one else's (Shane 11-14: "no internal no studio"). The feed's host says the same (raea-feed
|
||||
/// host/workspace.ts defaultRoot).
|
||||
pub fn default_root(home: &Path) -> PathBuf {
|
||||
let studio = home.join("Studio");
|
||||
if holds_workspace(&studio) {
|
||||
studio
|
||||
} else if home.join("Library/Mobile Documents/com~apple~CloudDocs/Documents").is_dir() {
|
||||
if home.join("Library/Mobile Documents/com~apple~CloudDocs/Documents").is_dir() {
|
||||
home.join("raea")
|
||||
} else {
|
||||
home.join("Documents/raea")
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether a folder in `dir` is a workspace (it has .raea/workspace).
|
||||
fn holds_workspace(dir: &Path) -> bool {
|
||||
let Ok(entries) = std::fs::read_dir(dir) else { return false };
|
||||
for e in entries.flatten() {
|
||||
if e.path().join(".raea/workspace").exists() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
/// The include in a repo's own config that makes `git config` read a committed file. Idempotent; the path is relative
|
||||
/// to the config file, which for a submodule lives under the workspace's .git/modules.
|
||||
pub(crate) fn include(repo: &Path, file: &Path) -> R<()> {
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# #159: --aov and RAEA_PASS on a multisampled 3D camera write every frame. Both read the camera's prepasses as
|
||||
# single-sampled textures, so they turn its multisampling off; the camera row's post-processing turned it back on: in
|
||||
# a render, on the first frame whose post changed (ramp.tsx's bloom ramps); in a game, on every frame its rows set
|
||||
# (game.tsx). Frame 2 was then refused ("Texture binding 0 expects multisampled = false, but given a view with
|
||||
# samples = 4"), with frames 0 and 1 written. Here frames 0 to 5 of each are rendered: --aov must write each frame's
|
||||
# depth and motion at the frame's size (320 x 180 floats: 4 and 8 bytes a pixel), the depth not all zero (something
|
||||
# drawn), and RAEA_PASS=depth all six pictures. Exits 1 on a failure.
|
||||
# bench/aov-msaa/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
|
||||
cd "$(dirname "$0")/../.." || exit 2
|
||||
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
||||
AT=0,1,2,3,4,5
|
||||
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0 RAEA_AUDIO_MUTE=1
|
||||
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-aov-msaa.XXXXXX")
|
||||
trap 'rm -rf "$OUT"' EXIT
|
||||
refused() { grep -m1 REFUSED "$1" || tail -3 "$1"; }
|
||||
for c in ramp game; do
|
||||
"$BIN" render "bench/aov-msaa/$c.tsx" --at "$AT" --aov -o "$OUT/$c" > "$OUT/$c.log" 2>&1 || { echo "FAIL: $c --aov: the render failed"; refused "$OUT/$c.log"; exit 1; }
|
||||
for i in 0 1 2 3 4 5; do
|
||||
n=$(printf '%05d' "$i")
|
||||
[ "$(wc -c < "$OUT/$c/depth/frame-$n.f32" 2>/dev/null | tr -d ' ')" = 230400 ] || { echo "FAIL: $c --aov: frame $i's depth is missing or not 320 x 180"; exit 1; }
|
||||
[ "$(wc -c < "$OUT/$c/motion/frame-$n.f32" 2>/dev/null | tr -d ' ')" = 460800 ] || { echo "FAIL: $c --aov: frame $i's motion is missing or not 320 x 180"; exit 1; }
|
||||
[ "$(LC_ALL=C tr -d '\0' < "$OUT/$c/depth/frame-$n.f32" | head -c 1 | wc -c | tr -d ' ')" = 1 ] || { echo "FAIL: $c --aov: frame $i's depth is all zero"; exit 1; }
|
||||
done
|
||||
echo "PASS: $c --aov: frames 0 to 5, each with its depth and motion"
|
||||
done
|
||||
RAEA_PASS=depth RAEA_READBACK=rgba "$BIN" render bench/aov-msaa/ramp.tsx --at "$AT" -o "$OUT/pass" > "$OUT/pass.log" 2>&1 || { echo "FAIL: ramp RAEA_PASS=depth: the render failed"; refused "$OUT/pass.log"; exit 1; }
|
||||
[ "$(ls "$OUT/pass"/frame-*.png 2>/dev/null | wc -l | tr -d ' ')" = 6 ] || { echo "FAIL: ramp RAEA_PASS=depth: not six frames"; exit 1; }
|
||||
echo "PASS: ramp RAEA_PASS=depth: frames 0 to 5"
|
||||
@@ -0,0 +1,31 @@
|
||||
// #159: a game's 3D (its rows set on the live engine each frame, so raea-sys-post's msaa_for_3d sees them): a
|
||||
// multisampled camera, a still bloom and a box that moves, rendered with --aov (check.sh).
|
||||
import { AbsoluteFill, registerRoot, Composition, useGameState } from "raea";
|
||||
import { Bloom, Canvas3D, ToneMapping, manifold } from "raea/3d";
|
||||
import { Camera3d } from "raea/camera";
|
||||
import { AmbientLight, DirectionalLight } from "raea/light";
|
||||
import { Mesh3d } from "raea/mesh";
|
||||
import { StandardMaterial } from "raea/pbr";
|
||||
import { Transform } from "raea/transform";
|
||||
|
||||
const GROUND = manifold.box(20, 1, 20).move(0, -0.5, 0);
|
||||
const BOX = manifold.box(1.5, 1.5, 1.5);
|
||||
|
||||
function Game() {
|
||||
const t = useGameState({ t: 0 }, (s) => ({ t: s.t + 1 })).t;
|
||||
return (
|
||||
<AbsoluteFill style={{ background: "#202830" }}>
|
||||
<Canvas3D>
|
||||
<Camera3d transform={Transform.fromXyz(6, 3, 8).lookingAt([0, 0.8, 0], [0, 1, 0])} projection={{ Perspective: { fov: 0.8, near: 0.1, far: 100 } }} />
|
||||
<DirectionalLight name="sun" transform={Transform.fromXyz(10, 20, 5).lookingAt([0, 0, 0], [0, 1, 0])} illuminance={20000} shadow_maps_enabled />
|
||||
<AmbientLight brightness={200} />
|
||||
<Mesh3d name="ground" shape={GROUND}><StandardMaterial base_color="#6a7a50" perceptual_roughness={0.9} /></Mesh3d>
|
||||
<Mesh3d name="box" shape={BOX} transform={Transform.fromXyz(-1.5 + t * 0.2, 0.75, 0)}><StandardMaterial base_color="#d03020" emissive="#ffe0a0" emissive_intensity={4} /></Mesh3d>
|
||||
<ToneMapping mode="agx" />
|
||||
<Bloom intensity={0.3} threshold={0.8} />
|
||||
</Canvas3D>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
}
|
||||
|
||||
registerRoot(() => <Composition id="game" component={Game} width={320} height={180} fps={30} durationInFrames={10} />);
|
||||
@@ -0,0 +1,31 @@
|
||||
// #159: a multisampled 3D camera (no AO or <AntiAliasing>) whose post-processing changes on every frame (a bloom ramp),
|
||||
// rendered with --aov and with RAEA_PASS (check.sh). Its frames read the camera's rows through raea-sys-post's sync.
|
||||
import { AbsoluteFill, interpolate, registerRoot, Composition, useCurrentFrame } from "raea";
|
||||
import { Bloom, Canvas3D, ToneMapping, manifold } from "raea/3d";
|
||||
import { Camera3d } from "raea/camera";
|
||||
import { AmbientLight, DirectionalLight } from "raea/light";
|
||||
import { Mesh3d } from "raea/mesh";
|
||||
import { StandardMaterial } from "raea/pbr";
|
||||
import { Transform } from "raea/transform";
|
||||
|
||||
const GROUND = manifold.box(20, 1, 20).move(0, -0.5, 0);
|
||||
const BOX = manifold.box(1.5, 1.5, 1.5);
|
||||
|
||||
function Ramp() {
|
||||
const f = useCurrentFrame();
|
||||
return (
|
||||
<AbsoluteFill style={{ background: "#202830" }}>
|
||||
<Canvas3D>
|
||||
<Camera3d transform={Transform.fromXyz(6, 3, 8).lookingAt([0, 0.8, 0], [0, 1, 0])} projection={{ Perspective: { fov: 0.8, near: 0.1, far: 100 } }} />
|
||||
<DirectionalLight name="sun" transform={Transform.fromXyz(10, 20, 5).lookingAt([0, 0, 0], [0, 1, 0])} illuminance={20000} shadow_maps_enabled />
|
||||
<AmbientLight brightness={200} />
|
||||
<Mesh3d name="ground" shape={GROUND}><StandardMaterial base_color="#6a7a50" perceptual_roughness={0.9} /></Mesh3d>
|
||||
<Mesh3d name="box" shape={BOX} transform={Transform.fromXyz(-1.5 + f * 0.2, 0.75, 0)}><StandardMaterial base_color="#d03020" emissive="#ffe0a0" emissive_intensity={4} /></Mesh3d>
|
||||
<ToneMapping mode="agx" />
|
||||
<Bloom intensity={interpolate(f, [0, 9], [0.1, 0.6])} threshold={0.8} />
|
||||
</Canvas3D>
|
||||
</AbsoluteFill>
|
||||
);
|
||||
}
|
||||
|
||||
registerRoot(() => <Composition id="ramp" component={Ramp} width={320} height={180} fps={30} durationInFrames={10} />);
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# #162: every still of a batch (--at A,B,C in one run) shows its own frame's time, as it does alone and as a scene
|
||||
# stepped through every frame before it does. Since #77 a still of a scene no plugin carries state for isn't stepped to,
|
||||
# and the plugins' clock then never moved: every still sampled globals.time 0, and a batch's later frames drew its
|
||||
# first frame's <Material> uniforms (they land as keyed rows). time.tsx's face shows globals.time on its left half and
|
||||
# a uniform the frame gives its time on its right, so the halves match only when Time is the frame's. Its "time"
|
||||
# composition is drawn at 90, 30, 60 in one run (the clock forwards and back) and at 90 alone, and must step no frame
|
||||
# to reach them; "stepped" (the same face with an animation player, so its stills are stepped to, as 0.1.0 drew every
|
||||
# still) at the same three. Each frame's halves must match within 1 level, each "time" frame must match the "stepped"
|
||||
# one and 90 alone the batch's 90 (within 1 level), and 90 must be brighter than 60 and 60 than 30. Exits 1 on a failure.
|
||||
# bench/at-time/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
|
||||
cd "$(dirname "$0")/../.." || exit 2
|
||||
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
||||
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
|
||||
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-at-time.XXXXXX")
|
||||
trap 'rm -rf "$OUT"' EXIT
|
||||
draw() { # NAME COMPOSITION AT: the frames in $OUT/NAME, the plugin clock's trace in $OUT/NAME.log
|
||||
RAEA_PLUGIN_TRACE=1 "$BIN" render bench/at-time/time.tsx --composition "$2" --at "$3" -o "$OUT/$1" > "$OUT/$1.log" 2>&1 && [ -f "$OUT/$1/frame-00000.png" ] || { echo "FAIL $1: the render failed"; grep -v "^plugin clock" "$OUT/$1.log" | tail -4 | sed 's/^/ /'; exit 1; }
|
||||
}
|
||||
draw batch time 90,30,60
|
||||
draw lone time 90
|
||||
draw stepped stepped 90,30,60
|
||||
status=0
|
||||
fail() { echo "FAIL $*"; status=1; }
|
||||
steps() { grep -c "^plugin clock: .* step$" "$OUT/$1.log"; }
|
||||
(( $(steps batch) == 0 && $(steps lone) == 0 )) || fail "the time stills stepped $(steps batch) and $(steps lone) frames, wanted none (it has nothing a plugin carries)"
|
||||
(( $(steps stepped) > 0 )) || fail "the stepped stills stepped no frame, so they show nothing of the stepped clock"
|
||||
half() { magick "$1" -crop "24x48+$2+8" +repage -format "%[fx:int(255*mean.r+0.5)]" info:; } # FILE X: a half's grey
|
||||
apart() { magick "$1" "$2" -compose difference -composite -format "%[fx:int(255*maxima+0.5)]" info:; }
|
||||
k=0
|
||||
for at in 90 30 60; do
|
||||
f=$(printf 'frame-%05d.png' $k)
|
||||
for run in batch stepped; do
|
||||
t=$(half "$OUT/$run/$f" 4) u=$(half "$OUT/$run/$f" 36)
|
||||
(( t - u <= 1 && u - t <= 1 )) && echo "ok $run frame $at: globals.time's half $t, the uniform's $u" || fail "$run frame $at: globals.time's half is $t and the uniform's $u: Time isn't the frame's"
|
||||
done
|
||||
d=$(apart "$OUT/batch/$f" "$OUT/stepped/$f")
|
||||
(( d <= 1 )) || fail "frame $at differs from the stepped scene's by up to $d levels"
|
||||
eval "grey_$at=$(half "$OUT/batch/$f" 4)"
|
||||
k=$((k + 1))
|
||||
done
|
||||
d=$(apart "$OUT/lone/frame-00000.png" "$OUT/batch/frame-00000.png")
|
||||
(( d <= 1 )) && echo "ok frame 90 alone matches the batch's frame 90" || fail "frame 90 alone differs from the batch's frame 90 by up to $d levels"
|
||||
(( grey_90 > grey_60 && grey_60 > grey_30 )) || fail "the batch's frames 30, 60 and 90 are $grey_30, $grey_60 and $grey_90: frozen, not moving on"
|
||||
[ $status = 0 ] && echo "PASS every still of a batch shows its own frame's time, as alone and as stepped to"
|
||||
exit $status
|
||||
@@ -0,0 +1,35 @@
|
||||
// #162's composition, which bench/at-time/check.sh draws: one face, its left half grey by Bevy's globals.time and its
|
||||
// right half by a <Material> uniform the frame gives its time in seconds (each at a quarter of it), so the halves match
|
||||
// only when Time is the frame drawn's. "time" holds nothing a plugin carries, so a still draws only its own frame
|
||||
// (#77); "stepped" is the same face with an animation player on it (it plays nothing), which Bevy carries from frame
|
||||
// to frame, so a still is stepped to through every frame before it.
|
||||
import { Composition, registerRoot, useCurrentFrame } from "raea";
|
||||
import { Transform } from "raea/transform";
|
||||
import { Camera3d } from "raea/camera";
|
||||
import { Cuboid, Mesh3d } from "raea/mesh";
|
||||
import { BevyComponent } from "raea/3d";
|
||||
import { Material } from "@raea/render/bevy3d";
|
||||
|
||||
function Shot({ stepped }: { stepped: boolean }) {
|
||||
const f = useCurrentFrame();
|
||||
return (
|
||||
<>
|
||||
<Mesh3d transform={Transform.fromXyz(0, 0, 0)}>
|
||||
<Cuboid half_size={[2, 2, 0.01]} />
|
||||
<Material fragment="time.wesl" uniforms={{ seconds: f / 30 }} />
|
||||
{stepped ? <BevyComponent type="bevy_animation::AnimationPlayer" value={{ active_animations: {} }} /> : null}
|
||||
</Mesh3d>
|
||||
<Camera3d transform={Transform.fromXyz(0, 0, 3).lookingAt([0, 0, 0])} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const Pure = () => <Shot stepped={false} />;
|
||||
const Stepped = () => <Shot stepped />;
|
||||
|
||||
registerRoot(() => (
|
||||
<>
|
||||
<Composition id="time" component={Pure} width={64} height={64} fps={30} durationInFrames={120} />
|
||||
<Composition id="stepped" component={Stepped} width={64} height={64} fps={30} durationInFrames={120} />
|
||||
</>
|
||||
));
|
||||
@@ -0,0 +1,13 @@
|
||||
// The left half grey by Bevy's globals.time, the right by the uniform the frame gives: each a quarter of its seconds.
|
||||
import bevy_pbr::render::{
|
||||
mesh_view_bindings::globals,
|
||||
forward_io::VertexOutput,
|
||||
};
|
||||
|
||||
@group(constants::MATERIAL_BIND_GROUP) @binding(0) var<uniform> seconds: f32;
|
||||
|
||||
@fragment
|
||||
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
let t = select(seconds, globals.time, in.uv.x < 0.5) / 4.0;
|
||||
return vec4<f32>(t, t, t, 1.0);
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# text-overflow: ellipsis cuts only text that doesn't fit. A label shrink-wrapped by its box (a grid of picker cells,
|
||||
# each name centred under a dot) drew "Fr…" and "Mou…" for words that fit: the ellipsis was measured against the box's
|
||||
# rounded width, up to a pixel narrower than the text it wraps (each edge rounds on its own), and blitz-paint now
|
||||
# measures against the unrounded width the text was laid out in. Checked, each page rendered twice, once with
|
||||
# `text-overflow: ellipsis` and once with `clip`:
|
||||
# fit shrink-wrapped labels at many x offsets: the two renders are byte-identical (no ellipsis drawn)
|
||||
# over a word wider than its 40 px box: the two renders differ (the ellipsis is drawn)
|
||||
# Exits 1 on a failure.
|
||||
# bench/ellipsis-fit/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
|
||||
cd "$(dirname "$0")/../.." || exit 2
|
||||
BIN=${RAEA_BIN:-$PWD/target/release/raea}
|
||||
export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
|
||||
OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-ellipsis-fit.XXXXXX")
|
||||
trap 'rm -rf "$OUT"' EXIT
|
||||
status=0
|
||||
page() { # NAME OVERFLOW BODY
|
||||
cat > "$OUT/$1-$2.html" <<HTML
|
||||
<!doctype html><html><head><meta charset="utf-8"><style>
|
||||
html,body{margin:0;width:640px;height:200px;background:#0a0a0a;font:11px/16px system-ui,sans-serif;color:#aaa}
|
||||
.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;width:617px;padding:9px 11.5px}
|
||||
.cell{display:flex;min-width:0;flex-direction:column;align-items:center;gap:4px;padding:8px 4px 6px}
|
||||
.dot{width:30px;height:30px;border-radius:15px;background:#6c6}
|
||||
.t{max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:$2}
|
||||
.narrow{width:40px;margin:20px}
|
||||
</style></head><body><div id="root" data-composition-id="main" data-start="0" data-width="640" data-height="200" data-duration="1">$3</div></body></html>
|
||||
HTML
|
||||
"$BIN" render "$OUT/$1-$2.html" -o "$OUT/$1-$2.png" > "$OUT/$1-$2.log" 2>&1 || { echo "FAIL $1 ($2) didn't render"; cat "$OUT/$1-$2.log"; status=1; }
|
||||
}
|
||||
cells=""
|
||||
for w in Owl Frog Dog Mouse Bunny Bear Fox Cat Tabby Snow Rose Sky Mint Slate; do cells+="<div class=\"cell\"><span class=\"dot\"></span><span class=\"t\">$w</span></div>"; done
|
||||
for ov in ellipsis clip; do
|
||||
page fit "$ov" "<div class=\"grid\">$cells</div>"
|
||||
page over "$ov" "<div class=\"narrow t\">Mousetrap</div>"
|
||||
done
|
||||
cmp -s "$OUT/fit-ellipsis.png" "$OUT/fit-clip.png" && echo "PASS fit: shrink-wrapped labels draw no ellipsis" || { echo "FAIL fit: an ellipsis was drawn on a label that fits"; status=1; }
|
||||
cmp -s "$OUT/over-ellipsis.png" "$OUT/over-clip.png" && { echo "FAIL over: a word wider than its box drew no ellipsis"; status=1; } || echo "PASS over: a word wider than its box ends in an ellipsis"
|
||||
exit $status
|
||||
Executable
+127
@@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
# IX14 (docs/index.feature): the Index's fast pass, measured on a fixed public set. Prints pictures a second (as the
|
||||
# indexer counts them and from the command's start to its last row searchable), the seconds until the first pictures
|
||||
# are searchable, peak memory, warm search time, and precision@5 for a fixed list of words.
|
||||
#
|
||||
# bench/index/run.sh [RAEA_BINARY] [N] (default: raea on PATH, 10000 pictures)
|
||||
#
|
||||
# The set: the first N of Open Images V4's 41,620 validation pictures by id (CC BY 2.0, served at 1024 px on their long
|
||||
# side from the dataset's public bucket), downloaded once into RAEA_BENCH_CACHE (default ~/.cache/raea-bench/index,
|
||||
# about 300 KB a picture). Precision@5 asks "a photo of a <label>" for each label in LABELS with at least 10 pictures in
|
||||
# the set, and counts a hit right when Open Images' human-verified labels (CC BY 4.0) give the picture that label.
|
||||
# The labels aren't exhaustive (a dog nobody labelled counts as a miss), so the figure is a floor, for comparing runs.
|
||||
# Each run indexes into a new home; nothing touches ~/.raea/library/fast.
|
||||
set -uo pipefail
|
||||
RAEA=${1:-raea}
|
||||
N=${2:-10000}
|
||||
C=${RAEA_BENCH_CACHE:-$HOME/.cache/raea-bench/index}
|
||||
OI=https://storage.googleapis.com/openimages
|
||||
LABELS="Dog Cat Car Bird Flower Tree Building Boat Horse Bicycle Airplane Food Guitar Train Bus Pizza Clock Chair Book
|
||||
Sunglasses Skyscraper Beer Cake Butterfly Fish Motorcycle Truck Tower Castle Wine Coffee Hat Drum Piano Cattle Sheep
|
||||
Elephant Lighthouse Fountain Tent Umbrella Laptop Table Bed Window Sculpture"
|
||||
command -v jq >/dev/null || { echo "bench/index: needs jq" >&2; exit 2; }
|
||||
now() { perl -MTime::HiRes=time -e 'printf "%.3f", time'; }
|
||||
mkdir -p "$C/pictures" || exit 2
|
||||
cd "$C" || exit 2
|
||||
for f in 2018_04/validation/validation-images-with-rotation.csv v5/validation-annotations-human-imagelabels-boxable.csv v5/class-descriptions-boxable.csv; do
|
||||
[ -s "${f##*/}" ] || curl -sfL -o "${f##*/}" "$OI/$f" || { echo "bench/index: couldn't fetch $OI/$f" >&2; exit 2; }
|
||||
done
|
||||
tail -n +2 validation-images-with-rotation.csv | cut -d, -f1 | LC_ALL=C sort | head -n "$N" > ids.txt
|
||||
[ "$(wc -l < ids.txt)" -eq "$N" ] || { echo "bench/index: the set has fewer than $N pictures" >&2; exit 2; }
|
||||
# the pictures not here yet, 16 at a time
|
||||
missing=$(while read -r id; do [ -s "pictures/$id.jpg" ] || echo "$id"; done < ids.txt)
|
||||
if [ -n "$missing" ]; then
|
||||
echo "bench/index: downloading $(wc -l <<< "$missing" | tr -d ' ') pictures into $C/pictures"
|
||||
rm -f pictures/*.part
|
||||
xargs -P 16 -I{} sh -c 'curl -sf -o "pictures/{}.part" "https://s3.amazonaws.com/open-images-dataset/validation/{}.jpg" && mv "pictures/{}.part" "pictures/{}.jpg" && echo {}' <<< "$missing" \
|
||||
| awk 'NR % 500 == 0 { print " " NR " downloaded"; fflush() }'
|
||||
fi
|
||||
lost=$(while read -r id; do [ -s "pictures/$id.jpg" ] || echo "$id"; done < ids.txt | wc -l | tr -d ' ')
|
||||
[ "$lost" -le $((N / 100)) ] || { echo "bench/index: $lost of $N pictures couldn't be downloaded" >&2; exit 2; }
|
||||
# the run's own folder of the set (links, so the cache's folder can hold more than N)
|
||||
W=$(mktemp -d "${TMPDIR:-/tmp}/ixbench.XXXX")
|
||||
trap 'rm -rf "${W:?}"' EXIT
|
||||
mkdir "$W/set"
|
||||
sed 's/$/.jpg/' ids.txt | (cd pictures && xargs -J % ln % "$W/set/" 2>/dev/null)
|
||||
have=$(ls "$W/set" | wc -l | tr -d ' ')
|
||||
|
||||
# the fast pass, from a cold start: the command's own time, its peak memory, and its progress lines
|
||||
t0=$(now)
|
||||
/usr/bin/time -l "$RAEA" index add "$W/set" --json --home "$W/home" > "$W/add.jsonl" 2> "$W/add.err"
|
||||
code=$?
|
||||
t1=$(now)
|
||||
[ $code -eq 0 ] || { echo "bench/index: raea index add exited $code" >&2; tail -5 "$W/add.err" >&2; exit 1; }
|
||||
last=$(grep '"stage":"done"' "$W/add.jsonl" | tail -1)
|
||||
[ -n "$last" ] || { echo "bench/index: the fast pass never said done" >&2; tail -3 "$W/add.jsonl" >&2; exit 1; }
|
||||
done_n=$(jq -r .done <<< "$last"); failed=$(jq -r .failed <<< "$last"); rate=$(jq -r .per_sec <<< "$last"); secs=$(jq -r .seconds <<< "$last")
|
||||
first=$(jq -r 'select(.done > 0) | .seconds' "$W/add.jsonl" | head -1)
|
||||
peak=$(awk '/maximum resident set size/ {print $1}' "$W/add.err")
|
||||
wall=$(perl -e "printf '%.1f', $t1 - $t0")
|
||||
|
||||
# precision@5 and warm search time, through serve (the text tower loaded once, as the app keeps it)
|
||||
tr -d '\r' < class-descriptions-boxable.csv > "$W/classes.csv"
|
||||
awk -F, 'NR > 1 && $4 == 1 {print $1, $3}' validation-annotations-human-imagelabels-boxable.csv | tr -d '\r' | LC_ALL=C sort -u > "$W/pos.txt"
|
||||
LC_ALL=C sort ids.txt > "$W/ids.sorted"
|
||||
asks="$W/asks.jsonl"; : > "$asks"; : > "$W/asked.txt"
|
||||
echo '{"id":"warm","op":"warm"}' >> "$asks"
|
||||
for l in $LABELS; do
|
||||
m=$(awk -F, -v n="$l" '$2 == n {print $1}' "$W/classes.csv")
|
||||
[ -n "$m" ] || { echo "bench/index: no class $l" >&2; continue; }
|
||||
n=$(awk -v m="$m" '$2 == m {print $1}' "$W/pos.txt" | LC_ALL=C join - "$W/ids.sorted" | wc -l | tr -d ' ')
|
||||
[ "$n" -ge 10 ] || continue
|
||||
q="a photo of a $(tr '[:upper:]' '[:lower:]' <<< "$l")"
|
||||
jq -nc --arg id "$l" --arg q "$q" '{id: $id, op: "search", q: $q, k: 5}' >> "$asks"
|
||||
echo "$l $m $n" >> "$W/asked.txt"
|
||||
done
|
||||
"$RAEA" index serve --home "$W/home" < "$asks" > "$W/answers.jsonl" 2> "$W/serve.err"
|
||||
right=0; asked=0; : > "$W/ms.txt"
|
||||
while read -r l m n; do
|
||||
a=$(jq -c --arg id "$l" 'select(.id == $id)' "$W/answers.jsonl")
|
||||
[ -n "$a" ] || { echo "bench/index: no answer for $l" >&2; continue; }
|
||||
hits=$(jq -r '.hits[].name | sub("\\.jpg$"; "")' <<< "$a")
|
||||
r=$(for h in $hits; do grep -qx "$h $m" "$W/pos.txt" && echo 1; done | wc -l | tr -d ' ')
|
||||
right=$((right + r)); asked=$((asked + 1))
|
||||
jq -r '.ms.words + .ms.search' <<< "$a" >> "$W/ms.txt"
|
||||
[ -n "${IXBENCH_VERBOSE:-}" ] && echo " $l ($n in the set): $r of 5"
|
||||
done < "$W/asked.txt"
|
||||
p5=$(perl -e "printf '%.3f', $right / (5 * ($asked || 1))")
|
||||
ms=$(sort -n "$W/ms.txt" | awk '{a[NR] = $1} END {printf "%.1f", a[int((NR + 1) / 2)]}')
|
||||
|
||||
# videos: two Blender open films (Elephants Dream, CC BY 2.5; Tears of Steel, CC BY 3.0; 720p H.264) cut once into
|
||||
# 30 s clips without re-encoding, as a library of short clips is; the fast pass reads each clip's poster and a frame
|
||||
# every 4 s (IX2). IXBENCH_NO_VIDEO=1 skips them
|
||||
vids=0; vmin=0; vwall=0
|
||||
if [ -z "${IXBENCH_NO_VIDEO:-}" ]; then
|
||||
command -v ffmpeg >/dev/null || { echo "bench/index: the videos need ffmpeg (or IXBENCH_NO_VIDEO=1)" >&2; exit 2; }
|
||||
mkdir -p clips
|
||||
if [ -z "$(ls clips 2>/dev/null)" ]; then
|
||||
for f in ED/elephantsdream-720-h264-st-aac.mov demo/movies/ToS/tears_of_steel_720p.mov; do
|
||||
src="$W/${f##*/}"
|
||||
echo "bench/index: fetching https://download.blender.org/$f"
|
||||
curl -sfL -o "$src" "https://download.blender.org/$f" || { echo "bench/index: couldn't fetch $f" >&2; exit 2; }
|
||||
ffmpeg -v error -i "$src" -map 0:v:0 -map 0:a:0? -c copy -f segment -segment_time 30 -reset_timestamps 1 "clips/${f##*/}-%03d.mov" || exit 2
|
||||
rm -f "$src"
|
||||
done
|
||||
fi
|
||||
vids=$(ls clips | wc -l | tr -d ' ')
|
||||
vmin=$(for c in clips/*.mov; do ffprobe -v error -show_entries format=duration -of csv=p=0 "$c"; done | awk '{s += $1} END {printf "%.1f", s / 60}')
|
||||
mkdir "$W/clips" && ln clips/*.mov "$W/clips/"
|
||||
t0=$(now)
|
||||
"$RAEA" index add "$W/clips" --json --home "$W/vhome" > "$W/vadd.jsonl" 2> "$W/vadd.err" || { echo "bench/index: raea index add (videos) failed" >&2; tail -5 "$W/vadd.err" >&2; exit 1; }
|
||||
t1=$(now)
|
||||
vdone=$(grep '"stage":"done"' "$W/vadd.jsonl" | tail -1 | jq -r .done)
|
||||
[ "$vdone" = "$vids" ] || echo "bench/index: only ${vdone:-0} of $vids clips searchable" >&2
|
||||
vwall=$(perl -e "printf '%.1f', $t1 - $t0")
|
||||
fi
|
||||
|
||||
echo "bench/index: $have pictures (Open Images V4 validation, first $N by id), $RAEA ($("$RAEA" --version 2>/dev/null | head -1))"
|
||||
echo " fast pass $done_n searchable, $failed failed: $(printf '%.0f' "$rate") pictures a second as the indexer counts ($(printf '%.1f' "$secs") s)"
|
||||
echo " from cold start $wall s for the command, $(perl -e "printf '%.0f', $done_n / $wall") pictures a second; the first searchable at $(printf '%.2f' "${first:-0}") s"
|
||||
echo " peak memory $(perl -e "printf '%.0f', ${peak:-0} / 1048576") MB"
|
||||
echo " search $ms ms warm (median of $asked; words embedded and every row scored)"
|
||||
echo " precision@5 $p5 over $asked labels (a floor: Open Images' labels aren't exhaustive)"
|
||||
[ "$vids" -gt 0 ] && echo " videos $vids clips ($vmin min) in $vwall s from cold start: $(perl -e "printf '%.1f', $vmin / $vwall") video minutes a second, $(perl -e "printf '%.1f', $vids / $vwall") clips a second"
|
||||
jq -nc --argjson n "$have" --argjson done "$done_n" --argjson rate "$rate" --argjson wall "$wall" --argjson first "${first:-0}" \
|
||||
--argjson peak "${peak:-0}" --argjson ms "$ms" --argjson p5 "$p5" --argjson asked "$asked" \
|
||||
--argjson vids "$vids" --argjson vmin "$vmin" --argjson vwall "$vwall" \
|
||||
'{pictures: $n, searchable: $done, per_sec: $rate, wall_s: $wall, first_s: $first, peak_bytes: $peak, search_ms: $ms, p5: $p5, labels: $asked, clips: $vids, clip_minutes: $vmin, clips_wall_s: $vwall}'
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"0": ["Pointer:480:60"],
|
||||
"6": ["Pointer:480:260"],
|
||||
"10": ["Pointer:480:260:down"],
|
||||
"12": ["Pointer:480:260"],
|
||||
"21": ["Pointer:480:60"]
|
||||
}
|
||||
@@ -8,7 +8,8 @@
|
||||
# React on the page with 3D in the world, picking and input replay are all here: the games (pong and platformer on
|
||||
# the page, arena3d's 3D drawn live), bevy-ts' live cases (keys, the pointer, a gamepad, the window and the World's
|
||||
# components through useQuery), the bridge's Engine reads (engine3d: a cube the World moves, React's marker reading it)
|
||||
# and pick3d (on* on 3D parts: hover, press, leave)
|
||||
# and pick3d (on* on 3D parts: hover, press, leave); an <R3F>'s own pointer events and <OrbitControls> (r3f live/pointer);
|
||||
# an app screen's button clicked through the 3D, its own timer on the frame's clock (appscreen: blitz-bevy H12)
|
||||
sdk/react/bench/games/pong/edit.tsx keys:ArrowUp,ArrowDown,,ArrowUp 0.25 0.75 1.25 1.75
|
||||
sdk/react/bench/games/platformer/edit.tsx keys:ArrowRight,ArrowRight+ArrowUp,ArrowRight, 0.25 0.75 1.25 1.75
|
||||
sdk/react/bench/games/arena3d/edit.tsx keys:ArrowRight,ArrowUp,ArrowLeft+ArrowUp,ArrowDown, 0.25 0.75 1.25 1.75
|
||||
@@ -21,3 +22,5 @@ sdk/raea/bench/bevy-ts/cases/live-window.tsx script:sdk/raea/bench/bevy-ts/cases
|
||||
sdk/raea/bench/bevy-ts/cases/text3d-readback.tsx script:sdk/raea/bench/bevy-ts/cases/live-world.json 0.3 0.6
|
||||
bench/bridge/engine3d.tsx - 0.3 0.9 1.25
|
||||
sdk/raea/bench/bevy/pick3d/edit.tsx script:bench/render-play/pick3d.json 0.1 0.2 0.3 0.4 0.6 0.9
|
||||
sdk/r3f/test/live/pointer.tsx script:sdk/r3f/test/live/pointer.json 0.2 0.4 0.6 0.9
|
||||
sdk/raea/bench/bevy/appscreen/edit.tsx script:bench/render-play/appscreen.json 0.2 0.4 0.6 0.9
|
||||
|
Can't render this file because it contains an unexpected character in line 5 and column 29.
|
@@ -52,6 +52,8 @@ pub fn base_ident(it: &Item) -> &str {
|
||||
"mesh" => it.shape.as_deref().unwrap_or_default(),
|
||||
"model" | "panel" | "plate" | "splat" | "meshseq" => it.props.get("src").and_then(Value::as_str).unwrap_or(""),
|
||||
"text" => it.props.get("text").and_then(Value::as_str).unwrap_or(""),
|
||||
// a camera drawing into an image (R3F23a): by the image, so two passes into one image a frame are #0 and #1
|
||||
"rendercam" => it.props.get("target").and_then(Value::as_str).unwrap_or(""),
|
||||
_ => "",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,925 @@
|
||||
Feature: The character SDK as one system: SOMA bodies, Kimodo motion, generated heads, creatures
|
||||
Set by the user 2026-11-15, after deciding that people's bodies standardize on SOMA (docs/hands.feature, the
|
||||
rule of that date): one session syncs the body, the motion system, the head work and the creature work, which
|
||||
three sessions had been building apart. In the user's words, the job is to standardize the body on SOMA, Kimodo,
|
||||
the head work and how creatures are managed and rigged in the character SDK; to make a whole system for
|
||||
locomotion, motion matching, staging and AI controllers for NPCs if Kimodo is the standard; and, once that is
|
||||
settled, a generative or procedural clothing system, perhaps with the mannequin as the base input and an image
|
||||
model on top, layered.
|
||||
|
||||
The user, 11-16: the character SDK ships as raea 0.1.7, and 0.1.6 is a patch for the app. What of it is on main
|
||||
before then ships in 0.1.6's binary unannounced, as 0.1.5's did.
|
||||
|
||||
This file is the map. The detail stays where it is: docs/hands.feature (arms and hands, the SOMA rule),
|
||||
docs/creatures.feature (four legs), docs/drawn-characters.feature (a drawing as a character),
|
||||
docs/character.md (the five layers and eleven principles of the rebuilt SDK, which still hold except principle
|
||||
8's skeleton), docs/skeleton.feature (the game_engine rig: replaced by CH1). A scenario here that another file
|
||||
already plans names it and does not repeat it.
|
||||
|
||||
The system on one page, as it stands 11-15 (each part names the scenarios that hold its detail):
|
||||
|
||||
Body. Every person is SOMA (NVlabs SOMA-X, Apache-2.0): one skeleton of 78 joints and 32 twist helpers the
|
||||
engine sets, one body folder for a person or a creature (skeleton.json, body.glb, parts; CH2), builds from
|
||||
SOMA's shape model. The bodies on the old game_engine rig only play until they are retired (CH1, CH1a).
|
||||
|
||||
Motion. At run time a body only plays clips, chosen by motion matching from a library on SOMA's skeleton, on the
|
||||
user's own machine, so a render and live play give the same frames (CH10, CH14a). Clips come from captures first
|
||||
(ACCAD and Quaternius, moved onto SOMA once) and from Kimodo where no capture exists, made when a project is
|
||||
built, in the cloud: between two poses with no text today (CH15a: "turn and sit", "rise and walk off"), from a
|
||||
line of text once its encoder's licence is granted (CH11). A generated clip is judged by the checks that judge
|
||||
captures before it is kept (CH13). Locomotion is that matcher following a path, its stops landing on their marks.
|
||||
|
||||
Staging and NPCs. A performance is a list of acts: go, wait, look, face, sit, take (and put, throw, hand over and
|
||||
use, which are takes with another spec) and do (a line of text). A script, a behaviour tree and a language model
|
||||
all return those acts to `direct`, which asks a character's controller only when its acts run out, and the
|
||||
matcher carries them out (CH16a). An act no clip plays is stood through and written down as a clip to make, and
|
||||
the build turns that list into Kimodo clips (CH17a, CH15). Hands, eyes and contacts are laid over the matched
|
||||
pose by the Rust takes and the look solver, each saying how far it moved the pose (CH18a).
|
||||
|
||||
Heads. The face session's head (GNM Head, Apache-2.0) is a Character part skinned to SOMA's neck, head and eye
|
||||
joints with about fifty named expressions, ending on the collar ring of a body built without its head; hair is
|
||||
cards skinned to Head with a stray distance per vertex; hats and glasses are rigid parts on Head (CH20a, CH21a).
|
||||
|
||||
Creatures. The raccoon session's flow (docs/creatures.feature): a creature is its own skeleton set down by measure
|
||||
first, its model generated on a grey mannequin of that skeleton and weighted there, moved by a gait solver that
|
||||
owns contact, carriage and the order of the legs, with anymove's generated clips for timing where it has them
|
||||
(CH30 to CH32). The same body folder and the same clip format as a person; Kimodo is for people only.
|
||||
|
||||
Clothes. Pictures of the dressed mannequin measured onto SOMA's skin (CH40 to CH46) were built and rejected by
|
||||
the user on the body. Garments are now sewing patterns cut to SOMA's measurements and draped by a cloth of our
|
||||
own on the GPU (CH47a, CH48a), with a model trained on that data proposed (CH48). CH47 and CH48 are the user's
|
||||
to decide.
|
||||
|
||||
Who holds what: this plan's session the body, motion, staging and clothes, and the syncing; the face session
|
||||
heads and hair; the raccoon session creatures. A change to a joint name, a unit, an axis or a file's layout is
|
||||
made here first (CH0).
|
||||
|
||||
Rule: The standard, and who builds to it
|
||||
|
||||
Scenario: CH0. One plan, four parts, one place they meet
|
||||
# The parts and the sessions that hold them on 11-15: the body, motion and clothing (this plan's session);
|
||||
# heads and hair (the face session: a fitted head model with expressions, from close-up photographs); the
|
||||
# creature solver and its test animal (the raccoon session); anymove on that animal (this plan's session,
|
||||
# validated by the raccoon session). Agreements between sessions are written here as scenarios, so a
|
||||
# session that starts cold reads them.
|
||||
Then every part delivers a folder a `<Character>` loads, in the format of CH2
|
||||
And a change to a joint name, a unit, an axis or a file's layout is made here first, then built
|
||||
|
||||
Scenario: CH1. People are on SOMA's skeleton
|
||||
# NVlabs/SOMA-X, Apache-2.0. 78 named joints (Root, Hips, Spine1-2, Chest, Neck1-2, Head, Jaw, two eyes,
|
||||
# shoulders, arms, hands with five fingers, legs, toes) and 32 twist joints the engine sets (four along
|
||||
# each upper arm, forearm, thigh and shin). SOMA's files are in centimetres; raea's are in metres, Y up,
|
||||
# facing +Z. Replaces docs/skeleton.feature's game_engine rig and docs/character.md's principle 8.
|
||||
Then no new work on people names a game_engine joint
|
||||
And the readers of the old names (sdk/character, sdk/body, systems/body, systems/grab, their tools and
|
||||
tests) are moved to SOMA's names as one refactor, not through an alias layer (as SK0b did before)
|
||||
And the people built on the old rig are retired once a SOMA person renders in each scene that used one
|
||||
|
||||
@done
|
||||
Scenario: CH1a. The old SDK names SOMA's joints
|
||||
# 11-15. sdk/character's bones.ts `B` (the one place the SDK takes joint names from) gives SOMA's names:
|
||||
# Hips, Spine1, Spine2, Chest, Neck1, Head, LeftShoulder, LeftArm, LeftForeArm, LeftHand, LeftLeg,
|
||||
# LeftShin, LeftFoot, LeftToeBase, and a finger's phalanges 1 to 3 as SOMA's 2 to 4 (its 1 is the bone in
|
||||
# the palm; the thumb's are 1 to 3). A body made on the old rig (turbo, teal, the PSX people) still loads:
|
||||
# `joint` finds a SOMA name on it by its old one, the name helpers (side, mirror, finger) read both, and
|
||||
# a BVH map keyed by old names still maps. That fallback is the only place the old names stay, and it goes
|
||||
# with the last old body (CH1's last line). systems/body's `Skeleton::joint` reads a SOMA name on an old
|
||||
# body the same way. A body named as CMU or Mixamo name theirs (LeftUpLeg, with LeftLeg the shin, which is
|
||||
# SOMA's thigh) is refused with a message rather than read wrong; the gitignored local "kid" example is
|
||||
# one. The conformance tests' stick body is on SOMA's names; 27 of the character test's 29 pass, the 2
|
||||
# that fail failing the same way on the code before the change (a buckle on a planted knee, a dropped box).
|
||||
Then the SDK names SOMA's joints, and the bodies on the old rig still play until they are retired
|
||||
|
||||
Scenario: CH2. A body folder is the same for a person and a creature
|
||||
Given a folder with skeleton.json (name, rig, height, joints by name with parent and rest place, landmarks,
|
||||
skin samples per joint), body.glb (skinned to those joints: one skin, or several closed pieces each
|
||||
weighted to its own joints, as the raccoon's trunk and legs are), and optional head.glb, clothes and clips
|
||||
Then `rig` says which skeleton the joints are: "soma" for people, the creature's own name for an animal
|
||||
And helper joints (twist joints, a belly, ears, eye joints) are listed as helpers: the engine or a part's
|
||||
own layer sets them, and no pose, clip or call has to name them
|
||||
|
||||
@done
|
||||
Scenario: CH2a. Bodies, heads and creatures are read as one form and checked
|
||||
# 11-15. sdk/body/src/folder.ts (private repo 47ddc16) reads a folder's skeleton.json, or a creature's
|
||||
# <name>.rig.json (docs/creatures.feature CR1's form) as the same skeleton: `rig` the creature's name, each
|
||||
# bone's tail its `ends` entry, the height its highest joint or mark, the eyes between its eye marks, and
|
||||
# skin samples taken from its skinned mesh (samples.ts) since a rig carries none. Helpers not listed are
|
||||
# found by name (SOMA's 32 twist joints, its eyes and jaw; a creature's ears, lids, belly and jaw).
|
||||
# `bun sdk/body/src/folder.ts BODY [HEAD]` lists a folder's problems against CH2, CH20 and CH21. Run on
|
||||
# the work as it stands: SOMA's headless body with the generated head, its four hair styles, glasses, cap
|
||||
# and beanie has none (the head's collar ring lies exactly on the body's 80 ring vertices; hair and hats
|
||||
# ride Head alone; each hair mesh carries a stray distance per vertex). The raccoon has none: its rig reads
|
||||
# as the same skeleton, its 58 joints all skinned, 1,392 skin samples with the lowest on the ground.
|
||||
# Left to the owners, as notes rather than faults: the head carries 20 expressions where CH20 asks about
|
||||
# fifty; head.json names its body by an absolute path on one machine; the raccoon's body is raccoon.glb,
|
||||
# not body.glb; SOMA's skeleton.json doesn't list its helpers (found by name).
|
||||
Then a person's folder and a creature's are read by one reader, and a folder that breaks the form says how
|
||||
|
||||
Rule: Motion: one clip format, two ways to get clips, one way to play them
|
||||
|
||||
# The position this plan takes, confirmed by the user 11-15 ("clips at run time"): motion at run time is always chosen from clips on
|
||||
# disk by motion matching, on the user's own machine, the same frame for a render and for live play. A model
|
||||
# that generates motion (Kimodo for people, anymove for creatures) is a way to MAKE clips, run when a project
|
||||
# is authored or built, in the cloud or on an NVIDIA card: Kimodo does not run on a Mac. So a game or a film
|
||||
# never waits on a model, and a project keeps working with no network. The alternative, a model called
|
||||
# while a scene plays, is not planned.
|
||||
|
||||
Scenario: CH10. One clip format, on the body's own skeleton
|
||||
# The clip file the SDK already reads is the base (sdk/body/src/clip.ts `ClipFile`: the skeleton's name,
|
||||
# the joints' names, and per clip its frame rate, the root's place as 32-bit floats and each joint's turn
|
||||
# relative to its parent as 16-bit parts). It gains the rig's name, and per clip the contacts, tags and
|
||||
# source below.
|
||||
Then a clip is each joint's turn and the root's place per frame, at its own frame rate, with its contacts
|
||||
(a list by joint name, each planted or not and where, so four legs or six fit as two do; hands and a
|
||||
seat the same way), its situation tags, and where it came from (a capture and its licence; a model, its
|
||||
prompt, seed and constraints; a procedure)
|
||||
And a capture, a generated motion and a baked procedure are the same file, so the library, the matcher and
|
||||
the checks read one thing
|
||||
|
||||
Scenario: CH11. Kimodo is a generation flow that writes clips
|
||||
# Kimodo: code Apache-2.0, weights under NVIDIA's Open Model License (commercial use allowed, outputs not
|
||||
# claimed). It needs an NVIDIA card and a gated text encoder, so it runs as a cloud step (docs/gen.feature)
|
||||
# or on a user's own card. Its inputs, from the examples it ships: one line of text; several lines with
|
||||
# durations; full-body keyframes; hand or foot targets; a path for the root; waypoints. Its output is 30
|
||||
# joints' turns and places at 30 frames a second (which Kimodo widens to SOMA's 77 by name).
|
||||
# Measured 11-15, with no text (constraints only; an empty prompt zeroes the text features, so a stand-in
|
||||
# encoder of zeros is exact), Kimodo-SOMA-RP-v1 on its own SOMA examples, 100 denoising steps, on a Modal
|
||||
# L40S or A10G: 4.3 s of GPU a 5 s clip, 7.2 s for 10 s, the model loading in 40 s; about 12 cents for the
|
||||
# whole test with the image build. Misses at the constrained frames, raw and after Kimodo's own
|
||||
# post-processing: full-body keyframes 3.2 cm mean (8.2 worst) and 0.5 (6.0); feet 1.0-1.5 and 0; hands
|
||||
# 2.8-3.3 and 2.4-3.0 (6 worst); a root path 12 cm mean (26 worst) raw and 3.1 (4.0, its margin) after;
|
||||
# foot slide on planted frames 0.06-0.26 cm a frame. So post-processing is always on. Text is not
|
||||
# measured: the encoder's base (meta-llama/Meta-Llama-3-8B-Instruct) is gated behind a form that asks for
|
||||
# the account holder's name, birth date, country and affiliation, which only Shane can fill in.
|
||||
# Runner: ~/.cache/raea-kimodo/ours/kimodo_constraints.py (and kimodo_modal.py for text).
|
||||
Given a line of text and any of: a start pose, an end pose, keyframes, a root path, hand or foot targets
|
||||
Then `raea gen` returns a clip in CH10's format, with its provenance, checked by CH13 before it is kept
|
||||
And the cost of a clip and the time it took are logged with it
|
||||
|
||||
Scenario: CH12. The library: captures first, generated where there is none
|
||||
# docs/character.md's layer 2 and its 29 situations stand. Principle 1 stands too: a capture is the
|
||||
# ceiling, so a situation that has a good capture keeps it (retargeted to SOMA once, offline).
|
||||
Then each situation lists its clips, and a situation with no capture (the ones character.md asks for: turn
|
||||
and sit, sit back, rise and walk off, pick from the floor, carry, set down) is filled by Kimodo
|
||||
And all people share one library, since they share one skeleton; a body of other proportions plays it at
|
||||
the same Froude number
|
||||
|
||||
Scenario: CH13. A generated clip earns its place
|
||||
Then a clip enters the library only after the detectors that judge captures have judged it: joint limits,
|
||||
self overlap, foot slide against its own contacts, pops, and its style vector beside the situation's
|
||||
captures
|
||||
And what fails is kept out and counted, so the pass rate of each source is a number
|
||||
|
||||
@done
|
||||
Scenario: CH14a. The rebuilt body SDK, its library and its matcher run on SOMA
|
||||
# 11-15. sdk/body (the rebuilt SDK of docs/character.md) names SOMA's joints: its roles keep the keys of
|
||||
# its tables, its limits are re-measured over the library on SOMA (8,848 frames), and the elbow's fold
|
||||
# axis is read from the captures, SOMA's rest elbow being nearly straight. The library's 60 clips (ACCAD,
|
||||
# Quaternius) were moved from the old rig joint for joint (sdk/body/tools/resoma.ts: a joint's world turn
|
||||
# after the turn that lays SOMA's rest bone on the source's, hands by their knuckles, the wrist's turn
|
||||
# about the forearm given to the forearm, contacts carried). On it the matcher follows a path (stand,
|
||||
# walk, turn, stand, walk back, stop): 449 frames over 10 clips with 20 switches, planted feet sliding
|
||||
# 17 mm at worst (8 mm on the old rig's own suite), no joint past a limit, drawn on SOMA's body with the
|
||||
# twist joints set (raea/character `withTwists`). 23 of the SDK's 27 tests pass; the four that don't are
|
||||
# the hand layer (the cup grasp, hands in the lap, finger IK), which needs SOMA's fingers and a shell.
|
||||
# Not moved yet: the old SDK (sdk/character: its matcher, items, ragdoll), the arms and hands in Rust
|
||||
# (systems/grab's takes name the old joints), and the turbo suite's cases as checks.
|
||||
Then a body on SOMA walks where a path says from the library's captures
|
||||
|
||||
Scenario: CH14. Locomotion is motion matching over that library
|
||||
# Built on the old rig: sdk/body/src/loco (the chooser, the feature database, the matcher, inertialized
|
||||
# switches, feet held by their contacts, the head steadied). This scenario is that code on SOMA.
|
||||
# 11-15: the turbo suite's script (tools/motion-check.ts) is in no history, so its eight cases are rebuilt
|
||||
# from docs/locomotion.md as sdk/body/tools/suite.ts, scoring what it scored with bars taken from the
|
||||
# captures where it can (jolts against the captures' 99th percentile, a pop as hips' acceleration over
|
||||
# their 99.9th, head roll against the captures' own at that gait; slide by feet.ts footSlide, the old
|
||||
# suite's measure). First run on SOMA, 0 of 8 strictly: walking is good (slide 0.2 to 0.9 cm, arrive
|
||||
# within 18 cm, follow within 25), the failures are hip pops at switches in jogs and runs (31 of 36 pops
|
||||
# sit at a switch; the run curve also jolts 23 degrees against 22), slide in the jog curve, the turn of
|
||||
# 180 and errands (4 to 9 cm), and the head rolling 18 to 20 degrees on curves against 13 to 16 in the
|
||||
# captures. Moving the body at a switch onto the new clip's planted foot (align) is not the pops' cause:
|
||||
# off, it takes away a few and the walk curve slides 15 cm. The cause: a switch blended the pose's turns
|
||||
# and the hips' height but not the hips' speed over the floor, so a run handing to a run turn at another
|
||||
# pace jumped it in a frame. Carried into the decaying offset (perform's carry, on unless no foot is down
|
||||
# in both clips, where carrying it slid a run turn's foot 22 cm): pops 36 to 21, at switches 31 to 12,
|
||||
# every other number unchanged.
|
||||
Then a body goes where a path says, by the situations the chooser allows, with every switch inertialized
|
||||
and every planted foot held
|
||||
And the turbo suite's cases pass on a SOMA person at least as well as they do today
|
||||
|
||||
@done
|
||||
Scenario: CH14b. The suite's eight cases pass on SOMA, and paths drawn at random are run beside them
|
||||
# 11-15, sdk/body (the private repository, 58fed86 and 4b1781f): 8 of 8, from 0. What each failure was:
|
||||
# Hip pops: tuning the matcher only moved the same few jumps from one path to another (the adjustment
|
||||
# toward the path comes on as a foot lifts, a turn goes about another ankle, a switch changes pace), so
|
||||
# the hips' path is evened afterwards to the captures' own largest change of speed in a frame, before the
|
||||
# feet are held (perform.ts evenHips, hipLimit): no pop in any case, the path moved by millimetres.
|
||||
# The run's curve: a straight run could not turn, so a curve of 7 m was two turn captures handed back and
|
||||
# forth every 17 frames. A curve gentler than 0.2 radians a metre is now a straight clip steered about its
|
||||
# planted ankle, and the matcher is asked for the path with that bend taken out.
|
||||
# A run's corner: the guide went through a corner of 90 degrees at 3.6 m/s and the body ran half a metre
|
||||
# past it. The guide now comes into a corner at the pace the turn captures take one (guide.ts cornerSpeed:
|
||||
# 45 degrees at 3 m/s, 90 at 1.9), and a run slowing for it may come down through run to walk.
|
||||
# The head on curves: a walk came to rest in the sway capture, filed as a way of standing, its head 19
|
||||
# degrees over. Sway is its own situation.
|
||||
# Slides: a foot in the air rode down with the hips when they came down for the other leg, and a stop's
|
||||
# closing step came in 1 cm over the floor for 20 cm. It is lifted over where the lowered hips leave it,
|
||||
# and its lift eased over as many frames as a hold (let down in three, the shin jolted 16 degrees).
|
||||
# The suite itself: jolt bars per gait (the run captures' own foot strikes failed a bar set mostly by
|
||||
# walks, in 8 to 10 per cent of their frames), slide measured on the performance's own floor.
|
||||
# Beside the eight, `SWEEP=40 bun sdk/body/tools/suite.ts` draws 40 paths at random (one to three legs, a
|
||||
# walk, a jog or a run, some with a wait): 45 of 48 pass, from 33 before the slide's cause was found. Left:
|
||||
# three paths 34 to 39 cm off their line at a sharp turn (the bar is 30).
|
||||
# Tried and taken back: the adjustment on a spring (20 to 30 cm wider at a run's corner), contacts taken
|
||||
# from the playing captures, a sole's speed read with the adjustment's carrying taken off (both held feet
|
||||
# the blend was still moving: slides of metres), a standing body held to the start captures (one path
|
||||
# ended 4 m past its mark).
|
||||
Then `bun sdk/body/tools/suite.ts` prints 8 of 8 on SOMA
|
||||
And with SWEEP=40 at least 45 of the 48 paths pass
|
||||
|
||||
@done
|
||||
Scenario: CH15a. Two situations the captures lack, made by Kimodo from two of their poses
|
||||
# 11-15. sdk/body/tools/between.ts writes Kimodo's full-body keyframes from two library frames (the first at
|
||||
# the origin facing +z, the second where and how the body must end); src/kimodo.ts crosses a pose both ways
|
||||
# by its turns (a joint's world turn from bind is Kimodo's turn from the T-pose after the body's `tpose`;
|
||||
# a library pose goes out and back with no measurable change). Kimodo runs with no text (the stand-in
|
||||
# encoder, CH11). tools/fromkimodo.ts brings each motion onto the body, puts it back on the captures'
|
||||
# elbow and knee hinges with the hands and feet where Kimodo put them (src/fix.ts `ontoRig`: Kimodo's elbows
|
||||
# fold about an axis 25 degrees off the captures', which hold to within 3 to 7), and judges it against the
|
||||
# captures it joins, measured on the same body by the same checks: no joint further past a limit and the
|
||||
# body no deeper into itself. Of several seeds the best that passes is kept, with where it came from.
|
||||
# "turn and sit" (stand, then seated on a chair 1.2 m ahead, turned round): 4 of 5 passed.
|
||||
# "rise and walk off" (from the seat to a walking stride 1.6 m on): 2 of 5 passed, the others' hands
|
||||
# 5 to 9 cm into the thigh as they push up (the walking captures it joins: 4.4 cm). 4 s of GPU a clip,
|
||||
# about a cent. Both are in the library under src/library.ts's situations of those names, and play one
|
||||
# after the other on SOMA's body (sheet3d compositions/soma_between.tsx, feed item i-acp-mwi1xhlw-59).
|
||||
# Found on the way: contacts and capsules on a SOMA body were never read (the SOMA index was carried over
|
||||
# from the old rig); a SOMA limb's skin is weighted to its twist joints, now counted as the limb's.
|
||||
Then a situation without a capture gets a clip made from the captures' own poses, judged before it is kept
|
||||
|
||||
Scenario: CH15. Between two poses
|
||||
Given where a body is and how it stands, and where it must be and how, with no clip that does it
|
||||
Then at build a clip is asked of Kimodo with both poses as keyframes and the path between, checked (CH13),
|
||||
and stored in the project, so the next build asks for nothing
|
||||
And while a scene plays live and there is no such clip, the matcher's nearest is played and the gap is
|
||||
written down as a clip to make, never papered over
|
||||
|
||||
@done
|
||||
Scenario: CH15b. A line of text made into a clip between two standing poses
|
||||
# 11-15, the first run of Kimodo's text path (the account's access to the gated Llama 3 model was granted that
|
||||
# morning). Two standing poses from the captures as keyframes, in place, 4 s, and the line "A person waves at
|
||||
# the camera with their right hand", three seeds: in each the right wrist is above its shoulder for 48 to 59 of
|
||||
# 120 frames, reaching the head's height, while the left never leaves the hip, and the hips stay within 3 cm.
|
||||
# All three pass the bar of the 19 captures that end standing (sdk/body/tools/fromkimodo.ts with a "do:"
|
||||
# name); the kept one is written to the project's made clips (made.json, read by stage.ts `madeClips`). On
|
||||
# Modal: 1.6 s a clip on the GPU after 130 s loading the model, and 26 minutes queued behind the workspace's
|
||||
# other GPU jobs. Kimodo's code has nothing tied to NVIDIA (no custom kernels; its text encoder takes Apple's
|
||||
# `mps` device), so the earlier line that it does not run on a Mac is untested, not true.
|
||||
Then a stage `do` line gets a clip made from its words, checked, and kept in the project
|
||||
|
||||
Scenario: CH15c. Kimodo on the user's own machine, in MLX
|
||||
# The user, 11-15: "lets plan that if kimodo works well we port it mlx weights or go find some". Gated on
|
||||
# an eval first: about ten lines (wave, point, shrug, clap, nod, bow, look at a watch, cross the arms,
|
||||
# scratch the head, stretch), each with a check of its own (which hand rises, where the head turns) and a look
|
||||
# by the user. If they hold, Kimodo moves to MLX, the general backend on Apple silicon already in raea
|
||||
# (raea-sys-mlx), in two halves. The text encoder (LLM2Vec: Llama 3 8B made bidirectional, with its
|
||||
# trained adapters): MLX copies of Llama 3 8B Instruct exist (mlx-community, 4-bit about 4.5 GB), so the
|
||||
# work is LLM2Vec's bidirectional mask and adapters merged onto them, checked against PyTorch's features
|
||||
# for the same lines; a line's features are kept once made, so the encoder runs once a line. The motion
|
||||
# model (a small diffusion transformer): its weights converted and run in MLX, checked against the PyTorch
|
||||
# motion for the same line, constraints, seed and noise. Before anything ships to users: the licences of
|
||||
# converted weights (NVIDIA's Open Model License for Kimodo, Meta's Llama 3 licence for the encoder).
|
||||
# 11-16. Done in Rust, no Python: raea-sys-kimodo runs Kimodo-SOMA-RP-v1's denoiser and LLM2Vec on MLX from
|
||||
# the checkpoints' own files (nothing converted: mlx-community's 8-bit Llama 3 8B Instruct, McGill-NLP's two
|
||||
# adapters run beside it unmerged), and `raea motion "LINE" [--keys KEYS.json]` writes the clip fromkimodo.ts
|
||||
# reads. Against PyTorch: the denoiser within 2e-3; a whole 100-step generation from the same noise and text
|
||||
# within 0.002 cm on every joint; constraints become the same conditions. The stated tolerance is the 8-bit
|
||||
# encoder's: cosine 0.99993 to float32, which moves the joints 0.01 to 0.74 cm on average and 1.44 cm at
|
||||
# worst over eight lines (4-bit moved them 8 cm and is not used). A seed's noise is not torch's, so a seed is
|
||||
# not the cloud's motion for that seed; measured by what it does, the local wave falls in the cloud's three
|
||||
# (a hand above the shoulder 54 to 67 of 120 frames against 48 to 59, the hips within 3 cm). Cost: the
|
||||
# motion model 1.1 GB and the encoder 8.8 GB once, then 5 s to load and read a new line (a line's numbers
|
||||
# are kept, so a line is read once) and about 8 s a 4 s clip on an M5 Pro, against the cloud's 130 s
|
||||
# loading. The eval (sdk/body tools/doeval.ts, each line's check measured on the joints; clips by
|
||||
# tools/makedo.ts, three seeds a line between standing keys): every clip passes the bar of the captures that
|
||||
# end standing; the seed kept is the one whose upper body moves most (a do line fails by standing through
|
||||
# it: one seed of three stood still through "scratch the head"), and the kept ten all do what they say
|
||||
# (seed 1 alone 7 of 10, seed 2 8, seed 3 7). Film: sheet3d out/do-eval-v1.mp4, posted for the user's look
|
||||
# (i-show-mwj21c0d-1). The user's look, 11-16: "All ten read right". Open: the user's word on shipping the
|
||||
# downloads (i-show-mwj24i8o-2: Kimodo under NVIDIA's
|
||||
# Open Model License; Meta Llama 3 under its Community License, fetched from mlx-community's ungated 8-bit
|
||||
# copy; the adapters MIT); Kimodo's own post-processing (its C++ foot-skate clean-up) is not ported.
|
||||
Given the eval's lines pass
|
||||
Then a do line's clip is made on a Mac with no GPU in the cloud, matching the cloud's within a stated
|
||||
tolerance
|
||||
And its cost is a one-off download and seconds a line
|
||||
|
||||
Scenario: CH16. Staging: a performance is a list of steps
|
||||
# Built on the old rig: matching.ts `perform(lib, {at, facing, steps})` with walk, face, wait; course.ts;
|
||||
# the take (docs/hands.feature). This is the one vocabulary for all of them.
|
||||
Then a step is one of: go (a route, a gait, a style), face, wait, take, put, throw, hand over, sit, rise,
|
||||
use (a thing's own path), look at, and do (a line of text: a gesture or an act with no step of its own)
|
||||
And `do` is made into a clip by CH11 when the project is built, and from then on is a clip like any other
|
||||
And the whole performance is a function of its steps: any frame can be asked for, and a render and live
|
||||
play agree
|
||||
|
||||
Scenario: CH17. NPC controllers speak in the same steps
|
||||
Then a controller is a function from what a character knows (where things and others are, what it holds,
|
||||
what it wants) to its next steps, asked a few times a second, never per frame
|
||||
And a scripted controller, a behaviour tree and a language model all return CH16's steps, so the motion
|
||||
under them is the same and a controller can be swapped without touching motion
|
||||
And a controller may ask for a step the library cannot play; the character does the nearest it can, and the
|
||||
ask is logged for CH15
|
||||
|
||||
@done
|
||||
Scenario: CH17a. An act no clip plays is done as near as can be and written down as a clip to make
|
||||
# 11-15. sdk/body's stage gained `do` (a line of text). With a clip made for the line (`direct`'s `made`,
|
||||
# keyed by the line in lower case with single spaces) it plays as the sitting captures do, carried on from
|
||||
# where the body stands; without one the character stands for the act's seconds and the line goes on its
|
||||
# `asks`; `toMake` gathers a cast's asks, once each, most asked first: the build step's list for Kimodo
|
||||
# (CH11, CH15). A language model's act outside the vocabulary ({"wave": "ben"}, a bare "shrug") becomes a do
|
||||
# line instead of being dropped, so what a controller wanted and could not get is counted; a known act with
|
||||
# wrong values ({"wait": -1}) is still dropped. Tested with two characters asking for one line spelled two
|
||||
# ways (listed once, asked twice) and with the library's sitting down standing in for a made clip (played,
|
||||
# no frame jump past 6 cm); the body SDK's suite is 37 of 39, the 2 failing being the hand layer's cup grasp
|
||||
# as before (private repo ee61dd1). The made clips themselves wait on Kimodo's text encoder: the user has
|
||||
# sent Meta's licence form; the account still reads 403 while it is reviewed.
|
||||
Then a controller can ask for anything, the character does the nearest it can, and the ask becomes a clip to
|
||||
make
|
||||
|
||||
@done
|
||||
Scenario: CH16a. Acts, and controllers that return them, carried out by the matcher on SOMA
|
||||
# 11-15. sdk/body's stage module: an act is go (to a point or through several, at a gait), wait, or look
|
||||
# (at a point, a named character, or nothing). `direct` plays a cast for some seconds: each character's
|
||||
# controller is asked when its acts run out (and at the start), told where it and every other character
|
||||
# is and the time; go and wait become the matcher's steps, look is laid on the pose by the look solver.
|
||||
# Controllers so far: `script` (a fixed list), `keepNear` (stay within a reach of another character,
|
||||
# looking at it), and `actsFrom`, which reads acts from outside data (a language model's JSON) and keeps
|
||||
# only those in the vocabulary. Shown with two SOMA bodies: one follows a script, the other's controller
|
||||
# was asked 16 times in 26 seconds and kept him near her. The same cast and seconds give the same frames.
|
||||
# Added the same day: face (a step toward a point or a character) and sit (the library's captures of
|
||||
# sitting down, sitting and rising, played from where the body stands and eased at each join; the scene
|
||||
# is told where to put the seat). Found while adding sit: the matcher set the body back inside its
|
||||
# guide's reach at once, and a stop that overshot on SOMA moved the hips 19 cm in one frame; the return
|
||||
# is now limited a frame, and the worst hip step in the scene is a walking pace's (4.8 cm). 31 of the
|
||||
# body SDK's 35 tests pass, the four left being the hand layer.
|
||||
# Then take: the act reserves a stretch of standing and says which frame it starts at; the scene applies
|
||||
# the engine's take (raea/character `take`: reach, grab, carry, put down or throw, a hand-over, a thing's
|
||||
# own path) over the staged pose, so put, throw, hand over and use are the same act with another spec.
|
||||
# Shown: a controller walks a character to a table and, once she stands there, has her move a cup along
|
||||
# it; she walks off after. Faults seen: she stops 25 cm past her mark, into the table's edge (the stop's
|
||||
# overshoot again); and the other character stood with raised arms, which was two turning captures
|
||||
# whose actor holds his hands up throughout: dropped from locomotion.
|
||||
# The stop's overshoot was then measured and dealt with in the matcher: over six paths a walk came to
|
||||
# rest 20 to 37 cm past its mark along its way (26 on average), whatever the path. Nothing may drag a
|
||||
# standing body back, so the walk is played again (up to four times) with each stop's mark set back by
|
||||
# what the last playing overran, and the playing whose worst stop is nearest its mark is kept: 6 cm on
|
||||
# average, 14 at worst, the planted feet's slide unchanged (7 mm). She now stands at her mark by the
|
||||
# table. The cost: a staged character is performed several times over, seconds for a scene.
|
||||
# Not in the vocabulary yet: do (a line of text made into a clip, which waits on CH11). A controller's unmet ask is not logged
|
||||
# yet (CH15).
|
||||
Then a script and a controller give acts in one vocabulary and the matcher carries them out
|
||||
|
||||
@done
|
||||
Scenario: CH18a. The takes run on a SOMA body
|
||||
# 11-15. The Rust arms and hands (docs/hands.feature) find a joint by its role on either rig, so reach,
|
||||
# grab, carry and throw run on SOMA with no second copy. The audit's six takes on SOMA's skin: holds
|
||||
# within 2 to 8 mm and no body skin in a carried thing, as on the old rig; the fingers are not tuned to
|
||||
# SOMA's hand (hand skin 22 mm into a box, no pads on a cup, 41 to 47 mm into the table as a hand leaves).
|
||||
# The joint limits have a SOMA table (the body SDK's, measured over the library on SOMA). The fingers'
|
||||
# rest curl is close to the old rig's (the thumb's first bone lies 31 degrees off the hand against 69),
|
||||
# so the misses were not a matter of rest pose. Found: the finger curl placed a knuckle from its parent
|
||||
# joint, which on the old rig is the wrist and on SOMA is a bone in the palm, so each finger was worked
|
||||
# out 8 cm from where it is. Placed from the hand's joint: finger pads on a cup go from none to 6, hand
|
||||
# skin in a box from 22 to 17 mm (the old rig's own numbers unchanged). Six takes are drawn on SOMA's
|
||||
# body (a box thrown, a cup moved, a mug drunk from, a cup passed between hands, a box at 14 kg). Left:
|
||||
# the middle finger and thumb tip 15 to 17 mm into a box, and hands 41 to 47 mm into the table as they
|
||||
# leave.
|
||||
Then a take runs on SOMA, its fingers still to be fitted to SOMA's hand
|
||||
|
||||
Scenario: CH18. What a clip cannot know is added on top, and measured
|
||||
# docs/hands.feature (reach, grab, carry, throw, look), feet and seat contacts (character.md layer 4).
|
||||
Then hands, eyes and contacts are laid over the matched pose by IK, each reporting how far it moved the pose
|
||||
And a large correction is reported as a missing clip (principle 2), which CH15 can then make
|
||||
|
||||
Rule: Heads
|
||||
|
||||
Scenario: CH20. The generated head joins the body at the collar
|
||||
# Agreed between the body and face sessions 11-15, reported to the user by the face session. The face
|
||||
# side fits a head model (Apache-2.0) to close-up photographs: identity, expressions, eyes, skin texture.
|
||||
Given head.glb skinned to SOMA's Neck1, Neck2 and Head, with SOMA's eye joints, and its expressions as
|
||||
about fifty named morph targets, and head.json (its collar ring, eye centres, morph names, neck colour,
|
||||
and the size it was fitted at, so the body's build scales the head to the body)
|
||||
Then the body's own head is cut away from the collar up when the body is built, and the neck is one mesh
|
||||
And the body's motion drives the neck and head; the face layer adds expression and the eyes on top; the
|
||||
eyes take a look target in the world and cover what the head has not turned
|
||||
And the face's skin colour is carried onto the body's skin at the seam
|
||||
And `<Character>` passes the face's weights to the head's morph targets by name (its `morphs` prop does this
|
||||
for a body's own morphs today) and takes a look target
|
||||
|
||||
@done
|
||||
Scenario: CH20a. The first generated head rides SOMA's body
|
||||
# 11-15. The body is built without its head (cut level through mid-neck at 1.515 m; its open edge written
|
||||
# as a ring of its own 80 vertices with their normals and weights); the face session's head ends on that
|
||||
# ring with those weights, so the neck is closed with no weld at run time. A Character part may name the
|
||||
# body's joints it has (`joints`), since the engine refuses a part that lacks a joint it is handed. The
|
||||
# head rides the matcher's walk, its expressions driven by name, glasses on as a one-joint part. Left: the
|
||||
# body is one flat colour against the head's baked skin (a step shows at the seam), the eyes' look target,
|
||||
# and the head's ears, which the face session is rebuilding.
|
||||
Then a generated head is drawn on SOMA's body as a part, joined at the collar
|
||||
|
||||
@done
|
||||
Scenario: CH20b. The body's skin is graded to the head at the collar
|
||||
# 11-15. Measured first (sheet3d compositions/seam_check.tsx: the headless body at rest with the head as a
|
||||
# part, lit evenly, seen close from the front, both sides and the back, the collar on the middle row): the
|
||||
# body, built in the head's neck colour, stood 8 levels of 255 lighter than the head's skin across the
|
||||
# collar at the front, 1 to 3 at the sides and back, and the line showed. `raea clothes wear ... --head
|
||||
# HEAD_DIR` (engine/cli/src/grade.ts) now writes the join into the body it dresses: the skin takes the
|
||||
# head's neck colour, and each vertex under the collar takes the colour the head's own skin has above it
|
||||
# (head.json's ring colours, evened over five round the ring: one texel a vertex drew streaks), easing into
|
||||
# the neck colour 8 cm down, as vertex colours on body.glb. The step at the front is under 1 level, 1 to 4
|
||||
# round the rest. Left: the head's own strip above the collar repeats one texel a column (its ring takes
|
||||
# its nearest rim vertex's place in the picture), the neck's outline stops flaring for 2 cm above the
|
||||
# collar, and the body's skin has none of the head's fine detail.
|
||||
Given a headless body and the head joined to its collar
|
||||
Then the body dressed with that head named has its skin in the head's neck colour, graded to the head's
|
||||
own skin at the collar, and no step of colour shows across the join
|
||||
|
||||
@done
|
||||
Scenario: CH20c. The eyes take a look target
|
||||
# 11-15. `<Character gaze={[x, y, z]}>` (sdk/character/src/character/eyes.ts): each eye joint is turned to
|
||||
# the point on top of the pose, in its head's frame, so the eyes cover what the head has not turned; no
|
||||
# further than an eye goes (35 degrees to a side, 25 down, 17 up: the head's upper lid has no morph that
|
||||
# lifts it, and at 25 up the iris went under it). A part that has the eye joints has its upper lids ride
|
||||
# the eyes down (its blink morphs raised to 0.45 at the lowest): without that the white showed over the
|
||||
# iris. Seen on the first head, straight, to each side, up and down (sheet3d compositions/gaze_check.tsx).
|
||||
# Not yet: lids that lift, and a stage act's `look` sending the eyes as well as the head.
|
||||
Given a body whose head has eye joints, and a point in the scene
|
||||
Then the eyes turn to it within their range, whatever the neck and head are doing
|
||||
And the upper lids come down with them
|
||||
|
||||
Scenario: CH21. Hair
|
||||
# Agreed with the face session 11-15. sdk/body/src/cloth.ts already moves hair and clothes that follow
|
||||
# skin. Hair cards are the face session's working choice, pending its tests; strand hair stays a reference
|
||||
# for offline renders. Open: whether spring chains under Head (helper joints) drive the cards instead.
|
||||
Then hair is a card mesh delivered with the head, attached to SOMA's Head, each vertex carrying how far it
|
||||
may stray (0 at the scalp), moved by the same follower as clothes
|
||||
And hats and glasses are rigid pieces on Head, delivered with the head
|
||||
|
||||
@done
|
||||
Scenario: CH21a. Hair cards ride the head, and a whole person stands on the standard
|
||||
# 11-15. The face session's hair (cards grown from its strand grooms, one mesh skinned to Head, a stray
|
||||
# distance per vertex in a custom attribute, four styles) is drawn as a Character part beside the head
|
||||
# and the glasses. With it a whole person is on the standard for the first time: SOMA's body, the
|
||||
# generated head joined at the neck, hair and glasses, generated clothes in two layers, walking by motion
|
||||
# matching. Not yet: the hair moving (the follower does not read the stray attribute from a part), and
|
||||
# raea's own hair shading on it (that shader wants tangents the cards do not carry, so it is drawn with
|
||||
# its own material). Both since: CH21b.
|
||||
Then a person is a body folder and parts, each made by its own flow
|
||||
|
||||
@done
|
||||
Scenario: CH21b. Generated hair moves on the follower
|
||||
# 11-15. `bun sdk/body/tools/hair.ts SKELETON.json HAIR.glb POSES.json OUT.bind.rseq SKIN.glb...` reads a
|
||||
# head's hair cards as cloth (each vertex free by its stray attribute), carries them through a
|
||||
# performance on the cloth follower, kept outside the skin as drawn (the head, the body, what it wears),
|
||||
# and writes the frames in the hair's own bind pose; a Character part draws them with
|
||||
# `cloth: { src, frame }`, so the hair keeps its cut-out and raea's hair shader (the cards carry tangents
|
||||
# now). Measured on the first head's loose hair (33,191 particles, three quarters free) over SOMA's 449
|
||||
# frame locomotion clip, as free particles more than 3 mm inside the skin, the worst of every tenth
|
||||
# frame: 3,874 carried by the head alone, 223 on the follower; the hair leaves its skinned place by 13 mm
|
||||
# on average. Three causes found on the way. The hair is generated for the head alone and hung straight
|
||||
# through the upper back (4,982 particles in the skin at rest): it is laid over the body at rest first.
|
||||
# Brought out one particle at a time, each lock was kinked at every vertex and drew as zigzags over the
|
||||
# shoulders: what the fit moves is evened along each lock. And the follower starts as the skin has it,
|
||||
# in the shoulders of the first pose: the first pose is held for 20 frames first. Left: a few locks
|
||||
# stretch down an arm (a particle strays 15 cm at most, its limit 6), the bake runs at 0.36 s a frame, and
|
||||
# the frames are baked for one performance, not followed live in play.
|
||||
Given a head's hair cards, a body with what it wears, and a performance
|
||||
Then the hair is carried by the follower through it, outside the head, the body and the clothes
|
||||
And it is drawn as a part of the character with raea's hair shader
|
||||
|
||||
Rule: Creatures
|
||||
|
||||
# The creature flow is the raccoon session's, end to end, in docs/creatures.feature (its sandbox is the
|
||||
# trashpanda project; done when it works on the raccoon and a second, more complex creature). These three
|
||||
# scenarios say only where it meets the rest. Kimodo is no part of it: its models are for human skeletons
|
||||
# only (SOMA, a humanoid robot, SMPL-X).
|
||||
|
||||
Scenario: CH30. A creature is its own skeleton, set down first
|
||||
# A creature's joints are placed by measure before its model is made, and its folder is CH2's with its
|
||||
# own rig name. Its model may be built, or generated the way the raccoon's now is: a grey mannequin of
|
||||
# the skeleton, an image model drawing the animal on it with the pose and view kept, that image made 3D,
|
||||
# and the mesh laid back on the skeleton and weighted there.
|
||||
Then a creature's rig is read from its joints (CR1), and its helper joints are named as helpers
|
||||
|
||||
Scenario: CH31. A creature moves by its solver, and by clips where it has them
|
||||
# The solver (gait by speed, planted feet, one rigging for every move: CR2 to CR9) needs no clips. Clips
|
||||
# for a creature come from anymove (patch-gg/anymove, Apache-2.0): a generated two-camera video of the
|
||||
# rigged creature, read by a joint reader trained on that creature, fitted to its rig. Like Kimodo it is a
|
||||
# cloud step that writes clips, and it films a creature on a flat floor only.
|
||||
Then a creature's clip is CH10's format on its own joints, checked as CH13 checks a person's
|
||||
And where a creature has clips for a situation the matcher plays them, and the solver holds its feet; where
|
||||
it has none, the solver makes the move
|
||||
|
||||
Scenario: CH32. anymove tried on the raccoon
|
||||
# 11-15, run end to end; not yet a pass. The raccoon's skin (no fur shells) and 36 bones on its own joints
|
||||
# were set up as an anymove creature in Blender on a Mac (its renderer made to use Metal there); the pose
|
||||
# dataset (2,200) and the joint reader were made on a cloud card in 35 minutes (held-out error 6.9 px
|
||||
# front, 4.8 side, anymove's wolf being 6.9 and 3.8); two five-second walk clips from the video model
|
||||
# both kept the split screen and the limb colours; each was read and fitted in 5.5 minutes and exported
|
||||
# as a GLB. By anymove's own measure, how well the paws' heights agree between the two views, the clips
|
||||
# score 0.23 and 0.56: under 0.5 is a reroll, 0.8 is a keep, so none of 2 passes and one is worth a look
|
||||
# (anymove reports about 7 clips for a usable move). Cost so far about 2.10 dollars: 0.52 for the clips,
|
||||
# the rest cloud time estimated from minutes. Measured against the raccoon traced from real footage (the
|
||||
# raccoon session's check, nine measures): the first two clips were smooth with good foot timing but
|
||||
# were a generic four-legged walk, the head and tail level with the back and the legs in diagonal pairs.
|
||||
# Two more clips, the prompt naming a low head, an arched back, a hanging tail and a pacing walk (0.77
|
||||
# dollars more with their captures): the carriage came into a raccoon's range (top of the head 0.74 of
|
||||
# the back's height, nose 0.32, withers 0.82) and the better clip has 7 of 9 measures in range; still
|
||||
# off in all four are the order of the legs (a fore foot 0.36 of a stride after its side's hind, a
|
||||
# raccoon's being 0.14) and the tail's tip (0.27 against 0.18). The views' agreement stayed under the
|
||||
# keep line (0.42 and 0.53), the far hind paw the weak one in all four clips. So far: a prompt sets
|
||||
# carriage, not the order of the legs; clips give timing and smoothness; CH31's split (clips for motion,
|
||||
# the solver for contact and carriage) stands. The solver's own order was wrong too, found the same day: it
|
||||
# read each leg's offset with the wrong sign, so a fore foot came down 0.26 of a stride BEFORE its hind.
|
||||
# Fixed in the creature solver (private sdk/body, d89244e, with a footfall test that fails on the old sign),
|
||||
# a fore foot lands 0.10 after its hind and the hinds 0.50 apart, as a raccoon's do; the same change keeps
|
||||
# every planted foot inside its leg's reach (setting off after standing had left one 59 mm short on the
|
||||
# raccoon, 81 on a dragon). So on the order of the legs the solver now beats anymove's clips. To come: the generated raccoon's skin and refitted joints
|
||||
# in place of the built one, and why the fore paws carry no agreement score.
|
||||
Then the raccoon has a walk from anymove, and the numbers say whether it beats the solver's walk
|
||||
|
||||
Rule: Clothes: first drawn on the mannequin by an image model (rejected), now sewing patterns (proposed)
|
||||
|
||||
# Superseded the same day: the user saw these garments on the body and rejected them ("on the body it looks
|
||||
# terrible"; the views "are not consistent at all"). CH47a and CH48a below are the direction now; CH40-CH46
|
||||
# stay as the record of what the picture method could and could not do.
|
||||
# The user's direction, 11-15: generative or procedural; perhaps the mannequin as the base input, an image
|
||||
# model on top of it, and layers from there. Tried that day on SOMA's body, and it works; what follows is
|
||||
# the standard those tests point to. The idea in one line: a garment is not a mesh of its own, it is data
|
||||
# on the body's own vertices (which are covered, how far the cloth stands off, its colour, how freely it
|
||||
# may swing), so it carries the body's skinning, twist joints included, and fits every SOMA person without
|
||||
# being refitted; only cloth that hangs free of the body (a skirt, a coat's tails, a hood) is its own mesh.
|
||||
|
||||
@done
|
||||
Scenario: CH40a. A picture of the dressed mannequin lies on the mannequin pixel for pixel, one view at a time
|
||||
# 11-15, with an image model that edits a given picture (flux_2_pro through `raea gen image --image`, 5
|
||||
# cents a picture). The mannequin: SOMA's body at rest, flat dark grey on mid grey, no perspective, 2 m
|
||||
# of height in a square frame, from the front, the back and each side (tools/soma_mannequin.py in the
|
||||
# test project writes the pictures and their cameras). Measured by laying each result over its mannequin:
|
||||
# one view, asked to change only the surface where clothing covers it: every limb, the head, the hands
|
||||
# and the feet stay where they were, front, back and both sides alike, and the clothes sit outside the
|
||||
# body's outline. Four views on one sheet in one call: the model lays the sheet out again (two fronts,
|
||||
# one side), so nothing can be laid back. A view given a second picture as the outfit to copy: it draws
|
||||
# a front again, smaller. A layer added to a dressed view ("add exactly one garment and keep everything
|
||||
# else": a jacket over the t-shirt): pose and place hold and the rest is kept. Between views drawn apart
|
||||
# the cut and the kind of garment agree from the words alone; the colour drifts (the jeans' wash).
|
||||
Then each view of a garment is drawn on its own mannequin, a layer at a time, and views agree by their words
|
||||
|
||||
@done
|
||||
Scenario: CH40b. Those pictures become an outfit on SOMA's own vertices, worn through a walk
|
||||
# 11-15, first cut (tools/soma_clothes.py in the test project). Each vertex of the body's skin is looked
|
||||
# up in the views that face it and see it (a ray to the camera meets nothing of the body): where the
|
||||
# picture shows cloth and not the mannequin's grey it is clothed and takes the cloth's colour; the mask
|
||||
# is tidied on the mesh (a bare vertex ringed by cloth is cloth, a small island is not); the clothed
|
||||
# skin, pushed 4 mm out, is the outfit, with the body's own weights. A t-shirt, jeans and shoes made
|
||||
# this way are worn by SOMA's body through the matcher's walk as a Character part (6,519 of 19,830
|
||||
# vertices). What the first cut lacks: the cloth is skin-tight (no silhouette is measured yet), the tops
|
||||
# of the shoulders and the soles are seen by no view, the colour is per vertex (soft), hems are jagged
|
||||
# along the body's own edges, toes show through shoes, and the views' colours are not matched.
|
||||
Then a drawn outfit is worn by a SOMA body in motion with no rigging step
|
||||
|
||||
@done
|
||||
Scenario: CH41a. The cloth's stand-off read at the outlines
|
||||
# 11-15. Where a view sees a clothed vertex on the body's outline (its normal across the view), the
|
||||
# picture is walked outward along the normal until the cloth ends and the backdrop begins: that distance
|
||||
# is how far the cloth stands off there. Read at 3,585 outline vertices of the t-shirt, jeans and shoes
|
||||
# (2 mm at the tenth of them, 4 at the middle, 16 at three quarters, 35 at nine tenths), spread over each
|
||||
# garment through the mesh, never under 4 mm nor over 8 cm. The jeans now hang as trousers and the shirt
|
||||
# stands off the trunk. Wrong still: the shoes are lumpy (the toes' own shape reads as outline), the tops
|
||||
# of the shoulders are bare, and a reading is one distance per vertex, so a fold is not a fold.
|
||||
Then a garment's looseness comes from its picture
|
||||
|
||||
Scenario: CH41. A garment's shape is measured, not assumed
|
||||
Given each layer's views and the views of the layer under it
|
||||
Then how far the cloth stands off the skin is read where the two outlines differ in each view (a sleeve's
|
||||
width against the arm's, a trouser leg's against the leg's), and spread round each limb between the
|
||||
views that see it, so a loose fit is loose
|
||||
And a view from above and one from below are drawn too, so shoulders and soles are covered
|
||||
And a garment's edge (a hem, a cuff, a collar) is cut where the picture puts it, not along the body's faces
|
||||
|
||||
@done
|
||||
Scenario: CH42a. A garment file on SOMA's template vertices, worn with the skin under it left out
|
||||
# 11-15 (tools/soma_clothes.py in the test project: `measure` and `wear`). A garment is a JSON file: its
|
||||
# name and layer, the template vertices it covers (by SOMA's own numbering of its 18,056, found from
|
||||
# the body's vertices by their rest places), each one's stand-off, colour and how far it may stray, and
|
||||
# the pictures it came from. `wear` builds each garment's mesh from the file on a body (the covered skin
|
||||
# pushed out by the stand-off, the body's own weights) and writes the body with the skin that is wholly
|
||||
# under cloth left out (13,368 of 26,116 faces under a t-shirt, jeans, shoes and a jacket). Not yet: a
|
||||
# texture in the body's UVs (colour is per vertex), and a second SOMA shape to prove the fit carries.
|
||||
Then a garment is a file of numbers on SOMA's vertices, and a dressed body draws no skin under its clothes
|
||||
|
||||
@done
|
||||
Scenario: CH43a. A second layer over the first
|
||||
# 11-15. A bomber jacket drawn over the t-shirt view by view ("add exactly one garment and keep
|
||||
# everything else"). It is the vertices where its picture differs from the picture of the layer under
|
||||
# it, and it stands off at least that layer's distance plus 3 mm (measured: 20 mm at the tenth of its
|
||||
# vertices, 42 at the middle, 73 at nine tenths), so the layers do not cross. Learnt: an added layer on
|
||||
# the back view came out as the garment's front (a zip and an open front) until the words said what is
|
||||
# seen from behind; and a dark garment over the dark mannequin needs a small difference to count.
|
||||
Then a jacket is worn over a shirt, each its own garment file
|
||||
|
||||
@done
|
||||
Scenario: CH42b. The same garment files on a body of another build
|
||||
# 11-15. The body's build takes SOMA's own shape model (SOMA_neutral.npz: a component by so many of its
|
||||
# standard deviations); a second body moved along three components (up to 11 cm at a vertex, slimmer and
|
||||
# longer in the neck) wears the t-shirt, jeans, shoes and jacket measured on the template body, from the
|
||||
# same files, with nothing refitted, through the same matched walk beside the first. A shaped body's
|
||||
# vertices are matched to the template's numbers through its template-shaped twin (same export, same
|
||||
# order). Not done: the joints stay where the template has them (SOMA's own layer moves them with the
|
||||
# shape), so only small changes of build are right; and this is HG17's start, not its end.
|
||||
Then a garment made once dresses SOMA bodies of different builds
|
||||
|
||||
@done
|
||||
Scenario: CH42c. A garment's colour is a picture in the body's own UVs
|
||||
# 11-15. `wear` bakes each garment's colour as a 2048 px picture in the body's first UV set (spread to
|
||||
# fill it): every texel of a covered triangle is a point of the body, looked up in the view that faces
|
||||
# its triangle most among the views that see all three corners. The jeans now show their fly, pockets
|
||||
# and wash and the jacket its zip and ribbing, where a colour per vertex gave a blur. Also: a small bare
|
||||
# patch walled in by cloth is counted as cloth, which closed the t-shirt's shoulder tops (the jacket's
|
||||
# still gape: their gap runs into the collar). Seen now that the detail is there: the views' colours
|
||||
# differ (the back of the jeans is paler than the front), so a seam shows where one view hands over to
|
||||
# the next; matching them garment by garment is not done.
|
||||
# Looked into after: the skin still seen at the shoulders is not a hole in the jacket. Both garment files
|
||||
# cover the shoulder tops; what shows is the slope between neck and shoulder, which the t-shirt's
|
||||
# neckline leaves bare (read too wide: that skin faces up, and the level views see it at a glance).
|
||||
# An upward-facing vertex among mostly covered skin is now counted as covered, which did not reach it.
|
||||
# Tried and taken back: matching the views' colours by the front's main colours (pale denim on the back
|
||||
# was taken for the shirt's white), and counting any changed pixel of a layer as its cloth (the jacket
|
||||
# then covered the hands).
|
||||
Then a garment carries its own picture, and its detail is the drawing's
|
||||
|
||||
Scenario: CH42. A garment is kept as data on SOMA's topology
|
||||
Then a garment file holds, per body vertex it covers: that it is covered, its stand-off, and how far it
|
||||
may stray (for the cloth follower); and a texture in the body's own UVs, baked from the views with the
|
||||
views' colours matched to the front's garment by garment
|
||||
And the same file dresses every SOMA person (the shape model moves the vertices, the garment rides them)
|
||||
And a body's skin under a garment is not drawn, so nothing pokes through
|
||||
|
||||
Scenario: CH43. Layers
|
||||
# The raccoon session's finding holds here too: an image edit keeps the outline it is given, so a layer
|
||||
# can be added and never taken away. Outfits are built up from the bare body.
|
||||
Then an outfit is an ordered list of garments, each drawn over the ones under it, each one's stand-off at
|
||||
least the one under it plus its own thickness, so layers never cross
|
||||
And a garment drawn alone on the bare mannequin can be worn under or over others by re-measuring its
|
||||
stand-off against what is under it
|
||||
|
||||
@done
|
||||
Scenario: CH44a. A skirt hangs from the waist and moves through a walk
|
||||
# 11-15, first cut (sdk/body/tools/skirt.ts). The skirt is made for the body by measure: a tube of 56 by
|
||||
# 22 particles from an ellipse round the waist's skin samples down to a hem, wider as it falls, its top
|
||||
# two rings pinned to the hips and each ring below free to stray further. The cloth follower already
|
||||
# built carries it through the matched walk with the legs as capsules sized from the body's own skin
|
||||
# samples, and it is drawn as a mesh sequence over the walking body. Measured: edges stretched 19 per
|
||||
# cent at the 99th percentile. Two faults mended the same day: the seat came through the back (each ring
|
||||
# is now at least as wide as the body at its height down to the crotch, and the pelvis has a collider),
|
||||
# and it rode up and shortened by the end of the walk (less room to stray: 27 cm at most, was 39). Wrong
|
||||
# still: the thighs show through the front at the longest stride (sizing the rings to the thighs and
|
||||
# more room to stray were tried and taken back: the cloth bunched), and it sits on the hips, not the waist. Not yet: grown from a garment's edge or drawn from a picture's
|
||||
# outline (it is a plain tube), a hood or a coat's tails, and its colour from a garment file.
|
||||
Then cloth hangs free of the body and moves with it
|
||||
|
||||
Scenario: CH44. Cloth that hangs free
|
||||
Then a skirt, a coat's tails, a hood, a scarf are meshes of their own, grown from the garment's edge on the
|
||||
body down to the outline the views show, weighted from the body at the edge and free below it
|
||||
And they move by the cloth follower already built (sdk/body/src/cloth.ts: each vertex strays from its
|
||||
skinned place by its own distance, with no collision shapes)
|
||||
|
||||
@done
|
||||
Scenario: CH45a. One command from words to a garment
|
||||
# 11-15 (tools/wardrobe.sh NAME "what it is" [UNDER] in the test project). It writes each view's prompt
|
||||
# (what is seen from that side, what to keep), asks for the four pictures at once, says what they cost,
|
||||
# and measures the garment; with UNDER it adds a layer over a garment already made. Run once on a new
|
||||
# outfit (a red hoodie, black joggers, black shoes): 20 cents and 36 seconds to the garment file, then
|
||||
# worn through the walk. Learnt: black cloth reads as the mannequin unless the mannequin's grey is told
|
||||
# apart from black; the hood was drawn up though asked down. It is a script in the test project, not
|
||||
# yet a `raea` verb, and it makes no garment by hand or by procedure.
|
||||
Then a line of words becomes a garment file with its cost said
|
||||
|
||||
@done
|
||||
Scenario: CH45b. `raea clothes`: garments from words, by procedure, and worn
|
||||
# 11-15. A shell verb (engine/cli/src/clothes.ts reads the words, wardrobe.ts does the work on the native raea;
|
||||
# the Blender scripts are tools/clothes, shipped with a release). The first use fetches SOMA-X's two body files
|
||||
# at a fixed commit, checked by SHA-256, into raea's models folder (soma/, with the Apache-2.0 licence), and makes
|
||||
# SOMA's body folder and the mannequin's four views there once (18 s on this Mac). `make NAME "words" [--over
|
||||
# A,B]` draws the four views at once (flux_2_pro, one picture a view) and measures them onto SOMA's template
|
||||
# vertices: assets/clothes/NAME.json, its pictures kept in assets/clothes/NAME/views as its source. Over a
|
||||
# garment made by procedure, or several at once, the mannequin is first drawn wearing them, and the layers beneath
|
||||
# are taken as one for the stand-off. `cover NAME --parts chest,torso,waist,upperArm:0.45 --colour #e8e4da` makes
|
||||
# one by procedure in the same file with no picture: the skin of the parts named (a limb as far along as its
|
||||
# share), with a one-ring hem allowance so garments on neighbouring parts overlap. `wear OUT_DIR A B C [--body
|
||||
# DIR]` writes a body folder (each garment's glb and picture, the body without the skin wholly under cloth, its
|
||||
# skeleton, joint stand-in and collar) and prints the composition's lines. `remeasure NAME` measures a garment
|
||||
# again from its kept pictures, for nothing. Run on an outfit: a t-shirt and shorts by procedure, a flannel
|
||||
# overshirt drawn over them for 20 cents in 35 seconds, all three worn on the headless body with the generated
|
||||
# head through the matched walk (sheet3d compositions/soma_wardrobe.tsx). Mended in the measuring on the way: each
|
||||
# garment's open edge is evened (it ran in a stair along the body's triangles; the body's own UV seams are left
|
||||
# where they are); a garment stands off each part no further than that part allows (a loose sleeve drawn hanging
|
||||
# below the arm had made a balloon of it); the top of a shoulder, and the slope by an open collar, is cloth when
|
||||
# there is cloth in front of it and behind it; a texel that the chosen view shows as backdrop or bare mannequin
|
||||
# takes the garment's measured colour (grey cuffs). Wrong still: the overshirt hangs to the hips in every
|
||||
# picture but wraps the hips when worn (a skin-offset garment can't hang free: CH44), the views disagree on
|
||||
# sleeve length (the back drew it to the elbow), and a sliver by the collar is still open. The verb makes one
|
||||
# garment a call; an outfit is several calls, innermost first.
|
||||
Then a garment is made by one command from words or by procedure, and an outfit is worn by one more
|
||||
|
||||
@done
|
||||
Scenario: CH45c. `raea clothes make` sews; the picture-measured garments are gone
|
||||
# 11-15 night. `raea clothes make NAME ["WORDS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB]` makes a
|
||||
# sewn garment (CH47a's patterns, CH48c's model) in the project: assets/clothes/NAME.json (kind "sewn") and
|
||||
# assets/clothes/NAME/ (the glb, the design, the flat pattern, four pictures). The design is the garment
|
||||
# model's from the words, or GarmentCode's plain base with --plain or no words; each --set changes one of its
|
||||
# 122 settings by path, checked against its options or range (a wrong one says what is allowed);
|
||||
# `raea clothes settings` lists them. The first use sets up raea's models folder (garments/): GarmentCode
|
||||
# cloned at a fixed commit and checked by it, a Python 3.11 environment made by uv from a pinned list, SOMA's
|
||||
# body as a distance grid. `wear` takes sewn garments beside ones laid on the skin: each sewn glb is copied
|
||||
# and the skin under it left out (tools/garments/hide_under.py). Measured before building: the model alone
|
||||
# is not enough ("a short-sleeved t-shirt" came out an open flared tunic with ruffled cuffs, "straight
|
||||
# trousers" knee-length culottes, colours by chance), so the settings are the control and the words a first
|
||||
# guess. A tee and trousers by settings, 18 and 28 seconds, $0, worn with the generated head and walked
|
||||
# (sheet3d compositions/soma_sewn.tsx): they read as clothes, with a cut, a hem and folds. Taken out: `make`
|
||||
# by four drawn pictures measured onto the skin, `remeasure`, the mannequin's views (wardrobe.ts's drawing,
|
||||
# tools/clothes/garment.py's measure, mannequin.py); a garment measured that way is refused by `wear` with
|
||||
# what to do instead. `cover` stays for what is skin-tight. Wrong still: an outer garment is draped on the
|
||||
# bare body (the trousers' waistband shows through the tee's hem); trousers at length 0.9 drag on the
|
||||
# floor; a sewn garment is skinned in motion, not simulated (CH44); the words model is not fetched by a
|
||||
# release yet (only this machine's models folder has one).
|
||||
Then a garment is sewn by one command from words or from settings, for nothing, and worn by one more
|
||||
And no garment is measured from pictures any more
|
||||
|
||||
Scenario: CH45. From words to a wardrobe
|
||||
Then `raea` takes a description of an outfit, draws its layers and views, builds the garments, and writes
|
||||
them beside the body, saying what each picture cost; the pictures are kept with the garment as its source
|
||||
And a garment can also be made by hand or by procedure in the same file format, with no picture at all
|
||||
|
||||
@done
|
||||
Scenario: CH46a. A dressed body measured through a walk
|
||||
# 11-15, first cut (tools/clothes_check.py in the test project; skins the body and each garment as the
|
||||
# engine does, twist joints included, every 15th frame of a performance). Per garment: how deep its cloth
|
||||
# goes under the skin, how deep under the layer beneath, and how far its edges stretch from rest, with
|
||||
# the joints that carry the stretched edges. On the two-layer outfit through the matched walk: the
|
||||
# t-shirt, jeans and shoes 17 mm under the skin at worst, 1.7 per cent of edges over 1.5 of their rest
|
||||
# length (at the armpits, the crotch and the feet); the jacket 40 mm under the skin and 29 mm under the
|
||||
# shirt at worst, 6 per cent of edges over 1.5 (the chest, the forearms, the armpits). The depth is read
|
||||
# against the nearest vertex of the surface beneath, which at an armpit or the crotch can be another
|
||||
# limb's, so those two numbers overstate; the stretch is exact. Nothing is fixed by it yet: a garment's
|
||||
# mesh bridges arm and trunk where the body's does, and the rest pose's spread arms close in a walk.
|
||||
Then a garment's faults in motion are numbers, by joint
|
||||
|
||||
Scenario: CH46. Checked like motion is
|
||||
Then a dressed body is run through the library's captures and measured: skin showing through cloth, cloth
|
||||
through cloth, and edges stretched past a limit, per garment
|
||||
|
||||
@done
|
||||
Scenario: CH47a. Garments from sewing patterns, cut to SOMA's measurements and draped by a cloth of our own
|
||||
# 11-15, after the user saw `raea clothes make` on the body ("on the body it looks terrible"; "the 4 panels
|
||||
# are not consistent at all") and asked whether clothes are thought of wrong. They were: a garment painted
|
||||
# onto a shell of the skin can't show a cut, a hem or a fold, and four pictures drawn apart never agree.
|
||||
# Clothes are flat pieces cut to a pattern and sewn, their shape from the cut, gravity and the body.
|
||||
# GarmentCode (ETH Zurich, pygarment, MIT) writes patterns as programs of modular components (bodices,
|
||||
# sleeves, collars with a hood, a turtle neck or a lapel, cuffs, waistbands, trousers, seven skirts)
|
||||
# joined by seams, sized from 26 body measurements. Its simulator is NOT used: it is a fork of an old
|
||||
# NVIDIA Warp under a non-commercial licence (mainline Warp is Apache-2.0 since 1.6.2), and its sample
|
||||
# SMPL bodies are research-only; SOMA replaces them. Blender's own cloth with sewing springs failed four
|
||||
# ways (crumpled, slid off the shoulders). What worked, in the test project's scratch tools: SOMA measured
|
||||
# in GarmentCode's terms (bust 81, waist 73, hips 93 cm: slimmer than its average body); a design is
|
||||
# settings by path (sleeve.length=0.95 collar.component.style=Hood2Panels), which is what a sentence has
|
||||
# to become; the cut written as flat pieces, their place round the body and the seams as vertex pairs;
|
||||
# then a position-based cloth (every edge held to its length in the flat cut, each seam's pairs pulled to
|
||||
# one point, the cloth pushed out of the skin by the nearest point, gravity let in once the seams close)
|
||||
# on the CPU. A T-shirt (6,042 vertices) closes its seams by frame 30 (0.5 mm at the middle) and hangs
|
||||
# from the shoulders with 20 per cent stretch at the 95th percentile, in 2 minutes; trousers (15,368) in
|
||||
# 4.4, a hoodie with its hood and cuffs over them (12,541) in 3.4, no cloth inside the skin in any. Each is
|
||||
# weighted from SOMA's skin by nearest face and worn as a Character part through the matched walk, with
|
||||
# the skin wholly under it left out of the body (sheet3d compositions/soma_patterns.tsx). The flat cut is
|
||||
# each garment's UVs, so a fabric is one tiling picture with no seams between views. Faults: the hood is
|
||||
# drafted up and holds the hoodie high (above the waist); wide trouser legs, skinned from the nearest skin
|
||||
# and not simulated as they walk, stretch a sheet between the legs at a full stride (CH44's follower is
|
||||
# the fix); GarmentCode places pieces for its own body, so SOMA needs them lifted 7 cm while they are
|
||||
# sewn; no open-front shirt or pocket component exists yet.
|
||||
Then a garment is a pattern cut to the body and draped, and it walks with the body
|
||||
|
||||
Scenario: CH47. Clothes are sewing patterns (proposed: the user decides)
|
||||
# Proposed 11-15 from CH47a. It would replace CH40-CH42's picture measuring as the way a garment's shape
|
||||
# is made; the image model would draw only fabric (one tiling swatch) and prints placed on a piece.
|
||||
Then a garment is a pattern program's settings, cut to the body's measurements, draped once per body
|
||||
shape at build, and kept as a skinned mesh with its flat cut as its UVs
|
||||
And words become settings (a language model picks components and values), never pictures of the body
|
||||
And layers drape in order, each over the one beneath, and creatures get their own pattern blocks
|
||||
|
||||
Scenario: CH48. A garment model that dresses SOMA in anything (proposed)
|
||||
# The user's answer to CH47, 11-15: "clothing or what you wear could realistically be anything. I wonder
|
||||
# what we could do if we trained a small model like kimodo did or idol did, build off some existing
|
||||
# weights we ship and create something that builds more intelligently". Patterns make only what is cut
|
||||
# and sewn; armour, shoes, hats, a backpack or a costume are not patterns. Kimodo is good because it
|
||||
# learned in one fixed frame (SOMA's skeleton), so what it makes plays on our body unchanged: the garment
|
||||
# model would make garments in SOMA's rest pose and frame, so fit, skinning and layers come free. The data
|
||||
# comes from CH47a's tools run as an engine (GarmentCode's design sampler across SOMA's shapes, draped by
|
||||
# our cloth on the GPU, rendered from the mannequin's cameras, each example labelled exactly: its design,
|
||||
# its pattern, its 3D on the body, its pictures), plus hard-surface things drawn and made 3D by Idol and
|
||||
# cut from the body. GarmentCodeData itself is not used (draped on SMPL bodies, its licence unconfirmed).
|
||||
# The base weights would be Idol's (Apache-2.0, shipped): one picture of the mannequin dressed in anything
|
||||
# in, the garment alone out, in 3D on SOMA. Idol ships no training code, so its fine-tune is ours to write.
|
||||
Then a garment is made by a model from words or a picture, on SOMA's body, as a layer
|
||||
And the training data is ours, made by our own tools on SOMA, with where each example came from
|
||||
And its cost is said before any training is paid for
|
||||
|
||||
@done
|
||||
Scenario: CH48a. The garment data engine: random designs cut to SOMA, draped on the GPU, pictured, labelled
|
||||
# 11-15, CH48's data half (tools/garments/engine.sh OUT N SEED). GarmentCode's sampler draws a design and
|
||||
# its own checks refuse about 60 per cent; each kept one is cut to SOMA and draped by CH47a's cloth on the
|
||||
# GPU (MLX): the body as a 7 mm signed distance grid signed by winding number (the nearest face's normal
|
||||
# put patches of "inside" in the air above the shoulders), every link solved at once, compiled. The
|
||||
# T-shirt that took 125 s on the CPU takes 7 s with the same seams (0.83 mm median) and stretch. Three
|
||||
# things threw garments off, each found from snapshots of the drape: the cloth was too soft under gravity
|
||||
# (+18 per cent stretch at the 95th percentile with 10 solver passes a substep: armholes opened over the
|
||||
# shoulders; 60 passes give +5); SOMA's bust had been read at the chest's most forward level (81 cm), not
|
||||
# the fullest girth under the arms (89.9), so fitted tops were cut too small; and GarmentCode's own drapes
|
||||
# pin labelled edges to planes (a waistband's top at the waist, a neckline inside the neck's sides, a
|
||||
# strapless top's edge at the armpit), without which gathered waistbands (up to 1.9 times the waist) and
|
||||
# strapless tops fall. Ours are one-sided planes kept on, as elastic, boning or the neck holds them, a
|
||||
# low-rise band pinned between waist and hips by its rise. Then 24 designs from 61 draws all hang right,
|
||||
# 4 to 33 s each (about 7,000 a day on this Mac, $0). Rendered properly, the cloth first looked pebbled:
|
||||
# the bake left it flat-shaded, so its glb had three vertices for every triangle (198,881 for 66,305) and
|
||||
# shaded as facets everywhere it was drawn; smooth, it is one surface. The fabric is also stiffer than
|
||||
# CH47a's (bending 0.3, squash 0.6 against 0.05 and 0.25), which buckled at the mesh's own scale; folds
|
||||
# stay and stretch is +6 per cent at the 95th percentile. An example is its design's settings (the labels), a
|
||||
# caption, the pattern, the flat pieces with seams and edge labels, the draped mesh, a skinned glb, four
|
||||
# pictures on the mannequin and the drape's numbers. Faults: GarmentCode's space is mostly dresses and
|
||||
# skirts (no open-front shirts, jackets, pockets, shoes or hats); one body shape so far; no collision
|
||||
# between the layers of one design; the captions are written from the settings, not seen.
|
||||
Then one command makes N random garments, each worn on SOMA and labelled with its design
|
||||
And a garment that slides off is caught by the drape's own check, not by eye
|
||||
|
||||
Scenario: CH48b. The training data at scale, with periods, genres and things that are not sewn (proposed)
|
||||
# The user's choice, 11-15: scale the data and train now, before writing the missing pattern pieces. And,
|
||||
# in his words: "use examples of time periods, futurism, armor/suits/helmets/hats/etc". The engine's lean
|
||||
# mode (LEAN=1) keeps what training needs, about 0.4 MB a design: the design, its caption, the drape's
|
||||
# numbers and the draped mesh; pictures and glbs are made again from those for the examples that need
|
||||
# them. A caption from the settings alone ("fitted sleeveless top, trousers") can't name a period or a
|
||||
# genre, so captions also come from a picture of the garment on the mannequin, written by an image-reading
|
||||
# model asked what the garment is and what it evokes (Edwardian, 1970s, workwear, futurist, uniform), with
|
||||
# its price per caption said first. What can't be sewn comes from CH49.
|
||||
Then the training set holds sewn garments captioned by their settings and by what they look like
|
||||
And worn hard pieces from CH49, each with its words, its picture and its 3D on SOMA
|
||||
|
||||
Scenario: CH48c. Words to a sewn garment through SigLIP 2, trained with no captions (first form of CH48)
|
||||
# 11-15. The base weights are SigLIP 2 (siglip2-base-p16-256, already in raea's models, Apache-2.0), whose
|
||||
# pictures and words share one space. Each lean design is pictured on the mannequin from four sides
|
||||
# (bake_batch.py PICTURES=1, 0.3 s a design) and embedded on the CPU (garment_embed.py; Core ML's GPU computes
|
||||
# SigLIP 2 wrong on this Mac); a small network (two layers of 512, garment_model.py) learns the design's 122
|
||||
# settings as 196 slots (garment_params.py: numbers by their place in range, choices one-hot, the options
|
||||
# being every value seen, since GarmentCode's own defaults fall outside its ranges) from the picture
|
||||
# embeddings, centred on the pictures' mean, with noise added; asked in words, it is given the text
|
||||
# embedding centred on a bank of garment lines' mean (the two kinds sit apart by a near-constant offset).
|
||||
# So no caption is needed to train, and a line nobody wrote a caption for still lands near its pictures.
|
||||
# First run, 86 designs: held-out pictures give the top's kind 0.66 (most common 0.44) and the bottom's
|
||||
# 0.59 (0.31); the numbers are no better than their mean yet. Twelve lines of words with a check each
|
||||
# ("trousers", "a pencil skirt", "a top with a hood", "a strapless top" ...): 11 of 12, as many as taking
|
||||
# the nearest training picture's design, where a random design passes one or two; nonsense ("a bowl of
|
||||
# soup") falls back to a fitted top and trousers. words.sh makes each line a design, cuts it to SOMA and
|
||||
# drapes it, about 20 s and $0: seven of seven were valid patterns and hung right, six read as asked.
|
||||
# Faults: the long-sleeved shirt's sleeve was long but its cuff, a tube about 18 cm round reaching from wrist
|
||||
# to elbow, is narrower than SOMA's forearm and slid off to hang open (one pair 8 cm apart); the drape's
|
||||
# check looked only at the 95th percentile of seam gaps and passed it. A drape now fails with any seam open
|
||||
# over 2 cm ("closed"), which 23 of the first 139 lean drapes do, mostly at sleeve-to-cuff corners, and the
|
||||
# model trains only on drapes that pass. Drawing a gathered edge in to its partner's length (a gathering
|
||||
# thread) was tried and changed none of the eight worst. Also: a turtleneck's collar collapses in the drape,
|
||||
# unasked parts come along (trousers with a turtleneck), and "a long dress" is not known as a top joined to
|
||||
# a skirt.
|
||||
Then a line of words becomes a sewing pattern cut to SOMA and draped, with no caption written to train it
|
||||
And its eval says how it compares with the nearest picture and with chance, on held-out designs and lines
|
||||
|
||||
Scenario: CH49. Worn hard pieces: helmets, hats, armour, visors (proposed)
|
||||
# Patterns make only what is cut and sewn. A helmet, a hat, a breastplate or a visor is made the way the
|
||||
# user first proposed for clothes and the creature flow makes animals: a picture of SOMA's mannequin
|
||||
# (one view, its camera written down) is dressed by an image model, keeping the pose and the view; Idol
|
||||
# (Apache-2.0, run on this Mac) makes the dressed figure 3D; it is laid on SOMA by its camera and size; the
|
||||
# body is cut away (everything within a few millimetres of the skin, by the body's distance grid); what is
|
||||
# left is split by the bone it lies nearest, and each piece rides that bone rigidly, as the head's cap and
|
||||
# glasses ride Head (CH21). It differs from the rejected picture-measured clothes: those painted cloth onto
|
||||
# the skin from four separate pictures that never agreed; here one picture is made 3D whole, and only rigid
|
||||
# things are kept, so nothing has to fold.
|
||||
# 11-15, built as tools/garments/wear.sh (README "Worn hard pieces"): a knight's plate armour (full: the
|
||||
# dressed surface kept whole, set 4 mm off the skin) and four keyed pieces across periods and genres, a
|
||||
# futuristic motorcycle helmet, a Victorian top hat, a Roman legionary's helmet and sci-fi armour, about 5
|
||||
# cents and 5 minutes each. Keyed: the mannequin is drawn magenta and the colour decides what is body, not the
|
||||
# distance (a helmet's crown sits within the cut of the skull and was being cut through); a separate piece
|
||||
# that hugs the skin all over (the soles, which the drawing never shows) is dropped; each piece rides one bone
|
||||
# whole, the one nearest its centre, never a neck bone, and a midline bone when it crosses the middle (so the
|
||||
# breastplate rides the chest, not the arm under its shoulder plates, and a belt with thigh plates the hips).
|
||||
# Open: the back is Idol's guess from one front three-quarter view (the sci-fi armour's back comes out dark),
|
||||
# so a back view drawn to match is next; the surface is lumpy at Idol's 4 mm; a full suit's hands and feet
|
||||
# copy SOMA's bare shape.
|
||||
Then words make a helmet, a hat or armour that SOMA wears and moves with
|
||||
And each piece is its own part on the bone it covers, so pieces mix with sewn garments as layers
|
||||
@@ -0,0 +1,216 @@
|
||||
Feature: Creatures: a four-legged body in the character SDK
|
||||
Set by the user 2026-11-14, with the trashpanda project (a stylized raccoon that walks, sneaks, crawls, stands and
|
||||
walks on two legs, climbs a tree, dangles from a wire, vaults, kicks off a wall, holds things, and goes limp): "if
|
||||
you feel that a four legged creature has merit in the character sdk then also make your PRs alongside the other
|
||||
work to include them and what you find".
|
||||
|
||||
It has merit. The character SDK is one skeleton (MakeHuman's game_engine: 22 body joints and 30 finger joints) and
|
||||
one way of moving it (captures retargeted joint by joint, a motion matcher that picks frames, IK only to hold a
|
||||
contact). None of that reaches an animal: there is no capture library for a raccoon, a dog or a cat on our rigs,
|
||||
and retargeting a person's clip to four legs is not a thing. An earlier game's dog and cat were posed by a solver
|
||||
written inside that project, and called stiff. So an animal needs the other half of what docs/hands.feature
|
||||
began: motion made from what the body is doing, with no capture of it. This file is that for the whole body.
|
||||
|
||||
What was found, building the raccoon:
|
||||
- Skeleton first holds for a built model as it does for a drawn one. The joints are set down by measure; the body
|
||||
is then laid round them as solids, so every limb is where its bone is and the weights have something true to
|
||||
start from.
|
||||
- Where a limb joins the trunk decides whether the skin tears, more than the weights do. With the knee and elbow
|
||||
touching the belly at rest, a voxel union fuses skin across them, and no weighting saves an edge whose ends ride
|
||||
on joints that move 10 cm apart: 0.4% of edges torn at a walk. Moving the knees and elbows clear, so a leg joins
|
||||
the trunk only at its hip or shoulder, took the walk to 0.05% with the same weights. Smoothing weights harder
|
||||
made it worse (0.2% to 0.4%): it spreads a far-moving joint's pull into the trunk.
|
||||
- What ended the tearing at the hip and shoulder was to stop joining them: each leg its own closed piece of
|
||||
skin set into the trunk, the join hidden by the fur. A furred animal does not need one watertight skin.
|
||||
- Bone heat gives the belly to the elbows and knees (they sit just inside it, the spine far above). The trunk's
|
||||
skin has to be given to the spine outright: each point to the two spine joints it lies between.
|
||||
- Feet kept in the world, not in the gait's cycle, are what stop sliding: a planted foot is a point that does not
|
||||
move until its leg's turn comes. Measured slide is 0 mm in every move, turning and stopping included. A cycle
|
||||
played under a moving body (that earlier solver) slides whenever speed or heading changes.
|
||||
- One rigging (the hips' and shoulders' frames, four limb ends, the head's turn, the tail) is enough to pose every
|
||||
move, and blending riggings rather than poses lets one move ease into the next with the limbs still solved.
|
||||
- A small animal's legs are short for its stride: at standing height a foreleg reaches 8 to 11 cm ahead of its
|
||||
shoulder. Strides have to come from the leg's length (a walk's stance travels about one leg length), or the
|
||||
elbow locks every step.
|
||||
- Fur as shells (16 copies of the skin pushed out along its normals, each cut by one height map at its own height)
|
||||
draws on a skinned model in the raster renderer at no visible cost: 232k triangles, 11 ms a frame at 1280x720.
|
||||
- A limp body made of points must not gain speed from being pushed out of a solid: the point's last place moves
|
||||
with the push. Without that, a body that flops half over a box leaves at 16 m/s.
|
||||
|
||||
Rule: Built
|
||||
|
||||
@done
|
||||
Scenario: CR0. Where it lives
|
||||
# sdk/body/src/creature, engine-free TypeScript beside the person's body layer, exported as
|
||||
# `creature` from raea/body. The moves that need a world (CR7 on) are in the trashpanda project until they
|
||||
# have settled (its game/ folder).
|
||||
Then the plan:
|
||||
| crate | file | lines | job |
|
||||
| sdk | sdk/body/src/creature/q.ts | 40 | the body layer's maths under short names; a bend from places; a turn from axes |
|
||||
| sdk | sdk/body/src/creature/body.ts | 45 | a rig's measures: sockets, bone lengths, where each foot belongs, reach |
|
||||
| sdk | sdk/body/src/creature/loco.ts | 185 | the gait by speed and posture; feet planted in the world and stepped |
|
||||
| sdk | sdk/body/src/creature/pose.ts | 225 | the rigging, the solver, the blend between riggings, the tail on springs |
|
||||
| sdk | sdk/body/test/creature.test.ts | 60 | slide, gait, every joint posed, feet squared up on a stop |
|
||||
|
||||
@done
|
||||
Scenario: CR1. A creature's rig is read from its joints
|
||||
# A rig is joints by name with a parent and a place at rest, every joint resting unturned (the engine places
|
||||
# each by its own transform), and `marks` for the points that end a bone and carry no skin (nose, tail's tip,
|
||||
# toes). Names: root, spine1..3, chest, neck1, neck2, head, jaw, ear_l/r, lid_l/r, tail1..N; fore legs fl/fr
|
||||
# _scap, _upper, _lower, _wrist, _hand, digits _d1a/_d1b.._d5a/_d5b; hind legs hl/hr _upper, _lower, _hock, _paw.
|
||||
Given a rig.json with those joints
|
||||
When bodyOf reads it
|
||||
Then it has each leg's socket, bone lengths, reach and where its foot belongs under the body
|
||||
|
||||
@done
|
||||
Scenario: CR2. A planted foot does not move
|
||||
# Each foot is a point in the world. It stays until its leg's turn in the gait, then swings to where the body
|
||||
# will need it half a stance after it lands, aimed again every frame of the swing (a turn mid-step still
|
||||
# lands right). A foot left more than 15 cm (fore) or 19 cm (hind) from its place goes at once.
|
||||
Given a body walking, trotting, galloping, sneaking, crawling and walking on two legs, turning all the while
|
||||
Then no planted foot moves between two frames
|
||||
# measured 2026-11-14: 0.0 mm in all six (sdk/body/test/creature.test.ts; tools/locotest.ts in the project)
|
||||
|
||||
@done
|
||||
Scenario: CR3. The gait is the speed's
|
||||
# Stride, the share of a stride each foot stands, each leg's place in the stride and the lift are blended by
|
||||
# speed: a walk (lateral sequence, 0.66 standing) to 0.8 m/s, a trot (diagonal pairs, 0.5) to 2.1, a bounding
|
||||
# gallop (hind feet together, 0.36) above. Lowered, steps shorten and stand longer; on two legs the hind feet
|
||||
# alternate.
|
||||
Then stride grows and standing share falls from walk to trot to gallop
|
||||
|
||||
@done
|
||||
Scenario: CR4. One rigging poses every move
|
||||
# The solver takes the hips' and shoulders' frames, four limb ends (a place, a turn, how far the wrist or heel
|
||||
# is rolled over it, how far the fingers are closed, where the elbow or knee points), the head's turn and the
|
||||
# tail's joints, and gives every joint's place and turn: the back laid link by link between the two frames,
|
||||
# the shoulder blade sliding with its leg, elbow and knee bent in a plane, the neck sharing the head's turn.
|
||||
Given the body on the ground, lowered, and up on its hind legs
|
||||
Then every joint is a number in every frame, and at a walk and a trot every leg reaches its foot
|
||||
|
||||
@done
|
||||
Scenario: CR5. Standing still, it squares up
|
||||
Given a body that galloped and stopped
|
||||
Then within three seconds each foot is within 3 cm of where it belongs, brought there one at a time
|
||||
|
||||
@done
|
||||
Scenario: CR6. The tail is late
|
||||
# Its joints are points pulled toward where a stiff tail would be, stiffest at the root, kept their lengths and
|
||||
# off the ground; how it is carried (up at a gallop, low sneaking, down behind on two legs) is the posture's.
|
||||
Then the tail follows the hips' turns after them and never passes through the ground
|
||||
|
||||
Rule: Built in the project, to come into the SDK
|
||||
|
||||
Scenario: CR7. Moves off the ground share the rigging
|
||||
# In the project (game/player.ts): in the air (nose along its path, hands reaching for the ground coming down),
|
||||
# a vault (hands down on the thing's top, hind legs tucked through), a pull-up onto a ledge (hands on top, hind
|
||||
# feet scrabbling on the face), a kick off a wall, climbing a trunk (diagonal pairs, hands that stay where
|
||||
# they grip), hanging from a wire by the hands (a pendulum the player pumps, hand over hand along it), and
|
||||
# gone limp. Each builds a rigging; a move eases into the next over 6 to 34 frames by blending riggings.
|
||||
# A tour of all of them runs headless with every frame posed (tools/playtest.ts in the project).
|
||||
# To do here: the world they ask of (ground height, what is ahead, a ledge, a trunk, a wire) as an interface.
|
||||
Given a level that answers those questions
|
||||
Then a creature jumps, vaults, pulls up, kicks off, climbs, hangs and lands on it
|
||||
|
||||
Scenario: CR8. Gone limp, and up again
|
||||
# In the project: nine points on springs (hips and shoulders left and right, the head, four feet), each foot
|
||||
# kept within its leg's reach of its socket; pushed out of solids without gaining speed; when it lies still
|
||||
# the body gets up by blending from the limp rigging to the standing one.
|
||||
Then a fall from 2 m tumbles, comes to rest in under 2 s and stands up where it lies
|
||||
|
||||
Scenario: CR9. It takes things
|
||||
# In the project: on four legs a thing is taken in the mouth; up on its hind legs both hands close on it and
|
||||
# turn it over; thrown from either. To do: docs/hands.feature's holds and finger curl on a creature's hand
|
||||
# (five digits of two joints), so the fingers lie on the thing rather than at a fixed curl.
|
||||
Then a thing held is in the mouth or between the hands in every frame, and the fingers touch it
|
||||
|
||||
Rule: To do
|
||||
|
||||
Scenario: CR10. The skin holds in every move
|
||||
# Measured by tools/rigcheck.ts in the project: edges past 0.4x or 1.6x their length by more than 8 mm, as a
|
||||
# share of all edges. With one skin over the whole body (11-15 early) 9 of 13 moves passed, and the gallop
|
||||
# (0.76%), the crawl (0.48%) and two legs (0.9%) tore at the hip and shoulder, whatever the weights.
|
||||
# 11-15: each leg is now its own closed piece of skin, set into the trunk under the fur, and follows only its
|
||||
# own bones; the trunk follows none of a leg's. No skin bridges a leg and the trunk, so none tears there: 10 of
|
||||
# 13 pass (crawl 0.007%), and the fur hides the join. Left: gallop 0.11% (the back's flexing), two legs 0.22%
|
||||
# and 0.20% (the neck's fold and the tail's root).
|
||||
Then no move tears more than 0.1% of the skin's edges
|
||||
|
||||
Scenario: CR11. A gallop with a back
|
||||
# 11-15: every leg now reaches its foot at a gallop (a stance of 0.29 of the stride, the body 14 to 16% lower
|
||||
# at speed; it was 87 of 1,200 leg-frames short). Still rough: the back's arch following the legs, the hind
|
||||
# legs' reach past the fore, and a real moment with all four feet off the ground.
|
||||
Then at a gallop every leg reaches its foot and the back's arch follows the legs
|
||||
|
||||
Scenario: CR12. Other animals on the same solver
|
||||
# 11-15: done on a dragon (four legs, two wings, four neck joints, eight tail joints, horns, scales): the same
|
||||
# solver, sized by the legs' reach beside a raccoon's (k: every stride, speed and length in the solver is a
|
||||
# raccoon's times k; 1.74 for the dragon). Feet slide 0 mm in every move; the skin holds in 13 of 13. What it
|
||||
# needed that a raccoon did not: any number of neck joints sharing the head's turn, optional ears, lids, digits
|
||||
# and belly, wings (CR17), a body on nearly straight legs carried a little lower so it has slack to step with,
|
||||
# and how it carries itself as four numbers in its rig (head low, heel down, tail's hang, wings' fold).
|
||||
# 11-15 later: a dog and a cat made by another project (the monk game's animals, on the same names) walk, trot
|
||||
# and gallop on it too (sdk/body test/creature.test.ts, private repo 3de8813). They needed two things the
|
||||
# raccoon and the dragon hid: a fore leg may end in a paw instead of a hand (the body names each leg's planted
|
||||
# joint), and a body whose legs have less room behind their feet than a raccoon's (straighter legs: measured
|
||||
# from the rest pose at the height it is carried) steps at a smaller size, so shorter, quicker steps at the
|
||||
# same speed. Before that, setting off left a hind foot planted up to 31 mm out of its leg's reach while the
|
||||
# other three swung. The raccoon's steps are unchanged; the dragon's are 9% shorter.
|
||||
Given a dragon's rig
|
||||
Then it passes CR2 to CR5 and CR10 on the raccoon's solver with no line of the solver naming it
|
||||
|
||||
Scenario: CR15. A creature is a spec, and one flow makes it
|
||||
# In the project (blender/creatures.py, tools/creature.sh). A creature is data: its joints by measure on the
|
||||
# names' convention (root, spine1..N, chest, neck1..N, head, jaw, ear_/lid_, tail1..N, fl/fr/hl/hr legs, wl/wr
|
||||
# wings, belly), the marks that end a bone, how thick its flesh is round each joint, its webs and horns, what
|
||||
# its skin is, the words it is drawn from, and its carriage. The flow:
|
||||
# mannequin the skeleton clothed in grey flesh (tubes by the radii, sheets for webs, cones for horns)
|
||||
# art the image model draws the animal on the mannequin, same pose and view (flux_2_pro, 3 cents)
|
||||
# idol the drawing made 3D on this Mac (Idol, about 3.5 minutes), carved to one closed mesh
|
||||
# build the mesh laid on the skeleton by its feet and nose (its long axis found), thinned, painted from
|
||||
# its own colour; the joints refitted to it (back, a standing neck by the middle of its flesh, legs,
|
||||
# the tail along its own line, ear and horn tips, wing tips and wrists); weights by bone heat on a
|
||||
# stand-in, the trunk given to the back by place; each leg and wing cut into its own closed piece
|
||||
# check the reel posed by the solver and the skin measured (CR10)
|
||||
Given a spec for a raccoon, the same skeleton as a vinyl toy, and a dragon
|
||||
Then each command makes each of the three, and all three pass CR10 with no change between them
|
||||
|
||||
Scenario: CR16. The coat is the spec's
|
||||
# fur: the generated surface is the coat's outside; the skin is set in by the fur's length for each part and 16
|
||||
# shells grow back out to it (CR0's finding). scales, plain: the surface as it is, no shells, the picture opaque.
|
||||
# A second style is a second spec with other words and another skin: the toy raccoon passed on its first run.
|
||||
# Not done: a fur length read from the drawing (clipping the coat in the drawing keeps the outline, so the gap
|
||||
# measures nothing), lids that close over painted eyes, a mouth with an inside.
|
||||
Then a creature's skin is fur shells or the bare surface by its spec, and a restyle changes no code
|
||||
|
||||
Scenario: CR17. Wings
|
||||
# A wing is a limb (wl/wr: shoulder, elbow, wrist, the tip a mark) and its own piece of skin. Its membrane is
|
||||
# too thin for the 3D model to keep (Idol gave the arm and fingers and dropped the sheet), so the build makes it:
|
||||
# a sheet between the refitted joints, each point following the joints at its corners. The solver raises a wing
|
||||
# about the body's line and folds it in its own plane joint by joint (which way round each joint folds is read
|
||||
# from the rest pose). Rough: the membrane is one flat colour and does not follow the finger bones; no flight.
|
||||
Then a winged creature folds its wings as it walks, opens and beats them as it runs, and no web point is unbound
|
||||
|
||||
Scenario: CR18. Mouths and eyelids
|
||||
# 11-15, in the project's build, the same on all three creatures. The mouth: the drawn mouth is paint on a closed
|
||||
# head, so a turning jaw only stretched the lips. The head is cut along the lips' line (a plane through the
|
||||
# muzzle's front a third of the way up it, rising a little toward the corners), what is under the cut follows the
|
||||
# jaw, what is over it the head, and a dark inside (a roof on the head, a floor on the jaw, meeting at the hinge)
|
||||
# fills what opens. The skin still holds in 13 of 13 moves. No teeth or tongue.
|
||||
# The lids: each is a small cap of its own, resting under the brow, that turns about an axis lying along the head
|
||||
# (the rig's lid_axis; a turn about the head's side-to-side axis does nothing for an eye that faces sideways) and
|
||||
# takes the colour of the skin round the eye. Where the eye is comes from its pixel in the drawing (eye_px in the
|
||||
# spec). The model was made from the drawing, so seen from the drawing's side it is the drawing: that side is
|
||||
# searched for (view, size and shift, scored by how much of the model lies inside the drawing's outline, since a
|
||||
# drawn wing's membrane is not on the model), the pixel is cast along it onto the raw model, and the point it
|
||||
# meets is the same point on the model once laid on the skeleton. A strongly coloured eye is then moved onto
|
||||
# the few points nearby whose colour leans toward the pixel's. Casting from the mannequin's camera instead was
|
||||
# centimetres off (the model is not laid exactly where the mannequin stood).
|
||||
# Rough: the lid shuts over the eye on the toy raccoon and about on it on the raccoon; on the dragon it lands
|
||||
# about an eye and a half away (outlines agree 0.77 against 0.84 and 0.92, and its eye is a handful of points).
|
||||
Then a creature's jaw opens a mouth with an inside, and its lids shut over its eyes
|
||||
|
||||
Scenario: CR13. In the engine
|
||||
# As docs/hands.feature moved the hands to Rust (raea-sys-body), a creature's solver belongs beside it once
|
||||
# the TypeScript has settled, with <Creature> in raea/character drawing a rig from a rigging.
|
||||
Then <Creature rig pose /> draws a four-legged body, and character.creature answers a rigging's pose
|
||||
@@ -201,3 +201,11 @@ Feature: raea's plugin ecosystem: extending the engine and the app, made, shared
|
||||
And may an extension restyle the app itself (a theme), or only draw inside its own frames?
|
||||
And packages install per person, in every project (Shane 11-09: answered)
|
||||
And will packages ever be sold through raea, or stay free with raea taking no part?
|
||||
|
||||
Scenario: EC13. A package that imports raea shares the composition's SDK (#151)
|
||||
Given a package in the project's node_modules (or the person's plugins) that imports "raea", "raea/<module>" or
|
||||
"@raea/<package>", its entry .tsx or plain ESM .js
|
||||
Then the import is the SDK copy the composition's own files import (engine/bundle edit.rs sdk_copy): one SDK, so
|
||||
its hooks read the Clock the engine drives, exactly as the same file imported by a relative path does
|
||||
And never an outside global the bundle leaves unresolved ("Can't find variable: raea" before the first frame)
|
||||
And engine/bundle/tests/bundle.rs a_package_importing_the_sdk_gets_the_work_folders_copy holds it
|
||||
@@ -0,0 +1,157 @@
|
||||
@spec
|
||||
Feature: Feed tasks: the graph view's layering, the to-do list, and sessions started outside the app
|
||||
Shane, 2026-11-13: "note to ship with this next batch for release is that in the react graph view when i zoom in it
|
||||
ends up obstructing other buttons and gui outside of the stage and across the app, so we need to make sure layering
|
||||
works there and remove the agents button in the top right of feed and inbox for a checkbox and this is a editable
|
||||
todolist built to look minimal, skimmable and easy to read with the ability to click into a task to see more
|
||||
details. the other note to add is in the timeline if an agent is currently running even if i have initiated the
|
||||
session myself in terminal or an app and it is still claimed or working on it without being terminated, meaning its
|
||||
still open or the session is active, we should see it in the feed and see updates from it. this should help tie
|
||||
into the todolist stuff too."
|
||||
|
||||
Three parts. Each is done when it works in raea's window (not only in Chrome) and has its tests.
|
||||
|
||||
Background:
|
||||
Given the app's code is apps/app (raea-feed); its branch for parts 2 and 3 is feed-tasks, part 1 is on its main
|
||||
And a window check is a headless raea window of the session's own: `node blitz/pw-run.mjs SPEC` on the BLITZ_E2E
|
||||
bundle, RAEA_PAGE_HOST_BIN a copy of the page host, a fresh raea.root each run
|
||||
|
||||
Rule: FT1. The graph view stays in its own box
|
||||
# Status 11-13: built, in 0.1.3. Engine 37846080a (vendor/blitz-dom/src/node/node.rs, sdk/ui/src/dom/input.ts, a unit test
|
||||
# in sdk/ui/test/dom.test.tsx); app raea-feed #11 (AskCanvas clipped at its box, e2e/canvas-layer.spec.ts).
|
||||
# Cause: Chrome never showed it. In raea's window the canvas was DRAWN clipped, but neither hit test honoured an
|
||||
# overflow clip: blitz-dom's hit_inner tested a clipping box's children wherever they overflowed to, and sdk/ui's
|
||||
# hit dropped the inherited clip at a child with its own z-index and replaced it at a child that clips (a card is
|
||||
# overflow-hidden). Both halves are needed: with only sdk/ui fixed, elementFromPoint is right and a real press
|
||||
# still lands on the canvas (the host's target wins). Checked: the spec in Chrome and in the window; the app's
|
||||
# whole window smoke 28 passed, 49 failed, 4 skipped of 81 before and after, the same tests; sdk/ui 60 tests.
|
||||
# Not read by the hit tests: a transform on a box between a z-indexed child and its stacking-context root (the
|
||||
# painter's clips don't read it either); in sdk/ui, an absolute box whose containing block is above the clipper.
|
||||
|
||||
@done
|
||||
Scenario: FT1a. A press outside the canvas never reaches it, at any zoom
|
||||
Given an ask with four pictures open on its canvas (React Flow), zoomed all the way in (scale 2)
|
||||
Then no point outside the canvas's box finds a piece of the canvas (document.elementFromPoint)
|
||||
And a press on the sidebar, the workspace picker or the header goes to what is drawn there
|
||||
And the canvas clips what it draws at its own box
|
||||
|
||||
@done
|
||||
Scenario: FT1b. A box that clips takes no pointer for what it cuts away, anywhere in the window
|
||||
Given a box with overflow other than visible, and a child that overflows it, with or without its own z-index
|
||||
Then a point outside the box's padding box never hits the child or anything in it
|
||||
But a fixed box, and a box whose containing blocks are above the clipping box, are not cut by it
|
||||
|
||||
Rule: FT2. The agents button is a checkbox that opens the to-do list
|
||||
# Status 11-13: built, in 0.1.3: raea-feed #12, merged ab68f0d (3b2353b, a2dc439). src/feed/todo.ts (the rows),
|
||||
# src/feed/TodoPanel.tsx, brief/format.ts removeTask and moveTask. The Agents panel and its menu surface are gone.
|
||||
# Checked: e2e/todo.spec.ts 4 of 4 in Chrome and 4 of 4 in the window; vitest (todo.test.ts, format.test.ts).
|
||||
# Decisions made here, each open to Shane's word:
|
||||
# - It is the tasks the app already has, not a second list: the project's brief's tasks (## Tasks in brief.md:
|
||||
# what the composer, the Board and agents write) and the edits sent on its items (comment tasks). Nothing is
|
||||
# kept by the list.
|
||||
# - Words are changed in a task's details (one click away, in the same column), not in the list's line: a click
|
||||
# on a line opens it, so the line itself stays a single target.
|
||||
# - A task's comments: an edit's replies; a brief task's are its linked item's open comments. A brief's task has
|
||||
# nowhere of its own to keep a comment yet.
|
||||
# - In the Inbox a new task goes to the project picked beside the line (the first, until picked).
|
||||
# - Reorder is within a project's brief tasks; an edit keeps its place by when it was sent.
|
||||
# Left: no keyboard shortcut opens the list; the Board's card sheet still edits a task's agents, due date and tags.
|
||||
|
||||
@done
|
||||
Scenario: FT2a. Where the agents button was, in a feed and in the Inbox
|
||||
Then a feed's header has no agents button; a checkbox there opens the to-do list in a column on the right
|
||||
And in a project's feed it is the project's list; in the Inbox the workspace's, each project's tasks under its name
|
||||
And its tooltip says what it is; the column closes from its own button and is as it was left next time
|
||||
|
||||
@done
|
||||
Scenario: FT2b. Minimal, skimmable
|
||||
Then a task is one line: a checkbox, its words, and who has it when someone does
|
||||
And its handle and Remove show only on the line pointed at or focused
|
||||
And done tasks are folded away under a count ("2 done"), opened by a click
|
||||
|
||||
@done
|
||||
Scenario: FT2c. Edited where it is read, written at once, with Undo
|
||||
When I type a line and press Enter, check a task off, change its words, drag it by its handle (or Alt+Up/Down),
|
||||
or remove it
|
||||
Then the change is written at once to where the task lives (the brief; a linked item's status; the comment)
|
||||
And Undo at the column's foot, or Cmd+Z, takes the last change back
|
||||
But a brief's change is undone only while the brief is still as that change left it
|
||||
|
||||
@done
|
||||
Scenario: FT2d. A click opens a task's details; Esc goes back
|
||||
Then the details show its words, who is on it and what they last did, the feed item it is linked to, its comments
|
||||
And an agent at work on it in one of the app's own sessions can be stopped there, with its subagents listed
|
||||
And Esc goes back to the list, not out of the feed
|
||||
|
||||
Rule: FT3. A session started outside the app is in the feed while it is open
|
||||
# Status 11-13: built, in 0.1.3: raea-feed #12, merged ab68f0d (7e90a7c, a2dc439). host/outside.ts (POST
|
||||
# /host/outside), src/feed/outside.ts, OutsideKeeper.tsx, OutsideBubble.tsx. No feed tool was added or changed.
|
||||
# Checked: e2e/outside.spec.ts 2 of 2 in Chrome and in the window (the host's list given by the spec);
|
||||
# host/outside.test.ts on files written as Claude Code writes them; the reader run against this Mac's six real
|
||||
# sessions. Not checked: a real session ending while the app's own window is watched by a person.
|
||||
# The signal, the smallest honest one: what the harness already keeps. Nothing new is asked of any session.
|
||||
# - Claude Code keeps ~/.claude/sessions/<pid>.json for each open session ({pid, sessionId, cwd, name, status})
|
||||
# and its transcript, <sessionId>.jsonl in its projects folder.
|
||||
# - active: its file is there, its process is alive, and a person runs it (kind "interactive"). Holding a claim
|
||||
# alone is not active: a task a session has that has ended still names it, without a live mark.
|
||||
# - working: the file says "busy"; otherwise it is open and waiting at its prompt.
|
||||
# - an update: its last words, the tool call at hand, its plan (the last TodoWrite), read from the transcript's
|
||||
# end; an item it posts and a task it marks are already in the feed and on the task.
|
||||
# - ended: the host no longer lists it.
|
||||
# Left: Codex, Gemini, Kimi and the rest keep no file that says a session is open, so they are in the feed only
|
||||
# by what they post; a session working in a folder that is no project's and that has posted nothing is in no
|
||||
# feed (Shane's own lanes in ~/raea are this case until they `raea show` something); rask claims and the lanes
|
||||
# board are not read.
|
||||
|
||||
@done
|
||||
Scenario: FT3a. One bubble a session, in the projects it is in
|
||||
Given a Claude Code session open on this Mac
|
||||
Then it has one bubble in the feed of each project whose folder it works in or that it has posted to
|
||||
(its posts carry its inbox, claude-code-<the first 8 of its id>, as `raea show` names it), and in the Inbox
|
||||
And a session that is in no project's folder and has posted nothing is in no feed
|
||||
|
||||
@done
|
||||
Scenario: FT3b. It reads as the app's own sessions do, without a Stop
|
||||
Then the bubble says its name and harness, that it is working (and for how long) or waiting at its prompt,
|
||||
the step at hand, its last words, and its plan
|
||||
And there is no Stop: a mark beside its status says where it runs and that it is stopped there
|
||||
|
||||
@done
|
||||
Scenario: FT3c. Its updates come as it goes, and it ends when the session does
|
||||
When it says something new or starts another step
|
||||
Then the same bubble shows it within a few seconds, written only when what it shows has changed
|
||||
When the session is no longer open
|
||||
Then the bubble ends, its last words kept; a session that comes back opens it again
|
||||
|
||||
@done
|
||||
Scenario: FT3d. It ties to the to-do list
|
||||
Then a brief's task that @names the session, and an edit on an item it posted, are its tasks
|
||||
And the bubble names them, and the to-do list shows the session on them with what it last did
|
||||
|
||||
# Status 11-13 (FT3e, FT3f): built for 0.1.4 in raea-feed #25, stacked on #24; neither merged, both wait for Shane.
|
||||
# Shane 11-13, on the cards: "even if i started the chat or session out of raea app i can open up the chat in a
|
||||
# raea chat ui ... show what agent is working on what or any subagents and feel more like i can click to see more
|
||||
# and less rows of info". Checked: e2e/outside.spec.ts 3 of 3 in Chrome, with the host's answers given by the
|
||||
# spec; host/outside-chat.test.ts and host/outside.test.ts on files written as Claude Code writes them;
|
||||
# bridge-resume.test.ts on a test agent that offers fork. Not checked: a fork through the real claude-agent-acp.
|
||||
# Left: other harnesses' transcripts (only Claude Code's is read), and an image a prompt carried.
|
||||
Scenario: FT3e. Open chat opens it as a chat in raea
|
||||
When I press Open chat on its bubble
|
||||
Then its conversation so far opens as one of the workspace's chats: my prompts, its replies and thinking, its
|
||||
tool calls with their results and diffs, and its plan, read from its transcript (the newest 6 MB, saying so
|
||||
when older messages were left out)
|
||||
And a line at the top says where it was started and what writing there does
|
||||
And while it is still open where it runs, what it says next shows in the chat as it says it
|
||||
And opening it starts no agent
|
||||
When I write in that chat
|
||||
Then the agent carries it on in the folder it ran in: a copy of it (forked) while it is still open there, so the
|
||||
one there goes on by itself, or the session itself (resumed) when it has ended
|
||||
And from then on it is raea's chat, and following stops
|
||||
|
||||
Scenario: FT3f. Its bubble says who is on what, folded until I open it
|
||||
Then folded, the bubble says what the session is on (its own title, or the name it was given), what it is
|
||||
doing now, and the subagents it has running
|
||||
When I click the bubble or More, which names what more there is
|
||||
Then it opens to its last message, its plan, its subagents (the running ones with the call each is on, then
|
||||
the latest done, with how many more are done) and the notes of mine it has
|
||||
And Less, or another click, folds it again
|
||||
@@ -438,7 +438,7 @@ Feature: Fingerprint: a person's or a team's sense of good work, learned on thei
|
||||
feed with the fingerprint that judges it, asks first where a head goes against the person's own label on that
|
||||
moment, then where a head sits nearest its flag, one per axis and piece within 4 s, at most ten, as Yes/No
|
||||
questions in one `raea show` item with the moment cut to a clip; `--tally` makes each answer a "postmortem" row,
|
||||
retrains and prints each head's held-out AUC before and after. Archiving a project runs it in the background (raea-feed PR #5, not merged yet)
|
||||
retrains and prints each head's held-out AUC before and after. Archiving a project runs it in the background (raea-feed #5, in the 0.1.2 app)
|
||||
|
||||
Rule: FP8. Teams
|
||||
@needs:FP2d @done
|
||||
@@ -533,7 +533,7 @@ Feature: Fingerprint: a person's or a team's sense of good work, learned on thei
|
||||
notes' rows. `move [--fp CHILD] [--to PARENT] --axis/--source/--project` takes the 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
|
||||
|
||||
@needs:FP14c
|
||||
@needs:FP14c @done
|
||||
Scenario: FP14e. Managing them in the app
|
||||
Then the fingerprint page lists the person's fingerprints as a tree by `extends`, each with its `about`, where it
|
||||
applies, its labels and what it knows; one is shown at a time, and a project's page names the one judging it
|
||||
@@ -546,8 +546,10 @@ Feature: Fingerprint: a person's or a team's sense of good work, learned on thei
|
||||
Settings makes one the default and trains it; headless, the app made client-ads from me in 34 s and trained it
|
||||
from 12 renders in 3m54s (910 rows, 6 axes gating). Since: the switcher is a tree by `extends`, each saying
|
||||
which kinds and tags it judges; "New fingerprint" asks which it judges (`new --kinds --tags`); a project's header
|
||||
names the one `raea fingerprint which` picks, why in its tooltip. Not yet: making one in a project's or
|
||||
workspace's folder from the app (`share` does it from the CLI)
|
||||
names the one `raea fingerprint which` picks, why in its tooltip. 11-13 (raea-feed #8): that name is a menu
|
||||
saying who judges and why, with Keep with this project and Keep with the workspace listing the person's
|
||||
fingerprints; the host runs `share` and `use` there and commits the folder in the repo that holds it.
|
||||
Tests: host/fingerprint-keep.test.ts (the real raea in a throwaway home), e2e/fingerprint-keep.spec.ts
|
||||
|
||||
Rule: FP9. Agents use it, and can't game it
|
||||
@needs:FP3a,FP4b,FP5c
|
||||
@@ -594,14 +596,22 @@ Feature: Fingerprint: a person's or a team's sense of good work, learned on thei
|
||||
followed it left across the frame, a looser box (overlap 0.41). A blind seed in the middle of an app render
|
||||
kept only the note's frame, so only its own window
|
||||
|
||||
@needs:FP11b
|
||||
@needs:FP11b @done
|
||||
Scenario: FP11c. Marks on the sound
|
||||
Given the review player shows a sound's spectrogram under its picture (or in its place, for sound alone)
|
||||
Then a box drawn on it is a note's mark there, kept in 0-1 of the span shown (time) and of the frequencies (mel)
|
||||
And on a defect note on a sound axis, `learn-notes` makes its time the label's span and keeps its band in the row
|
||||
And decided 11-12: not in 0.1.2. The player draws no spectrogram, and raea-feed is fixed at what 0.1.2 ships.
|
||||
Until then a sound note's span (FP11a) is its time label, and the sound heads are per window, so a band
|
||||
would be kept but not yet learned from
|
||||
And decided 11-12: not in 0.1.2; built 11-13 for 0.1.3 (raea-feed #9). The host draws a mel
|
||||
spectrogram (host/spectrum.ts: 22.05 kHz, 64 bands to 11.025 kHz, a column every 25 ms, the loudest 80 dB),
|
||||
the timeline's sound track offers it as Spectrogram (opened tall), and Listen shows it under the waveform.
|
||||
A box dragged on it (with the Comment tool on the timeline, any drag in Listen) opens the moment card naming
|
||||
its span and band in Hz; the note's pin is a time pin over the box's span with one mark {kind: "box", on:
|
||||
"sound", points: [[time, mel], [time, mel]]} in 0-1 of the piece and of the mel scale, drawn again on the
|
||||
spectrogram in its author's hue, and the agent reads it as "Marked on the sound (box, T0 to T1, LO to HI)"
|
||||
(e2e/sound-marks.spec.ts, src/detail/marks.test.ts, host/spectrum.test.ts). `marked` ignores a sound box (it
|
||||
is no place in the frame); `sound_band` reads its band into the reading, and `learn-notes` labels t..to
|
||||
(widened to half a second about its middle when shorter) and keeps a defect's band in the evidence row's
|
||||
`band`. The sound heads are still per window, so the band is kept but not yet learned from
|
||||
|
||||
Rule: FP12. Heatmaps: a picture axis says where, not only whether
|
||||
@needs:FP11b,FP2c @done
|
||||
|
||||
@@ -19,6 +19,12 @@ about a piece, such as a soft picture, dead motion, noise under the voice or a c
|
||||
device**. On top of the axes sit the person's **weighting** across them, an optional **profile** (ranges taken from
|
||||
work they admire) and the **evidence ledger** that every head was trained from.
|
||||
|
||||
The frozen encoders together are the **Edit Embedding Zoo** (Shane, 11-13: the standard name, in the docs, the app
|
||||
and anything we publish): SigLIP 2 for pictures, CLAP for how it sounds, YAMNet for sound events and their timing,
|
||||
EmbeddingGemma 2 for text and Depth Anything 3 for depth. They are pinned, run on the person's device and are the same
|
||||
for every fingerprint. A fingerprint is what a person trains over the zoo: its axes' heads. The zoo itself never
|
||||
changes.
|
||||
|
||||
On day one, an axis's words already give it a zero-shot score. Each label the person adds retrains its head in
|
||||
milliseconds. Whatever can be measured exactly, such as loudness, silence gaps, frozen frames or one thing passing
|
||||
through another, is a check rather than a learned head. A team shares evidence, never media, and each machine
|
||||
|
||||
@@ -0,0 +1,561 @@
|
||||
Feature: Procedural arms and hands: a character reaches for, takes, holds, carries and throws things
|
||||
Set by the user 2026-11-14: the character SDK's arms and hands should grab, hold and move things procedurally,
|
||||
built in Rust for the engine from a mixture of musthafa45/Ik-Object-Holding, NVlabs/SOMA-X and whatever else
|
||||
helps, with research into what else would broaden the character SDK (bodies, interactions, movement), and a look
|
||||
at patch.gg.
|
||||
|
||||
Where this sits beside docs/character.md: that plan's actions (C5, C6) are played from captures, with IK only to
|
||||
hold a contact. This is the other half: an action with no capture of it. The same rules hold where they can:
|
||||
every solver reports how far it moved the pose and how far it missed (principle 2), the whole action is a
|
||||
function of time (principle 9), and the body's own motion (a clip, a walk) comes in untouched and is only changed
|
||||
where a hand needs it.
|
||||
|
||||
What the sources gave:
|
||||
- Ik-Object-Holding (MIT, Unity C#, 484 lines of script): hold points found by casting a ray from each side of
|
||||
the holder back into the thing's collider (ColliderEdgeDetector); hands eased onto them with two-bone IK and
|
||||
an aim; the thing parented to a hold transform in front of the chest and drawn to it; drop and throw. Its
|
||||
easing is a per-frame lerp (frame-rate dependent, not frame-pure) and its hands have no fingers and no palm
|
||||
turn. Ported as: hold points in the thing's own frame with the surface's facing, eases as curves of time.
|
||||
- SOMA-X (Apache-2.0, NVIDIA): a canonical body and hand rig that other body models map onto. For this work it
|
||||
gave the swing-twist split with half-angle stabilisation and the twist shares along a segment (0.05, 1/3,
|
||||
2/3, 0.95 over four twist joints), used here to move a wrist's twist to the forearm. Its other parts are for
|
||||
later: a wrist-local hand layer with a learned articulation prior (SOMAHand.npz: what hand shapes are
|
||||
natural), pose inversion (joint turns fitted to points), and body-model interop including Anny. It needs
|
||||
PyTorch and Warp; nothing of it runs in the engine as it is.
|
||||
- Around SOMA: Kimodo (Apache-2.0 code; the SEED weights under NVIDIA's Open Model License, said to allow
|
||||
commercial use; the SMPL-X weights are research-only) makes motion from text and constraints. MotionBricks, a
|
||||
real-time in-betweener, has preview code in GR00T-WholeBodyControl with no plain licence on the repository
|
||||
and sample motions under an evaluation-only licence: not usable until that is read. BONES-SEED (motion in
|
||||
SOMA's format) has its own licence, gated: unread. ProtoMotions (Apache-2.0) trains physically simulated
|
||||
characters.
|
||||
- Rust IK crates: bevy_mod_inverse_kinematics (to Bevy 0.16), bevy_fabrik (no multi-chain), bevy_ik (Bevy
|
||||
0.9). None is on Bevy 0.20, none does a two-bone solve that keeps a clip's twist or reports what it changed,
|
||||
so the solver here is ours: 170 lines.
|
||||
- Grasping research (Lightning Grasp and the like) is for robot hands, has no plain licence, and solves
|
||||
grasp stability, which a character doesn't need. A character's hand needs to look right: the palm on the
|
||||
surface, the fingers wrapped to the shape. Curling each joint until its bone meets the surface does that.
|
||||
- patch.gg: a place to publish browser games and mods, with a CLI (pch), an MCP server and an asset library of
|
||||
50,000 open-licensed models, characters and sounds. It is not an engine and has nothing for IK or hands.
|
||||
Its installer writes a "use Patch for games" section into ~/.claude/CLAUDE.md for every agent on the machine,
|
||||
which would put Patch ahead of raea in every session here: not installed. Its asset library conflicts with
|
||||
the rule that every model in a raea piece is made by us. Worth taking from Patch: its open repositories.
|
||||
anymove (Apache-2.0) captures motion for any rigged creature from one generated two-view video (about $3 a
|
||||
usable move, needs an NVIDIA card with 12 GB, 58% of clips pass) and is the one that fits: animals and
|
||||
creatures, where raea has no captures. crowdbricks (Apache-2.0) batches MotionBricks and inherits its
|
||||
licence question. Publishing a raea playable on Patch is a distribution question, not a character one.
|
||||
|
||||
Rule: Built
|
||||
|
||||
@done
|
||||
Scenario: HG0. Where it lives
|
||||
# Two crates, split when the first passed 2,000 lines: raea-sys-body is the character's body in Rust (what
|
||||
# sdk/body is in TypeScript), raea-sys-grab is what the hands do with things.
|
||||
Then the plan:
|
||||
| crate | file | lines | job |
|
||||
| raea-sys-body | src/rig.rs | 240 | the rig, poses, forward kinematics, a hand's frame, a stand-in body |
|
||||
| raea-sys-body | src/arm.rs | 200 | two-bone IK, the reach that leans, the forearm's twist, twist joints |
|
||||
| raea-sys-body | src/limits.rs | 260 | joint ranges as anatomical angles, a turn brought inside, violations |
|
||||
| raea-sys-body | src/fit.rs | 120 | a pose fitted to points seen |
|
||||
| raea-sys-body | src/prior.rs | 150 | the hand prior: shapes, coefficients, oddness |
|
||||
| raea-sys-body | src/shape.rs | 130 | solids as signed distances: casts, normals, clearance |
|
||||
| raea-sys-grab | src/hand.rs | 200 | holds, the wrist that lays a palm on one, the fingers' curl |
|
||||
| raea-sys-grab | src/trunk.rs | 130 | stoop, look, clearances, where to stand |
|
||||
| raea-sys-grab | src/interact.rs | 40 | which thing is taken |
|
||||
| raea-sys-grab | src/take.rs | 460 | the take's timeline, each hand's part, the frame's solve |
|
||||
| raea-sys-grab | src/grip.rs | 110 | the hand's lie at its grab, the swivel, an arm past its ranges |
|
||||
| raea-sys-grab | src/json.rs | 150 | character.take |
|
||||
| raea-sys-body | src/json.rs | 110 | character.fit, character.hand, character.soma, shared readers |
|
||||
| raea-sys-body | src/soma.rs | 110 | a pose from a SOMA body's joint places |
|
||||
| sdk | sdk/character/src/soma.ts | 80 | a SOMA animation read from text USD; somaPose |
|
||||
| raea-sys-grab | tests/grab.rs | 470 | the hands' measures, on the stand-in body |
|
||||
| raea-sys-grab | tests/body.rs | 150 | limits, the body out of solids, the hand prior |
|
||||
| raea-sys-grab | tests/use.rs | 230 | passing, sliding, wind-up, a turned body, keeping out of solids |
|
||||
| sdk | sdk/character/src/take.ts | 190 | take(), fitPose(), handShape(): the calls made, typed |
|
||||
|
||||
@done
|
||||
Scenario: HG1. An arm reaches a target, and says what it cost
|
||||
# 11-14, built: raea-sys-body arm.rs. On the stand-in body, 600 random targets inside the arm's reach are hit
|
||||
# within 0.1 mm; a target 20 cm past the arm is missed by 20 cm and flagged; a wrist already on its target
|
||||
# turns nothing; the pole puts the elbow on its side of the line within a degree; a reach 12 cm past the arm
|
||||
# lands within 5 mm by leaning the clavicle, chest and spine, each under its cap, and names them.
|
||||
Given a pose of the game_engine rig and a place for a wrist
|
||||
When the arm is solved for it
|
||||
Then the wrist is there when the arm reaches, the elbow bends about the hinge it had, and the pole chooses
|
||||
where the elbow points
|
||||
And past the arm's length the trunk leans, by capped shares, and the report names every joint turned
|
||||
And a wrist's twist is shared with the forearm, the hand staying where it was
|
||||
|
||||
@done
|
||||
Scenario: HG2. Hold points are found on the thing itself
|
||||
# 11-14, built: shape.rs, hand.rs. A box 36 cm wide gets a hold on each side face, facing out; a cup 8 cm
|
||||
# wide gets one hand; a turned thing's holds are on its surface from wherever the holder stands; the palm's
|
||||
# skin lies on the hold within 0.1 mm, facing into it, fingers the way the holder faces.
|
||||
Given a thing as a ball, a box, a capsule or a cylinder, placed and turned, and where the holder stands
|
||||
When its holds are asked for
|
||||
Then a thing wider than a hand's span gets a hold on the holder's left and one on the right, where a ray
|
||||
from that side meets its surface, each with the way the surface faces
|
||||
And a narrower thing gets one hand's hold
|
||||
And the holds are kept in the thing's own frame, so they ride with it
|
||||
|
||||
@done
|
||||
Scenario: HG3. Fingers wrap what they hold
|
||||
# 11-14, built: hand.rs `curl`. Each joint, knuckle first, opens past rest and bends until its bone meets
|
||||
# the surface. On a carried box at least three fingers of each hand are on it and none is over 12 mm inside.
|
||||
# The curl is solved with the hand at its hold, not where the arm has got it to, so it doesn't flicker as
|
||||
# the hand comes in (it did: 24 degrees a frame).
|
||||
Given a hand at its hold on a thing
|
||||
When its fingers close
|
||||
Then each finger bends until it meets the surface, a finger that meets nothing closes loosely, and a finger
|
||||
that is inside the thing even opened is reported, not hidden
|
||||
|
||||
@done
|
||||
Scenario: HG4. Reach, grab, lift, carry, put down or throw, as one function of time
|
||||
# 11-14, built: take.rs `perform`. From the grab to the release both palms stay within 6 mm of their holds
|
||||
# at 30 frames a second; a cup carried while the body turns 34 degrees and back stays upright the whole
|
||||
# way and is set down within 0.1 mm of its place; a thrown box flies, lands on the floor and stays; the
|
||||
# body is back on its own motion 0.4 s after letting go. A frame asked for twice, in any order, is the same
|
||||
# frame; no joint of the body turns over 6 degrees in a 60th of a second, no finger joint over 20.
|
||||
Given the body's own motion as a pose at any time, a thing, and its holds
|
||||
When a frame of the take is asked for
|
||||
Then the hands leave the body's motion, come onto the holds from off the surface, and close
|
||||
And the thing is drawn to a carry place off the chest and rides there, turned only with the body's facing
|
||||
And a put sets it down at a place, a throw lets it go with a velocity and it falls to the floor
|
||||
And every frame says how far a wrist missed and how far the body was turned from its own motion
|
||||
|
||||
@done
|
||||
Scenario: HG5. A character in a scene takes a thing
|
||||
# 11-14, built: raea/character's `take(skel, base, spec, t)` (sdk/character/src/take.ts) makes the native call
|
||||
# character.take (runtime/calls), which is systems/grab's `take_json`; the answer is the pose for <Character>
|
||||
# and the thing's place. Asked as JSON it is the same frame as asked in Rust (a test). Rendered on teal, the
|
||||
# Character SDK project's drawn character, 1.70 m (the sheet3d project's compositions/take.tsx, out/take.mp4;
|
||||
# first on a 1.81 m MakeHuman person, the same code): a box taken off a table with both hands and thrown, a
|
||||
# cup moved across the table in one hand, upright, the fingers round it, a box lifted from the floor onto
|
||||
# the table; 735 frames, no errors. Shane hasn't watched it.
|
||||
Given a <Character> and a thing in a 3D scene
|
||||
When the scene says the character takes it (which thing, when, then put where or thrown how)
|
||||
Then the engine works out each frame's pose and the thing's place, in a render and in live play alike
|
||||
And TypeScript reaches it as one native call (core/calls), typed, with the report per frame
|
||||
And the body's own motion is whatever the character was playing
|
||||
|
||||
@done
|
||||
Scenario: HG6a. Hands stay out of the scene's solids
|
||||
# 11-14, built: trunk.rs `clear`, a take's `avoid` list. A wrist's place is moved the least that keeps the
|
||||
# wrist, the palm and the fingers' reach 2 cm clear of every solid named; the wrist's path arcs up 6 cm and
|
||||
# leaves a hold backing off its surface. With a table under a cup, no point of the hand is in the table at
|
||||
# any frame of the take, and keeping clear costs the hold under 6 mm. Seen on turbo: the hand comes over the
|
||||
# table's edge onto the cup and leaves it without passing through the top.
|
||||
Given a take with the solids round it named (a table, a shelf)
|
||||
Then no frame has the hand inside one, and the hold is still kept
|
||||
|
||||
@done
|
||||
Scenario: HG7a. A low thing is taken by bending, the feet planted; and the body is told where to stand
|
||||
# 11-14, built: trunk.rs `stoop` and `stand_for`. For hands that must go lower than 0.7 of an arm below the
|
||||
# shoulders, the hips come down and the trunk bends at the hips and along the spine, by as much as the hands have got along their reach, so the body rises again as the thing is
|
||||
# lifted. Leg IK keeps both ankles where they stood within 5 mm and the feet's turn. A box on the floor is
|
||||
# held within 2 cm; the hips come down over 30 cm and are back up with the box carried. `stand_for` gives
|
||||
# the place a forearm's length off the thing's near face, facing it; standing there both hands reach.
|
||||
# character.take answers it as `stand`. Seen on turbo: a box lifted from the floor onto a table. Not right
|
||||
# yet: the body itself keeps out of nothing (the head went into the table that stood 38 cm in front). The
|
||||
# squat was retuned after the first render folded the head to the knees: the hips take three quarters of it
|
||||
# (to 0.55 m), the trunk bends to 49 degrees, and the head looks at the thing.
|
||||
Given a thing lower than the arms reach, or out of reach
|
||||
Then the body bends and squats for a low one with its feet where they stand
|
||||
And for a far one the take says where to stand and which way to face
|
||||
|
||||
@done
|
||||
Scenario: HG4a. The carry is against the body
|
||||
# 11-14: a two-handed thing rides 10 cm under the chest joint, 20 cm plus half its size in front, so the
|
||||
# elbows bend and the lift shows (it was carried at arm's length, hardly lifted).
|
||||
Then a carried box is held against the belly with the elbows bent
|
||||
|
||||
@done
|
||||
Scenario: HG5a. The rest of both sources, in Rust
|
||||
# 11-14, built. From Ik-Object-Holding: its Interactor is interact.rs `pick` (the nearest thing in a radius
|
||||
# that the eyes see past the scene's solids; the original takes the first collider found), and its head aim
|
||||
# is trunk.rs `look` (neck two fifths, head the rest, 55 degrees at most), on through a take: the eyes go to
|
||||
# the thing as the hands do. With HG2 and HG4 that is every script of the original that isn't Unity input or
|
||||
# animator glue. From SOMA-X: fit.rs `fit` is the analytical pass of its pose inversion on marks instead
|
||||
# of mesh vertices (joints refitted parents first, each aligned to what it carries; the root on its own
|
||||
# marks), and arm.rs `twist_joints` is its procedural twist-joint evaluator (shares 0.05, 1/3, 2/3, 0.95;
|
||||
# an upper segment undoing its own joint's twist). 20 random poses, every joint turned up to 50 degrees,
|
||||
# are recovered from joint heads and bone ends with every joint within 4 mm. raea/character's
|
||||
# `fitPose(skel, marks)` is the native call character.fit; on turbo a second body posed only from the
|
||||
# first one's joint positions stands as the first does through a take (fingers aside: positions alone
|
||||
# don't give a bone's twist). A wrist stops at 70 degrees and the frame says so (`limited`); the fingers
|
||||
# point the level way the arm comes, so it is rarely asked for more.
|
||||
# Not converted, and why: SOMA's body and hand layers, identity models and correctives are a different
|
||||
# mesh and a 78-joint rig driven by PyTorch and Warp, and raea's body is MakeHuman's; its hand
|
||||
# articulation prior (SOMAHand.npz, 32 components over SOMA's 24 finger joints, bind-relative) needs
|
||||
# SOMA's finger frames mapped onto game_engine's 15 finger joints before a score means anything (done
|
||||
# since: HG5b); its Lie-algebra and autograd refinements fit mesh vertices through skinning, which marks don't need.
|
||||
Then a body can choose what to take, look at it, and be posed from positions seen
|
||||
|
||||
@done
|
||||
Scenario: HG6b. The arms inside the rig's ranges, and the head and chest out of the scene's solids
|
||||
# 11-14, built. limits.rs is sdk/body's axes.ts and limits.ts in Rust: each joint's turn read as flex, side
|
||||
# and twist from the rest pose, the same ranges (13 roles, the right side mirrored), a turn brought inside
|
||||
# them, a pose's violations. Through a take every joint of both arms is inside its range and a frame that
|
||||
# had to hold one says so (`limited`). trunk.rs `roomy`: when the solved pose puts the head's top, the neck
|
||||
# or the chest within 9 cm of a solid in a take's `avoid`, the take is solved again with less bend and
|
||||
# lean and more squat (to 0.82 m of hips), a sixth at a time. With a table 38 cm in front and a box on the
|
||||
# floor between, none of the three is in the table at any frame and the hold is kept within 5 cm; with no
|
||||
# table the same take bends over where the table was. Seen on teal: an upright deep squat beside the
|
||||
# table, the head clear, the eyes on the box. Not done: the knees and the forearms keep out of nothing,
|
||||
# and the two copies of the limits (TypeScript, Rust) are kept in step by hand.
|
||||
Then no arm joint is past its range, and bending never puts the head or chest into a solid
|
||||
|
||||
@done
|
||||
Scenario: HG5b. SOMA-X's hand prior on raea's fingers
|
||||
# 11-14, built. raea-sys-body prior.rs and data/soma_hand_prior.bin (12 KB; data/README.md has its source and licence):
|
||||
# the left hand's 32-component model of real hand poses, cut to the fifteen finger joints raea has (the
|
||||
# metacarpals and fingertip ends left out; 99% of the first component is on the kept joints). SOMA's
|
||||
# turns are from its flat bind hand in the wrist's axes (fingers along +x, palm +z); each raea finger bone
|
||||
# is pointed where SOMA's would, in the hand's own rest frame, the right hand mirrored. `shape` gives a
|
||||
# hand from a few numbers: none is the average relaxed hand, the first opens it (+2) and closes it to a
|
||||
# fist (-2). `coefficients` reads a hand back (a shape's numbers within 0.05, under half a degree left
|
||||
# over) and `oddness` compares hands: the average 0, the rig's rest hand 2.0, fingers bent back at the
|
||||
# middle joint 4.3. A take now opens the hand as it comes in (the first number at +1.5) before the
|
||||
# fingers shut. raea/character's `handShape(skel, side, z)` is the native call character.hand. Seen on
|
||||
# teal: the sweep goes from a fist to an open hand, on a hand mesh whose skinning is coarse.
|
||||
# Still not converted: SOMA's body and hand meshes, identity models and correctives (a different mesh
|
||||
# and a 78-joint rig on PyTorch and Warp), and the vertex-fitting refinements of its pose inversion.
|
||||
Then a hand can be given a natural shape by number, and any hand can be scored against real ones
|
||||
|
||||
@done
|
||||
Scenario: HG8a. A thing held one way brings its holds
|
||||
# 11-14, built. A hold can come with the thing (`holds`, in its own frame: where the palm goes, the way the
|
||||
# surface faces, optionally the way the fingers point and the hand's shape as the hand prior's numbers); any
|
||||
# other thing has its holds found (HG2). A hold with a shape takes that shape instead of the curl. Where a
|
||||
# hold doesn't say, the fingers lie along the forearm as it arrives (the arm solved to the hold alone
|
||||
# first), brought level by halves where that would tip them into a solid; and the elbow's swing is chosen,
|
||||
# 10 degrees at a time, as the nearest that keeps the shoulder and the elbow inside their ranges. A mug
|
||||
# held by its side in a loose fist keeps the palm within 15 mm of its hold from the table to the mouth and
|
||||
# back with no joint at a limit; with the fingers forced to point forward the same take reports the arm at
|
||||
# its limits and the palm up to 18 cm off, which is the report doing its job.
|
||||
Then a mug, a grip or a handle is held the way it says, and a hold no arm can make is said, not faked
|
||||
|
||||
@done
|
||||
Scenario: HG9a. Using what is held: a path the hands follow
|
||||
# 11-14, built. A take's `path`: where the carried thing is at times, off the chest, and how it is tipped;
|
||||
# eased from the carry place through each key. A drink is one key at the mouth, tipped 29 degrees. The
|
||||
# thing is exactly at each key at its time, and upright again after. A lift and a put-down now arc 4 cm so
|
||||
# the thing leaves what it stood on before it travels. Seen on teal: a mug to the mouth and back to its
|
||||
# place. Not done: passing a thing from hand to hand or to another character, and pushes, pulls and turns
|
||||
# of things that stay where they are (a door, a drawer).
|
||||
Then a held thing can be raised, tipped, aimed or swung by giving where it goes
|
||||
|
||||
@done
|
||||
Scenario: HG10a. Weight
|
||||
# 11-14, built. `weighing(kg)` (a take's `weight`): the carry place 1.5 cm lower a kilogram (to 18 cm) and
|
||||
# a little closer, the lift an eighth longer a kilogram, the waist leaning back 0.7 degrees a kilogram (to
|
||||
# 11). 12 kg: carried over 10 cm lower, the lift 0.75 s longer, the chest behind where a light take has
|
||||
# it, both palms still on. Seen on teal with 14 kg. Not done: a throw's wind-up and follow-through.
|
||||
Then a heavy thing is held low and close, lifted slower, and leant against
|
||||
|
||||
@done
|
||||
Scenario: HG9b. Passing a thing, moving a thing where it is, and a throw's wind-up
|
||||
# 11-14, built. Each hand now has its own part in a take (when it leaves the body's motion, when it is on,
|
||||
# when it lets go), so hands can come and go separately. `passing(at)` (a take's `pass`): a thing held in
|
||||
# one hand is brought to the middle, the other hand takes it on its far side (`Hold::across`), and it is
|
||||
# carried on that side; one palm or the other is within 15 mm of its hold at every frame, both at the
|
||||
# pass, and the thing stays upright. `slide` and `Release::Leave` (a take's `slide`, `leave`): a thing
|
||||
# that isn't carried goes through places where it is, the hands staying on, and is left there; a drawer's
|
||||
# front pulled 18 cm keeps the palm within 3 cm of its handle and never leaves its runners. A throw draws
|
||||
# the thing back 18 cm against the throw over its last 0.4 s and brings it through, and the hands follow
|
||||
# it out 20 cm before coming back. Seen on teal: the cup passed right to left, a drawer pulled open, the
|
||||
# box drawn back before it is thrown. The arm let go swings back in half a second, up to 26 degrees a
|
||||
# frame at 30 a second, which may read as abrupt. Not done: a thing passed to another character.
|
||||
Then a thing changes hands with somebody always holding it, a drawer is pulled and left, a throw winds up
|
||||
|
||||
@done
|
||||
Scenario: HG6c. Forearms, knees and the carried thing out of the scene's solids
|
||||
# 11-14, built. An elbow swing that puts the elbow or the middle of the forearm within 3 to 4 cm of a solid
|
||||
# counts as far past its range, so another swing is chosen. A squat whose knee would be within 7 cm of a
|
||||
# solid sits back from it, 4 cm at a time. A lifted thing rises by how deep its corners would be in a
|
||||
# solid. With a table 38 cm in front, a box lifted from the floor onto it: no knee or elbow is in the
|
||||
# table at any frame, and no corner of the box is over 5 mm into it on the way. The body bends for a
|
||||
# thing only when it is lower than 0.88 of an arm below the shoulders (0.7 squatted for a drawer handle
|
||||
# a hanging arm reaches). Not done: the body's own shape (an arm through the torso, a thing through
|
||||
# the thighs), which sdk/body's shape.ts knows and the Rust does not.
|
||||
Then the limbs and the thing clear a table as the hands, head and chest do
|
||||
|
||||
@done
|
||||
Scenario: HG7b. Walking up to the thing, and a thing handed to another body
|
||||
# 11-14, built. A take works wherever the body stands and faces: a body turned 120 degrees and moved 2 m
|
||||
# keeps its palm within 12 mm of the hold and carries the cup in front of where it faces. raea/character's
|
||||
# `placedPose` stands a pose somewhere else; `walkUp(clip, fps, seconds, stand, to, yaw)` is the body's own
|
||||
# motion for arriving: a walk capture played from its start and set down so it ends at a take's `stand`
|
||||
# walking the way it faces, then eased into a stand over half a second; the take starts when it arrives.
|
||||
# A hand-over needs nothing new: the giver's take holds the thing out on a path and leaves it at the
|
||||
# moment the taker's take, on a body placed facing it, has its hand on. Seen on teal: walking up to the
|
||||
# table and moving the cup; a second teal taking the cup from the first one's hand. Not right: the feet
|
||||
# slide as the walk settles (the project's one walk capture doesn't stop), and the walk isn't chosen or
|
||||
# steered (that is sdk/body's locomotion, which needs a library for the body).
|
||||
Then a body can arrive where a take says to stand and take the thing, and give it to another body
|
||||
|
||||
@done
|
||||
Scenario: HG6d. An elbow out of the body's own trunk
|
||||
# 11-14, built. trunk.rs `torso`: the trunk as a capsule from the hips to the top of the chest, three
|
||||
# fifths of the way out to a shoulder. An elbow swing that puts the elbow within 3 cm of it counts as far
|
||||
# past its range. A cup well to the body's left taken with the right hand: the elbow is outside the trunk
|
||||
# at every frame. Not done: the forearm and the hand against the thighs and the belly, and the thing
|
||||
# against the body.
|
||||
Then reaching across the body doesn't put the elbow through it
|
||||
|
||||
@done
|
||||
Scenario: HG6e. The carried thing and the hands on it out of the body
|
||||
# 11-14, built. trunk.rs `own_solids`: the trunk and both thighs as capsules where the pose has them. A
|
||||
# carried thing is moved the way the body faces until none of its corners, nor a point a hand's length
|
||||
# behind each hold (the wrist), is within 1 cm of them. A deep box asked to be carried inside the belly:
|
||||
# no corner and no wrist is in the body at any frame, the nearest of them is within 4 cm of it, the holds
|
||||
# are kept within 1 cm; a carry that was clear is unchanged. Not done: the forearm against the thighs in
|
||||
# a squat, and the fingers against the body.
|
||||
Then a thing is carried against the body, never in it
|
||||
|
||||
@done
|
||||
Scenario: HG12a. Motion on SOMA's skeleton plays on a raea body
|
||||
# 11-15, built, after the user asked what SOMA-X gives that raea lacks. Not its bodies: its skeleton is
|
||||
# the one NVIDIA's motion models and datasets speak (Kimodo, GEM-X, EgoHand, BONES-SEED), and raea had no
|
||||
# way from its 78 joints to raea's 52. raea-sys-body soma.rs `from_soma`: each of raea's bones is pointed
|
||||
# the way SOMA's matching bone points, at raea's own lengths (so proportions and bind poses needn't
|
||||
# agree), the pose fitted to those places, and each arm's and leg's first bone turned so its elbow or
|
||||
# knee flexes about its own axis (arm.rs `settle_hinge`). A posed body 1.3 times the size, in centimetres
|
||||
# and under SOMA's names, is followed with every bone within 2 degrees and no elbow or knee over 25
|
||||
# degrees sideways. raea/character's `readSomaUsda` reads a SOMA animation saved as text USD and
|
||||
# `somaPose` is the native call character.soma. Shown: SOMA-X's own example animation (900 frames, 24 a
|
||||
# second, Apache-2.0) on turbo, through arms crossed, arms overhead, a side bend and a squat. Open:
|
||||
# positions alone leave a limb's turn about itself to the hinge rule, so forearms and wrists may be
|
||||
# turned wrongly; frames are taken whole, not blended; and no model's or dataset's licence has been read.
|
||||
Then a SOMA animation plays on any raea body, bone for bone
|
||||
|
||||
@done
|
||||
Scenario: HG12b. Generated motion plays on a raea body, its head as the model made it
|
||||
# 11-15. Licences read first. Kimodo: code Apache-2.0; weights under NVIDIA's Open Model License, which
|
||||
# allows commercial use and claims no ownership of outputs. BONES-SEED: granted only to academic users and
|
||||
# companies under a revenue limit, with no redistribution, so raea uses none of it. Kimodo's text encoder
|
||||
# needs a gated Llama model and an NVIDIA card, so nothing was generated here: the four example motions
|
||||
# its repository ships (slow walk, walk then sneak, run and leap, a zombie walk; 30 joints, 30 frames a
|
||||
# second) play on turbo through `somaPose`. The head was tipped back, since one bone direction says
|
||||
# nothing of where a face points: `from_soma` now sets the head's frame from SOMA's head joint and two
|
||||
# eyes, and a hand points at SOMA's middle finger end. The head's pitch on turbo is the source's (15
|
||||
# degrees up at 2 s of the slow walk in both). Open: generating new motion (a cloud step), and judging
|
||||
# it against captures.
|
||||
Then a motion a model generated on SOMA's skeleton plays on a raea body with its head the source's way
|
||||
|
||||
Rule: The bar, set by the user 11-14: a complete tool, not scenarios
|
||||
|
||||
Scenario: HG14. Measured on the body's own skin, the takes are seamless and clip nothing
|
||||
# 11-14, after the third pass was posted: "I doubt you solved it it should be a complete tool with fingers,
|
||||
# grips, holds no clipping into somehting. hwo far away do you need to move to get something how smooth is
|
||||
# the rig is we want perfect seemless motion, npc behaivior, not colliding with things not bending down
|
||||
# weirdly we want something that is complete. as well i notice you use teal which loosk broken stubbed
|
||||
# fingers, broken face, weird body type and skelton." He was right. The scenarios above were judged on
|
||||
# wrists and palm centres, on stills, on a drawn character. tools/hands-audit runs six takes on a clean
|
||||
# body (turbo, 1,588 skin samples, every finger segment) at 60 frames a second and prints the worst of
|
||||
# each measure. First run: body joints jumping up to 6,000 degrees a second in one frame; finger skin 14
|
||||
# to 22 mm inside what it holds; the waist 99 mm inside a box drawn back for a throw; fingers 10 to 30 mm
|
||||
# inside the table; a mug held with no finger pad on it; a floor squat with the hips at a fifth of
|
||||
# standing height. Since: the elbow's swing, the hand's lie on its hold, the squat's give and the knees'
|
||||
# set-back are continuous instead of chosen from steps, and body-joint jumps are down to 400 to 750 in
|
||||
# five of six takes. Then: a bug in the limits (a turn read the long way round, a wrist of 31 degrees held as
|
||||
# if it were 329) that threw the wrist 100 degrees in a frame; the grip is now the one the hand has at its
|
||||
# grab, kept in the thing's frame, so the hand doesn't shift on what it holds; the fingers curl on the
|
||||
# body's own skin samples, and a finger that misses settles at its nearest approach; a thing in one hand
|
||||
# turns about the vertical with the forearm, up to a quarter turn. Second run: body-joint jumps 311 to 955
|
||||
# (from 3,500 to 6,000), finger jumps 67 to 362 (from up to 4,300), finger skin in a cup 4 to 7 mm (from 14
|
||||
# to 15) with 4 to 5 pads on it (from 0 to 2). Still wrong: a box drawn back 99 mm into the waist for a
|
||||
# throw; the floor take (hand 62 mm into the box, hold 27 mm off); the mug at the mouth (palm up to 5 cm
|
||||
# off, wrist at its limit); fingers 7 to 21 mm in the table; the squat's hips at a quarter of standing.
|
||||
# Third run, after: a carried thing pushed out of the body's own skin (as it will be posed, squatting for
|
||||
# a low thing) and after a throw's wind-up; the grip chosen between the forearm's way at the grab and at
|
||||
# the carry; the whole hand's skin kept off solids, 2 cm while it travels and 4 mm on its hold; a hold's
|
||||
# hand shape used only for fingers that miss; the squat eased in and out; the knees making way for the
|
||||
# thing. Body skin in a thrown or heavy box 0 mm (from 99 and 45); skin in the table 0 to 11 mm (from 7 to
|
||||
# 30); finger skin in a box or cup 5 to 8 mm; holds kept within 4 to 9 mm in five takes. Still wrong: the
|
||||
# floor take (hold 83 mm off as the box is pushed clear of the squatting body, fingers 25 mm in it, thighs
|
||||
# 18 mm in it); the mug (fingers 25 mm in it, a thumb that starts inside it); fingers 9 to 11 mm in the
|
||||
# table as a hand leaves; body-joint jumps of 360 to 700; `limited` on about 100 frames a take.
|
||||
# Fourth run, after: a limb's middle joint flexing about its own axis (the first bone turned in its socket),
|
||||
# which ended the false limits (0 frames in three takes, 31 to 76 in the others); the body following the
|
||||
# hands down; the knees opening for a low thing between the feet; a thumb that is in the thing spread out
|
||||
# from the palm until it is clear; a leaving hand kept on its cleared path for longer. Skin in the table 0
|
||||
# mm in four takes (9 in the floor take); finger jumps 67 to 242. character.take now answers `reach`:
|
||||
# whether the body can take the thing from where it stands, and how far it must move if not. Still wrong:
|
||||
# the floor take (hold 69 mm off, fingers 26 mm in the box, thighs 11 mm); the mug (fingers 26 mm in it);
|
||||
# body-joint jumps of 360 to 640. Shown on turbo in the Character SDK project (compositions/take_turbo.tsx),
|
||||
# rendered before this run.
|
||||
# Fifth run, after: a thing held in one hand is where that hand has it (if the wrist is at its limit the
|
||||
# thing turns with the hand instead of passing through it), and the elbow's swing also counts what the wrist
|
||||
# can't do. The mug: finger skin in it 26 to 1 mm, five pads on it (from 2); a moved cup 5 to 2 mm. What
|
||||
# that exposed: at the mouth the mug tips up to 50 degrees where 29 was asked, and its rim goes 14 mm into
|
||||
# the face; a carried cup tips up to 2 degrees where the wrist is limited; the mug take has a joint jump of
|
||||
# 1,378 as the elbow swings out. The floor take is unchanged (hold 69 mm off).
|
||||
# Also since: a grip chosen by the thing's shape for one more case, a rod lying down (taken over the top,
|
||||
# the fingers round it across its length; stood on end it is taken by its side), with three of five
|
||||
# fingers on it on the stand-in body; and raea/character's `fetch`, which takes a thing as asked when it
|
||||
# is in reach and otherwise walks the body to the take's standing place first (walkUp) and puts every
|
||||
# time of the take off until it arrives. `fetch` was then rendered on turbo with a walk capture retargeted to it (ACCAD Male2 B3): the body walks 1.5 m
|
||||
# up to a table, stands where the take says to, and takes a cup; the feet slide as the walk settles.
|
||||
# The floor take's scenario was itself impossible, which several rounds had been fighting: the box stood on
|
||||
# the body's toes (toe skin 11 mm in it at rest) with a solid table 38 cm ahead, 17 cm of floor for a 24 cm
|
||||
# box. Set a forearm's length in front of the feet, the table a top with room under it: the hold is kept
|
||||
# within 5 mm (from 69), no body skin is in the box, the hips are at 45 per cent of standing at the grab.
|
||||
# The trunk's lean now comes on as soon as an arm ends short (it waited for the arm's full length and came
|
||||
# on at once), and the squat's give is a smooth measure of the room the head and chest have (finding the
|
||||
# least give that cleared jumped): that take's worst joint jump 1,706 to 707. Left in it: fingers 20 mm
|
||||
# in the table's top as the hands leave, finger skin 15 mm in the box, hips down to 24 per cent later.
|
||||
Given the six takes of tools/hands-audit on a clean body with real fingers
|
||||
Then no skin is in the thing beyond a pad's give (2 mm), none in the scene or the body
|
||||
And every finger meant to hold has its pad on the thing, by a grip chosen for the thing's size and shape
|
||||
And no joint's speed changes by more than 300 degrees a second in a frame, fingers included
|
||||
And a low thing is taken with the hips no lower than a real squat and the back as a person holds it
|
||||
And a body that can't reach walks until it can, on any body, and the walk stops without sliding
|
||||
And it is shown on that clean body, in motion, and Shane has watched it
|
||||
|
||||
Rule: Next, in order
|
||||
|
||||
@needs:HG5
|
||||
Scenario: HG6. The whole body out of itself and the scene
|
||||
# HG6a, HG6b and HG6c keep the hands, head, chest, forearms, knees and the thing out of the scene's solids.
|
||||
Then the arms and the held thing stay out of the body's own shape (sdk/body's shape.ts and shell.ts), by
|
||||
the least move
|
||||
And one copy of the limits serves both the TypeScript and the Rust
|
||||
|
||||
@needs:HG5
|
||||
Scenario: HG7. The walk is chosen and steered
|
||||
# HG7a says where to stand and HG7b arrives there on one capture set down to fit.
|
||||
Given a thing out of reach, anywhere
|
||||
Then sdk/body's locomotion (its chooser, matching and foot holds) brings the body to the take's standing
|
||||
place from wherever it is, with a stop that doesn't slide, on any body that has a library
|
||||
And a low thing's bend is checked against the library's pick-low and lift captures, and takes its shape
|
||||
from them where they fit (the back straighter, the head up)
|
||||
|
||||
@needs:HG5
|
||||
Scenario: HG8. Things with a way to be held
|
||||
Given a thing that is held one way (a mug's handle, a sword's grip, a door's handle, a phone, a bag's strap)
|
||||
Then its holds come with the thing, as places and hand shapes, from the 35 captured hand poses
|
||||
(character/captured.ts) where one fits
|
||||
And a thing with no holds of its own gets HG2's
|
||||
And a hand shape is scored against the hand prior (HG5b) before it is kept
|
||||
|
||||
@needs:HG5
|
||||
Scenario: HG9. Using what is held, and handing it over
|
||||
Then a held thing can be aimed, swung, drunk from, set to the ear, pushed, pulled and turned (a door, a
|
||||
drawer, a lever), each a path for the thing that the hands follow
|
||||
And a thing passes from one hand to the other, and from one character to another, with no frame where
|
||||
nobody holds it
|
||||
|
||||
@needs:HG5
|
||||
Scenario: HG10. Weight
|
||||
Then a heavy thing is held low and close, the trunk leans back against it, the elbows straighten, and the
|
||||
lift is slower; a light one moves with the wrist
|
||||
And a throw's wind-up and follow-through scale with it
|
||||
|
||||
@done
|
||||
Scenario: HG19. On SOMA's own skin a held thing has no skin of the hand in it
|
||||
# 11-15, the audit (tools/hands-audit) on SOMA's body: fingers stood 17 to 36 mm inside a held box and cup.
|
||||
# Three causes, each in the system. A joint bent until its own bone met the surface, and carried the bones
|
||||
# past it in (a knuckle 60 degrees onto a box's face, the next two bones 24 and 35 mm inside): it now stops
|
||||
# when any bone past it meets. The curl read each bone's skin as riding that bone alone, where the skin is
|
||||
# carried by several joints' weights (the ball of the thumb is half the hand's): it reads it as drawn. And
|
||||
# the ball of the thumb is the palm's: the hand's frame sets the palm's height on it too, and only on skin
|
||||
# the hand mostly carries itself (the web to the thumb stood 13 mm proud). Now, worst over each take: 0 to
|
||||
# 1 mm in the thing (3 mm passing a cup hand to hand), 4 to 5 pads on, the palm 1 to 6 mm off.
|
||||
# Then the table (fingers 20 to 37 mm into it at a box's grab) and the body's own thighs. A reach leans the
|
||||
# chest, and the second hand's lean carried the first hand 6 cm off its hold with its fingers still shaped
|
||||
# for the hold: every hand but the last is solved again with the trunk left where it is. A travelling hand is
|
||||
# kept off solids by its skin as its fingers are that frame (opened, they go further than at rest). The
|
||||
# audit's own standing pose hung SOMA's fingers 31 mm inside the thighs before any take began: it now hangs
|
||||
# the arms as near the sides as keeps them out. Five of the six takes now: 0 to 2 mm of hand in the thing,
|
||||
# none in the scene, 0 to 6 mm in the body's own solids, every holding hand's five pads on. The sixth (a
|
||||
# box from the floor to a table, squatting) still has 8 mm in the box, 20 in the table and 50 in the thighs.
|
||||
Given SOMA's body, its skin samples on the joints that carry them
|
||||
Then through each of the audit's six takes no skin of a hand is more than 3 mm inside the thing it holds
|
||||
And every hand that holds has four pads or more on it, its palm within 6 mm
|
||||
And no skin of a hand or forearm is in the scene's solids, nor more than 6 mm in the body's own
|
||||
|
||||
Rule: Wider, for the character SDK
|
||||
|
||||
Scenario: HG11. Creatures' motion from generated video
|
||||
# patch-gg/anymove, Apache-2.0. raea's animals have no captures (the dog and cat were called stiff, 11-14).
|
||||
Given a rigged creature made skeleton first
|
||||
Then its moves are captured from a generated two-view video, the joints read in both views, the rig fitted
|
||||
And the model that reads joints runs on hardware a user has, or the step is a cloud one and says so
|
||||
|
||||
Scenario: HG12. Motion from words, between poses
|
||||
# Kimodo (Apache-2.0 code, weights' licence to be read in full first). MotionBricks only if its licence
|
||||
# turns out to allow it.
|
||||
Then a situation the library has no capture of is filled by generated motion on the rig, retargeted from
|
||||
SOMA's skeleton once, and judged against the captures by the same detectors
|
||||
|
||||
Scenario: HG15. Twist joints, so a turned limb keeps its thickness
|
||||
# 11-15, measured, not built: a decision for the user, since it adds joints to every body. On turbo's
|
||||
# skin a hand turned 90 degrees thins the wrist to 71 per cent of its radius at the thinnest ring (26 per
|
||||
# cent at 150 degrees); moving the turn to the elbow (forearm_twist, what a take does today) moves the
|
||||
# same pinch to the elbow. The same turn spread over four twist joints along the forearm (arm.rs
|
||||
# `twist_joints`, SOMA-X's shares) keeps 97 to 99 per cent everywhere, and the upper arm reads the same
|
||||
# (71 against 98). The joints would be helpers a body's build adds and the engine drives: no pose,
|
||||
# capture or call names them, so the 52 joints stay the standard.
|
||||
Given a body built with four helper joints along each forearm, upper arm, thigh and shin
|
||||
Then the engine sets them from the limb's two ends each frame, and a turned hand pinches no skin
|
||||
|
||||
Scenario: HG13. A body that reacts
|
||||
Then a pushed or struck character gives way and recovers (the ragdoll looked at again, with a physics
|
||||
crate chosen for the whole engine first: there is none in the workspace today)
|
||||
And a hand or a foot can brace on a wall, a rail or the floor as a contact found the way holds are
|
||||
|
||||
Rule: SOMA is the standard body for people, decided by the user 11-15
|
||||
|
||||
# After HG12b and HG15 the user asked which body works best with generated motion and a generated head, and
|
||||
# decided: standardize on SOMA (NVlabs/SOMA-X, Apache-2.0). Its skeleton is the one Kimodo generates on, so
|
||||
# motion plays with no retarget; its rig has the twist joints HG15 measured the need for, and pose
|
||||
# correctives; its own body and hand shape models are Apache-2.0 (MHR and Anny are optional backends; SMPL is
|
||||
# separately licensed and not used). It ships a bare body: 18,056 vertices with UVs, eyes, teeth and tongue,
|
||||
# no texture, clothes or hair. The 52-joint game_engine rig and the people built on it are what this
|
||||
# replaces; animals keep their own rigs (HG11). HG15 is answered by this: the twist joints come with the rig.
|
||||
|
||||
@done
|
||||
Scenario: HG16a. SOMA's own body plays generated motion in raea with nothing fitted
|
||||
# 11-15. SOMA's template rig (110 joints: 78 named ones and 32 twist joints) is read in Blender, posed
|
||||
# frame by frame from a Kimodo motion's own joint turns (given from SOMA's T-pose, for 30 joints, with
|
||||
# the hips' place), its twist joints set by SOMA's shares (0.05, 1/3, 2/3, 0.95: a forearm or shin takes
|
||||
# up its far joint's turn, an upper arm or thigh undoes its own near its start), and saved as a glTF
|
||||
# clip that `<Model animation>` plays. Shown beside turbo following the same run and leap through the
|
||||
# retarget. The largest limb twist in that motion is 77 degrees. Not yet: the body as a `<Character>`,
|
||||
# posed by the engine each frame; its shape model; its correctives; any surface but plain grey.
|
||||
Then a Kimodo motion plays on SOMA's body as the model made it
|
||||
|
||||
@done
|
||||
Scenario: HG16b. `<Character>` poses SOMA's body from a generated motion's own joint turns
|
||||
# 11-15. A body folder made from SOMA's template rig: body.glb skinned to flat joints under SOMA's names,
|
||||
# skeleton.json with rig "soma" (the 77 named joints, then the 32 twist joints marked as helpers; SOMA's
|
||||
# fixed Root frame is left out, so the hips are the root as in every raea body), each joint's turn from
|
||||
# bind to SOMA's T-pose, and 2,024 skin samples by part. A pose is then arithmetic: a joint's world turn
|
||||
# is Kimodo's turn after the turn to the T-pose, a joint Kimodo does not name follows its parent, the
|
||||
# twist joints take SOMA's shares, and each joint's turn is taken relative to its parent. `<Character
|
||||
# body="soma">` drew the run and leap with no change to the SDK. The body's build and the clip's
|
||||
# conversion are scripts in the test project for now (tools/soma_body.py for Blender,
|
||||
# tools/kimodo_clip.py): HG16 moves them into the SDK. The pose itself is in the SDK: raea-sys-body
|
||||
# turns.rs `from_turns` and `set_twists`, the native call character.turns, raea/character's `turnsPose`;
|
||||
# the same frame drawn through it matches the composition's own arithmetic (SSIM 0.999996).
|
||||
Then SOMA's body is posed by `<Character>`, its twist joints included
|
||||
|
||||
Scenario: HG16. A SOMA body is a raea body
|
||||
Given SOMA's rig as a body folder (its 78 joints by SOMA's names, metres, with the twist joints as helpers)
|
||||
Then `<Character>` poses it, raea-sys-body knows its joints' roles and limits, and the engine sets its twist
|
||||
joints each frame (arm.rs `twist_joints`)
|
||||
And a take (reach, grab, carry, put down, throw) runs on it and passes the audit that turbo's takes pass
|
||||
And a motion on SOMA's skeleton is played as it is, with `from_soma` kept only for other rigs
|
||||
|
||||
@needs:HG16
|
||||
Scenario: HG17. Different people from SOMA's shape model
|
||||
Then a body's build takes SOMA's shape numbers (its own model's 128, or Anny's measures for age and build)
|
||||
and writes the body folder, so a cast is a list of numbers and not a set of hand-made meshes
|
||||
And SOMA's pose correctives are applied, in the engine or baked as shapes, with the cost of each measured
|
||||
|
||||
@needs:HG16
|
||||
Scenario: HG18. A surface: skin, clothes, hair, and the generated head
|
||||
Then a SOMA body has a skin texture, clothes and hair made by raea, or its surface is the drawn or
|
||||
generated one with SOMA as the hidden driver
|
||||
And the generated head replaces the body's head from the collar up, skinned to SOMA's Neck1, Neck2 and
|
||||
Head and using its eye joints, the face's skin colour carried across the seam
|
||||
@@ -0,0 +1,122 @@
|
||||
@spec
|
||||
Feature: Hardware: controls that feel like instruments, heard on raea's own mixer
|
||||
Shane, 2026-11-14, pointing at SPEC-01 (spec-01.vercel.app, a shadcn registry of controls drawn as hardware, its
|
||||
sounds made with the browser's Web Audio): "i want to have this ui kit installed across the app where relevant with
|
||||
sounds especially for controllers ... wrap the app in <Hardware> ... and have a sound off button in settings. this
|
||||
could be used for so many things and feels aligned with our vibe and brand." Then, on how its sounds would play in
|
||||
raea's window: "why web audio isnt it in a raea engine its rendering wouldnt we use raea tone.js/firewheel?" And:
|
||||
"we would make our own version of it no need to use theirs for real unless it makes sense. we keep dark mode."
|
||||
|
||||
So: raea's own kit, dark, in the idiom SPEC-01 shows (keys that go down and come back, latches, detents, knobs,
|
||||
faders, readouts), with its sounds written in raea/tone and played by raea's mixer on Firewheel. None of SPEC-01's
|
||||
code is taken; it is credited as the inspiration (Apache-2.0, Vercel Labs' ui-sdk).
|
||||
|
||||
What there is to build on (read 11-14):
|
||||
- raea's window has no Web Audio graph on purpose (sdk/ui/src/platform/audio.ts: decodeAudioData only, AudioContext
|
||||
not installed, "so a page that looks for it finds it missing rather than half there"). A web kit's sounds are
|
||||
silent there.
|
||||
- raea/tone (sdk/audio/src/tone) is Tone.js's API on raea's one mixer core: instruments, effects and buses (one of
|
||||
them `ui`) as a graph (`<audio data-tone-graph>`) and events (`<audio data-tone-evs>`). Today only a composition
|
||||
reaches the mixer: a render bounces it (systems/mix offline.rs) and the stage plays it live (systems/mix live.rs,
|
||||
`Live::sync` a frame at a time). A page's own interactions have no way in.
|
||||
- The page's host calls (raea-runtime-js HostCalls; the stage's in engine/page/stage calls.rs), reached from a page
|
||||
as `__raea_engine.call(name, args)`.
|
||||
|
||||
Status, 11-14: HW0 to HW4 built (engine lane `hardware`; the app's raea-feed branch `hardware`, src/hardware). HW0b
|
||||
measured: 200 presses 15 ms apart through Live::fire, 0 late, 200 in the tap (systems/mix tests/fire.rs, ignored as
|
||||
it opens a device); in raea's window, 40 presses on the kit's sheet fired 40 on the page's mixer, 0 late (raea-feed
|
||||
blitz/kit.sh, headless and muted). HW1b: the loudest voice, the primary key, peaks at -22 dB (raea-feed
|
||||
bench/kit-voices.sh). HW2b: the sheet (#/kit, ui-parity screen 27-kit) drawn by raea's window matches Chrome's by eye,
|
||||
and the switches' thumbs measure centred, 2 px all round, in both (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); the ui-parity run is still to do (it
|
||||
reads the app while it still shows its loading shapes). Shane 11-14: into 0.1.4. HW5 open.
|
||||
|
||||
Background:
|
||||
Given the engine's part is systems/mix (the mixer) and engine/page/sound (the page's call), the SDK's is
|
||||
sdk/audio/src/tone (fire), and the app's is raea-feed src/hardware
|
||||
|
||||
Rule: HW0. A page plays a sound now, on raea's mixer
|
||||
# Plan (crate or package | file | lines | job)
|
||||
# raea-sys-mix | src/live/fire.rs | 80 | Live::fire: a graph built when it changes, events at the clock's now
|
||||
# raea-page-sound | src/lib.rs | 120 | the page's `sound.fire` call: a mixer of its own on a thread, resting when idle
|
||||
# @raea/audio | src/tone/fire.ts | 80 | fire(play): a page's one-shot, as <Sfx> is a game's, sent to the call
|
||||
|
||||
Scenario: HW0a. sound.fire
|
||||
Given a page in raea's window (the app, a plugin's page, any page the page host shows)
|
||||
When it calls sound.fire with a raea/tone graph and a list of events
|
||||
Then the graph is built on the page's own mixer when it is new or changed, and each event plays at the clock's
|
||||
now plus the mixer's head plus the event's own time: no frame and no timeline stand in between
|
||||
And the call answers at once; it never waits for the sound
|
||||
And RAEA_AUDIO_MUTE=1 silences it as it silences every mixer
|
||||
|
||||
Scenario: HW0b. Heard within a frame of the press
|
||||
Then a fired event reaches the speaker within the mixer's head (two 256-sample blocks and 5 ms: 15.7 ms at
|
||||
48 kHz) of the call, measured on the mixer's own clock (the late-event count stays 0 over 200 fires)
|
||||
|
||||
Scenario: HW0c. Nothing runs while nothing sounds
|
||||
Then the page's mixer opens the device on its first fire, and stops its stream after 10 s with nothing fired
|
||||
(the stage's rest, lightspeed R6); the next fire starts it again
|
||||
|
||||
Scenario: HW0d. fire() in raea/tone
|
||||
Then `fire(play)` runs `play(time)` the way <Sfx> runs a game's one-shot: its triggers become events, keyed so
|
||||
no two fires share one, sent with the graph (only when the graph changed since the last fire) to sound.fire
|
||||
And with no raea engine under the page (a browser) it returns without a sound, and says so once in the console
|
||||
|
||||
Rule: HW1. The kit's voices, in raea/tone
|
||||
Scenario: HW1a. A voice for each kind of touch
|
||||
Then a key going down thocks and coming up clicks lighter, a primary key deeper; a latch catches going down and
|
||||
springs going up; a detent (a knob's step, a switch's position, a wheel's row) ticks; anything on a screen (a
|
||||
readout, a list row) blips; a popup opens with a soft pop; typing clicks, deeper for space and heavier for
|
||||
Enter and Backspace; an outcome chimes (done, warning, error)
|
||||
And each is written with raea/tone's instruments and effects on the `ui` bus, never an audio file
|
||||
And no two presses sound quite alike: each varies its pitch and level a little, by raea/tone's seeded variation
|
||||
|
||||
Scenario: HW1b. Quiet by default
|
||||
Then the kit's loudest voice peaks at least 18 dB under full scale on the ui bus, under any music or voice a
|
||||
stage plays at the same time
|
||||
|
||||
Rule: HW2. The kit, dark, drawn by raea's window
|
||||
Scenario: HW2a. The controls
|
||||
Then the kit has a key (a button), a latch (a key that stays down), a switch and a slide switch, a knob with
|
||||
detents, a fader, a segmented selector, a stepper with its readout, a readout (an LCD-like screen), and a lamp
|
||||
And each is drawn on the app's dark palette (its ground, its raised greys, its ink and its accent), as anodised
|
||||
panels, keycaps and screens; there is no light skin
|
||||
And each works by pointer and by keyboard (arrows step a knob, a fader, a selector; Space and Enter press a key),
|
||||
with a focus ring shown only for the keyboard
|
||||
And each plays its HW1 voice as it moves, and nothing when sound is off (HW4)
|
||||
|
||||
Scenario: HW2b. Drawn the same in raea's window and in Chrome
|
||||
Then every control is drawn with what raea's window paints (no `<input type=range>`, whose thumb the window doesn't
|
||||
move; no SVG for anything a pointer presses; a drag followed by window pointer listeners), and a screenshot of
|
||||
the kit's sheet in a headless raea window matches Chrome's within the ui-parity bar
|
||||
|
||||
Scenario: HW2c. <Hardware>
|
||||
Then the app sits in one <Hardware> root, which installs the kit's sounds and keyboard-only focus once and changes
|
||||
nothing else about how the app looks
|
||||
|
||||
Rule: HW3. Where the kit is used
|
||||
Scenario: HW3a. Controllers
|
||||
Then a controller's fields are the kit's: a toggle is a switch, a choice a segmented selector (a dial past five
|
||||
options), a number a knob or a fader with its readout, and each change sounds as it is made
|
||||
|
||||
Scenario: HW3b. Settings
|
||||
Then Settings' toggles and choices are the kit's switches and selectors
|
||||
|
||||
Scenario: HW3c. The rest of the app, where a control is a control
|
||||
Then the Send keycap, the timeline's sliders and the player's transport use the kit's keys, faders and their
|
||||
voices; lists, menus and text stay the app's own
|
||||
|
||||
Rule: HW4. Sound off
|
||||
Scenario: HW4a. Settings › General › Interface sounds
|
||||
Then one switch turns every interface sound off and on, at once, remembered on this Mac
|
||||
And it is on by default
|
||||
And it never silences a film, a sound or a game: only the interface
|
||||
|
||||
Rule: HW5. Open
|
||||
Scenario: HW5a. Felt on a Mac's trackpad
|
||||
Then a knob's detent, a switch's catch and a fader's end are felt on a Force Touch trackpad (the system's haptic
|
||||
feedback, through a host call), as they are heard
|
||||
|
||||
Scenario: HW5b. A browser hears them too
|
||||
Then the kit's voices are bounced by raea once into small files a browser plays, so the app's page in Chrome (the
|
||||
tutorials' stage on raea.io) clicks as raea's window does
|
||||
@@ -0,0 +1,211 @@
|
||||
@spec
|
||||
Feature: img2raea: a picture made into raea objects, props, environments and scene data, and held to three.js
|
||||
Goal, 2026-11-16: "lets work on the img2threejs as also a way to get 3js perfect parity and how we can expand the
|
||||
skill for our own skills like img2raea and how we can do the same with environments, scene data, and what places we
|
||||
can use procedural tools or nueral networks or any kidn fo machine learnign to get it right".
|
||||
|
||||
img2threejs (github.com/img2threejs/img2threejs, Apache-2.0, read at 0c0c49bc) is an agent skill that turns one
|
||||
picture into a procedural three.js model: a factory, `createXModel(): THREE.Group`, built in gated passes (blockout,
|
||||
structure, form, material, surface, lighting, interaction, optimisation) against an ObjectSculptSpec, each pass
|
||||
checked by renders in a browser (the "Divine Eye" views, a turntable, self-intersection, attachment and chirality
|
||||
gates). Its showcase (img2threejs-showcase, 638b5c73, three ^0.169) has no licence and holds other people's IP, so
|
||||
it is measured locally and never committed; the corpus we keep comes from running img2threejs on our own pictures.
|
||||
|
||||
Found on 11-16: a factory runs in raea unchanged as `<R3F><primitive object={createXModel()} /></R3F>` (the Talon
|
||||
knife, its tick animation included). So img2threejs's output is already raea's input; what is left is making the
|
||||
two renderers agree (parity), giving the skill a raea target (img2raea), and doing the same for places and scenes.
|
||||
|
||||
Rule: three.js parity, measured on img2threejs's output
|
||||
|
||||
@needs
|
||||
Scenario: IR1. The showcase as a parity corpus
|
||||
Given the showcase's single-file factories (15 on 11-16: a rifle, a bike, three knives, a chest, a house, a
|
||||
mascot, a pistol, a shotgun, a humanoid, earbuds' case, a rocket, a truck), fetched at a pinned commit into a
|
||||
cache outside git
|
||||
When each is centred, scaled to 2 m on its longest side, seen from one camera at 640 x 400, and drawn by raea's
|
||||
<R3F> (`raea render`) and by three.js's own <Canvas> in headless Chrome (sdk/r3f/tools/chrome.ts: Chrome only as
|
||||
three.js's reference renderer, as R3F8 uses it)
|
||||
And under four rigs: neutral (a hemisphere and two directional lights), direct (the two directional lights),
|
||||
dark (direct with an ambient light of 0) and lookdev (the author's own lights, moved and scaled with the model)
|
||||
Then each pair is scored on the model's own box (the union of both pictures' non-background boxes, padded 8 px):
|
||||
SSIM and RMSE there, the frame's SSIM beside them; the frame's SSIM is not the score, as a model that fills a
|
||||
tenth of the frame scores 0.99 with its face missing
|
||||
And the plan
|
||||
| crate | file | lines | job |
|
||||
| tools | tools/img2raea/parity.sh | 80 | fetch the pinned showcase into ~/.raea/cache, run both sides, score, sheet |
|
||||
| tools | tools/img2raea/shoot.ts | 70 | three.js's side: the page bundled with sdk/r3f's three and R3F, shot |
|
||||
| tools | tools/img2raea/scene.tsx | 80 | one case's scene for both sides: fit, seeded Math.random, the four rigs |
|
||||
| tools | tools/img2raea/score.sh | 40 | crop to the model's box, SSIM and RMSE, side-by-side pairs, contact sheets |
|
||||
And 11-16, so far: built and run in a scratch folder (not yet in tools/): 60 cases in 6.5 minutes on this Mac,
|
||||
raea's renders 5.8 GB peak; 14 of the 15 factories draw (the humanoid throws: IR6); under the dark rig 12 of the
|
||||
14 score 0.95 or better on the crop (the rocket 0.81: IR4; the chest 0.94: its gold edges' highlights); under
|
||||
the neutral rig the earbuds' case, the rocket and the chest fall to 0.80-0.84 (IR3); the mascot scores 0.976
|
||||
with its face missing (IR5), so a per-part or edge score has to join SSIM before 0.95 can mean "the same"
|
||||
And not yet diagnosed: the bike's tyre lettering is missing in raea (a canvas texture repeated -1 x 1, so a
|
||||
negative repeat is the first suspect) and the truck's ground ring loses its soft glow (additive blending is
|
||||
mapped, input/material.ts, so something else)
|
||||
|
||||
@done
|
||||
Scenario: IR2. No ambient light means none
|
||||
Given a three.js scene with no AmbientLight, HemisphereLight or LightProbe
|
||||
Then raea draws it with no ambient light either
|
||||
And today it doesn't: <R3F> sends no ambient, so the camera falls back to Bevy's GlobalAmbientLight (white, 80),
|
||||
which raea never sets; a metal then shows its colour everywhere where three.js shows black outside its
|
||||
highlights (the earbuds' copper lid, the chest's gold corners, a knife's blade)
|
||||
And measured 11-16: the earbuds' case, direct rig, crop SSIM 0.83; with an explicit <ambientLight intensity={0}>
|
||||
0.996; the chest 0.88 to 0.94, the Gerber knife 0.94 to 0.98
|
||||
And the fix is one of: sdk/r3f's input/lights.ts sends AmbientLight 0 when the scene has none, or raea's engine
|
||||
sets GlobalAmbientLight to 0 (a raea scene without an ambient light would then be darker too: decide which)
|
||||
And 11-16, built in sdk/r3f (input/scene.ts convert): a scene with no AmbientLight, HemisphereLight or LightProbe
|
||||
gets an AmbientLight of 0, white so it lends no colour (raea sums a camera's ambient lights and takes the first
|
||||
non-white one's colour, so a composition's own AmbientLight beside the <R3F> is kept as it was); the engine's
|
||||
GlobalAmbientLight is unchanged (Shane's call, through the 0.1.6 release session). Measured: under the direct
|
||||
rig the earbuds' case 0.83 to 0.996, the Gerber knife 0.94 to 0.98, the chest 0.88 to 0.94, the mascot 0.96
|
||||
to 0.99; R3F8's 43 cases as before (one, in-drei, 0.9935 to 0.9943); test/input.test.tsx "ambient light"
|
||||
|
||||
@needs
|
||||
Scenario: IR3. three.js's ambient lights only diffuse
|
||||
Given a three.js AmbientLight or HemisphereLight
|
||||
Then it lights a surface's diffuse colour only, as three.js does (irradiance x diffuse; a metal has none)
|
||||
And today raea's AmbientLight is Bevy's, which also lights specular through the environment BRDF, so under a
|
||||
hemisphere light a metal glows evenly: the earbuds' case, neutral rig, crop SSIM 0.80
|
||||
And the fix: a diffuse-only ambient for lights read from three.js (an ambient term raea's PBR shader can switch,
|
||||
or the hemisphere light as an irradiance-only environment)
|
||||
|
||||
@needs
|
||||
Scenario: IR4. Anisotropic metal
|
||||
Given a MeshPhysicalMaterial with anisotropy and anisotropyRotation (the rocket's brushed steel: 0.65, pi/2)
|
||||
Then raea's highlight stretches along the brushing as three.js's does
|
||||
And today the steel blows out in hard white and black halves: crop SSIM 0.81; with anisotropy 0, 0.94
|
||||
And what to check first: the mesh's tangents (Bevy's anisotropy reads ATTRIBUTE_TANGENT; a three.js geometry
|
||||
has none unless computed), then the rotation's sense and the strength's mapping
|
||||
|
||||
@needs
|
||||
Scenario: IR5. Overlays drawn without the depth test
|
||||
Given meshes with material.depthTest false and a renderOrder above the body's (the mascot's eyes, mouth and
|
||||
cheeks: decals whose vertices lie on the body shell, drawn on top in renderOrder 3 and 4)
|
||||
Then raea draws them after the meshes before them, over what is already drawn, as three.js does
|
||||
And today they are depth-tested and lost inside the shell: the face is missing (crop SSIM 0.976, which hides it:
|
||||
the face is a small part of the box; IR1's sheet shows it); sdk/r3f passes depthTest on for a patched or
|
||||
shader material (input/patched.ts, input/shader.ts) but not for the standard ones (input/material.ts), and
|
||||
renderOrder is read only for render targets (input/targets.ts)
|
||||
And 11-16, built in sdk/r3f: a basic material drawn without the depth test is three's own basic program
|
||||
(shader.ts builtinPart, as matcap and normal are), a standard or physical one its patched program (patched.ts),
|
||||
and any ThreeShaderMaterial without the depth test goes with the transparent ones, after everything opaque, as
|
||||
raea's opaque pass has no order; the mascot's face is drawn (crop SSIM 0.96 to 0.99 under the direct rig);
|
||||
test/patched.test.ts "a material drawn without the depth test"
|
||||
And left: renderOrder among such overlays (the eye's highlight over the eye) is still raea's transparent sort,
|
||||
by distance; three's order needs a sort bias from renderOrder in raea-sys-three-shader (Material::depth_bias),
|
||||
an engine change
|
||||
|
||||
@needs
|
||||
Scenario: IR6. A browser's globals a factory reads
|
||||
Given a factory that reads window.location.search (the humanoid's debug switches) or other browser globals
|
||||
Then raea's JS host has a location (about:blank's: an empty search), so the factory runs
|
||||
And today the composition throws at frame 0: "undefined is not an object (evaluating 'window.location.search')"
|
||||
|
||||
Rule: img2raea, the skill
|
||||
|
||||
@needs
|
||||
Scenario: IR7. img2threejs with raea as its target
|
||||
Given img2threejs's emission target socket (docs/EMISSION_TARGET_SOCKET.md: `--target <kind>`, a plugin step
|
||||
with `provides`, run after the model is action-ready)
|
||||
When a raea target plugin is added, installed as ~/.img2/plugins/raea/ and read by their forge/_shared/targets.py:
|
||||
plugin.json `{"schema": 1, "id": "raea", "requires": {"harness": RANGE, "coreApi": 1}, "capabilities":
|
||||
[{"from": "sculpt-spec", "to": "raea-tsx"}]}`, and a steps.json row `{"id": "emit-raea", "command":
|
||||
"{plugin_dir}/emit.sh {workspace} {spec}", "provides": {"version": 1, "from": "sculpt-spec", "to": "raea-tsx",
|
||||
"artifact": {"kind": "raea-tsx", "path": ".img2/artifacts/raea/model.tsx"}}}`, its gates in gates.json
|
||||
Then `--target raea-tsx` writes a raea composition that draws the factory (`<R3F><primitive
|
||||
object={createXModel()} /></R3F>`, its tick from useFrame) and its lights, beside the factory, the same bytes
|
||||
on every run (their socket runs a target twice and refuses a mismatch)
|
||||
And raea is the render authority for the gates that need pictures:
|
||||
| img2threejs gate | raea |
|
||||
| Divine Eye views | `raea render EDIT.tsx --review DIR`: hero, front, right, top, iso, low, colour and clay |
|
||||
| turntable | a composition turning the model, `raea render` to frames |
|
||||
| self-intersection | `raea scene lint` (clipping), `raea scene explain` |
|
||||
| attachment anchor | `raea scene lint`: what rests on what, what floats or sinks |
|
||||
| surface and lighting pass | `raea render --aov` (normals, depth) and the light meter |
|
||||
| chirality | the review's front and right views against the reference |
|
||||
And the gates also pass IR1's parity on the model, so what the skill approved in raea looks the same in three.js
|
||||
|
||||
@needs
|
||||
Scenario: IR8. img2raea in raea's own skill
|
||||
Given the raea skill (skills/, the public raea-skills)
|
||||
Then it teaches the same method natively, credited to img2threejs (Apache-2.0: its NOTICE kept with what is
|
||||
adapted): the picture read into a spec of parts (ObjectSculptSpec's fields), then built in passes in raea's
|
||||
own vocabulary, each pass checked by `raea render --review` before the next
|
||||
And raea's vocabulary for it: core/shape's CSG for hard surfaces, core/sdf for organic ones, core/grow for the
|
||||
numerous (leaves, rocks, terrain), raea's standard material and systems/procmat for surfaces
|
||||
And a picture's thing can come out as either: a three.js factory raea draws (IR7), or a raea part
|
||||
|
||||
@needs
|
||||
Scenario: IR9. Tried on our own pictures
|
||||
Given pictures we make (`raea gen image`, under $10) of a prop, a hard-surface thing and a character
|
||||
When img2raea builds each
|
||||
Then each is scored against its picture from the picture's own view: the silhouette's IoU (SAM 2's mask of the
|
||||
picture against raea's alpha render), and SigLIP's similarity of the two crops (on the CPU: Core ML's GPU path
|
||||
gets SigLIP wrong on this Mac)
|
||||
And these become the kept corpus (CC0, ours), in IR1's runner beside the showcase
|
||||
|
||||
Rule: Scene data
|
||||
|
||||
Scenario: IR10. A three.js scene's geometry in scene lint, explain and export
|
||||
Given an R3F or <Three program> scene, whose geometry raea holds as <BufferMesh> shape "buffer:{positions,
|
||||
indices, normals, uvs}"
|
||||
Then contact, `raea scene lint|explain` and `raea scene export` read it as its triangles, and export writes each
|
||||
such part as GLB (POSITION, NORMAL, TEXCOORD_0) and OBJ (v, vn, vt), without Manifold, as it needn't be closed
|
||||
And 11-16: built on branch img2raea (core/shape/src/buffer.rs; raea-sys-mesh re-exports buffer_tris), unit tests
|
||||
in core-shape and interchange pass; before it every such part stopped `raea scene` with "unexpected ':' in a
|
||||
shape"; the knife's end-to-end export waits for a raea rebuild
|
||||
|
||||
@needs:IR10
|
||||
Scenario: IR11. Materials go with the geometry
|
||||
Given a part `raea scene export` writes as a mesh
|
||||
Then its GLB carries its material (base colour, metallic, roughness, emissive, the maps raea has as files), so
|
||||
Blender and Godot open it looking as it does in raea, not grey
|
||||
|
||||
@needs:IR10
|
||||
Scenario: IR12. An import measured both ways
|
||||
Given a scene exported by `raea scene export` (scene.json and its meshes)
|
||||
When it is opened in three.js and in Blender
|
||||
Then it is held to raea's own render by IR1's scoring from the same camera, so import and export are measured
|
||||
as the R3F parity is
|
||||
|
||||
Rule: Environments
|
||||
|
||||
@needs
|
||||
Scenario: IR13. A place from one picture
|
||||
Given a picture of a place (a room, a street, a clearing)
|
||||
Then it is made in raea in stages, each checked against the picture from its camera:
|
||||
| stage | what | how |
|
||||
| camera | the lens's field of view and the camera's height and tilt | MoGe-2's point map (MIT, ViT-S 35M) |
|
||||
| layout | the ground and walls as planes, so things stand on them | planes fitted to the point map (RANSAC) |
|
||||
| things | a mask and a name for each thing | SAM 2.1 (Apache-2.0), OWLv2 (Apache-2.0) |
|
||||
| props | each thing as a part at its depth and size | img2raea (IR8), or an image-to-3D model |
|
||||
| far away | what has no depth worth building: a panorama or splat behind | <Environment>, <Splat> (raea splat) |
|
||||
| light | the sun's and sky's direction and colour, then exposure | the picture's shading; systems/light-meter |
|
||||
| contact | nothing floats, sinks or clips | `raea scene lint` |
|
||||
And what can be made procedurally is: terrain, rocks and trees by core/grow, grass by systems/grass, floors and
|
||||
walls by systems/procmat, the picture giving their settings rather than their meshes
|
||||
|
||||
Rule: Where procedural tools, neural networks and measurement belong
|
||||
|
||||
@needs
|
||||
Scenario: IR14. The map
|
||||
Then each step uses what gets it right on this Mac (16 GB first) under a commercial-permissive licence:
|
||||
| step | method | model or tool | licence |
|
||||
| parity score | measure | crop SSIM and RMSE now; LPIPS or DINO next | ours |
|
||||
| a thing's mask | neural | SAM 2.1 (Core ML build exists) | Apache-2.0 |
|
||||
| a thing's name | neural | OWLv2; Apple Vision (systems/vision) | Apache-2.0; system |
|
||||
| depth, lens, normals | neural | MoGe-2 ViT-S; Depth Anything V2 Small, DA3 Small, Base, Mono-L, Metric-L | MIT; Apache-2.0 |
|
||||
| parts of a thing | procedural, fitted | core/shape CSG, core/sdf, core/grow | ours |
|
||||
| a fit's settings | search, judged by measure | render, score against the picture, adjust (CMA-ES or coordinate search) | ours |
|
||||
| a whole object's mesh | neural, as a reference or a start | TripoSG (geometry only, about 8 GB) | MIT |
|
||||
| a character | neural | Idol (sheet3d's route, about 3 GB) | as docs/character.feature |
|
||||
| how close to the picture | neural, as a critic | SigLIP 2 (on the CPU), silhouette IoU | Apache-2.0; ours |
|
||||
| a surface's look | procedural, fitted | systems/procmat's kinds, colours from the mask's lit pixels | ours |
|
||||
And left out, by licence or size: Depth Anything V2 Base and Large and DA3 Large and Giant (CC BY-NC), Depth Pro
|
||||
and SHARP (research only), Hunyuan3D (not the EU, UK or South Korea), TRELLIS.2 (MIT but 24 GB: a reference to
|
||||
compare against, not a step), SAM 3D Objects (SAM Licence, no published memory, reported out of memory at 20 GB)
|
||||
And neural models make or name things; measurement decides whether they are right; procedural parts are what is
|
||||
kept, so a result can be edited as raea's own parts rather than as a mesh no one can change
|
||||
@@ -0,0 +1,230 @@
|
||||
Feature: Index: every picture and video you have, searchable in minutes (0.1.5)
|
||||
Shane, 11-14: "the big thing I need you to ship in 0.1.5 is the fastest fucking indexing tool for videos and images
|
||||
on the OS and on your phone/photos/icloud ... a plugin that is able to do this for google drive, apple photos and
|
||||
icloud and locally or on a local drive of course. if free that index just stays local. if pro or team we can factor
|
||||
it into their plan. ITs vital that a wow moment is just how fast we can index tons of content, embed it all and
|
||||
manage those embeddings across search." 0.1.5 carries this and the 0.1.4 feed fixes; Character SDK moves to 0.1.6.
|
||||
|
||||
This builds on Libraries (docs/libraries.feature): its libraries, sources, local index, cloud index (turbopuffer
|
||||
through raea-api) and fused search stay. What changes is the first pass. Today a file is hashed, cut into shots and
|
||||
embedded by EmbeddingGemma 2 on the CPU before it can be found: LB1 took 316 s for 25 files, 12.6 s a file. A
|
||||
photo library of 50,000 would take a week. EmbeddingGemma 2's picture tower is a 16-layer ViT over up to 2,520
|
||||
patches, about 0.9 TFLOP a picture, so no runtime makes it the first pass.
|
||||
|
||||
So indexing has two passes:
|
||||
- the fast pass: every picture, and a few frames of every video, through SigLIP 2 B/16-256 on the Neural Engine,
|
||||
from the small copy the file or Photos already holds, searchable by words through SigLIP 2's text tower. Minutes
|
||||
for a whole library.
|
||||
- the deep pass (Libraries as it is): shots, sound, transcripts and EmbeddingGemma 2, in the background, after
|
||||
the fast pass, never on battery. It adds what's said and heard, and better ranking for video.
|
||||
|
||||
Measured 11-14 on this Mac (M5 Pro), with nothing else changed (ixbench in the scratchpad, 600 real files, mostly
|
||||
big PNGs with no embedded preview, the worst case for decoding):
|
||||
| step | per second | note |
|
||||
| ImageIO thumbnail decode to 256 px, all cores | 383-399 | JPEG and HEIC with a preview are faster |
|
||||
| SigLIP 2 B/16-256, Core ML, CPU + Neural Engine | 194-200 | batch 32 or 64; cosine 0.9985 to fp32 (10-16) |
|
||||
| the same on Core ML's GPU | 297 | wrong vectors on this Mac (coreml-gpu-siglip) |
|
||||
| EmbeddingGemma 2, q8 on CPU (LB1) | 0.08 files | 12.6 s a file, shots and sound included |
|
||||
|
||||
Rule: The fast pass
|
||||
|
||||
Scenario: IX1. A picture is found by words seconds after raea sees it
|
||||
Given a source with pictures (a folder, a drive, Photos, iCloud Drive, Google Drive)
|
||||
When the fast pass runs
|
||||
Then each picture is listed (its place, size, dates, dimensions), decoded to 256 px from its embedded preview
|
||||
when it has one (ImageIO; PhotoKit's own derivative for Photos), and embedded by SigLIP 2 B/16-256 on Core ML's
|
||||
CPU and Neural Engine, 32 at a time, while the next batch decodes
|
||||
And its vector (768 f16, normalised) and a 256 px JPEG thumbnail are written as soon as its batch is done, so
|
||||
search finds the first pictures while the rest are still going
|
||||
And an item is keyed by where it lives (a path, a Photos asset, a Drive file id) with its size and dates; its
|
||||
sha256 comes with the deep pass, or when the original is read anyway. The fast pass never reads a whole
|
||||
original only to hash it
|
||||
And sustained, it runs at 150 pictures a second or better on an M-series Mac with nothing else heavy running
|
||||
(bench/index), and says how fast it went
|
||||
|
||||
Scenario: IX2. A video's first pass is a few frames
|
||||
Then a video gets its poster and one frame every 4 s, at most 16, from the nearest sync frames (AVFoundation,
|
||||
VideoToolbox's hardware decoder), each a row with its time, so "the dog jumps in the pool" finds the moment
|
||||
And a video is listed with its length and dimensions before its frames are read
|
||||
|
||||
Scenario: IX3. Search reads both passes
|
||||
Then a query's words are embedded by SigLIP 2's text tower (ONNX on CPU, one query in milliseconds) and scored
|
||||
against every fast-pass row (brute force over f16 rows in Rust, fast enough to a million rows), and by
|
||||
EmbeddingGemma 2 against the deep pass's rows as now
|
||||
And the lists are fused by site/api src/library/fuse.ts with the fast list as one more list of its own weight and
|
||||
MARGIN, measured on LB1's queries plus a photo set before the weights are set; a model's vectors are never
|
||||
scored against another model's
|
||||
And a picture or a frame can be the query ("more like this"), against the fast rows
|
||||
And results show the thumbnails, grouped per file, with the moment for a video
|
||||
Status 11-15: the Library's Search asks the Index beside the libraries and shows its hits as a list of their own
|
||||
("On this Mac": one per file, a video at its best moment, a press shows it in Finder; raea-feed #37); a
|
||||
described sound isn't asked of it, and the host doesn't start the indexer for a Mac that never indexed
|
||||
anything. A picture is a query on the Index page (raea-feed #40): a tile's corner button asks serve's similar
|
||||
op for more like it, said in a chip over the field. Not yet: one fused ranking (the weight and MARGIN need
|
||||
LB1's queries plus a photo set measured), and agents' `raea library search` reading the fast rows
|
||||
|
||||
Scenario: IX4. The deep pass follows
|
||||
Then once a source's fast pass is done, Libraries' indexFile runs on its videos, sounds and words at low priority,
|
||||
through antsy, never on battery, its own files before claimed jobs (LB6b)
|
||||
And a picture needs no deep pass to be found; its EmbeddingGemma 2 row comes when the deep pass reaches it
|
||||
|
||||
Rule: Sources
|
||||
|
||||
Scenario: IX5. This Mac's folders and drives
|
||||
Then a folder or a drive is listed fast (getattrlistbulk through fts, skipping packages, caches and raea's own
|
||||
media), watched with FSEvents, and a drive's mount and unmount set it online or offline (Libraries' volume
|
||||
sources); an offline drive stays searchable from its thumbnails
|
||||
|
||||
Scenario: IX6. Apple Photos, and so iCloud Photos and the iPhone's camera roll
|
||||
Then turning Photos on asks macOS once (raea.app's NSPhotoLibraryUsageDescription; read-only, never a change to
|
||||
the library)
|
||||
And every asset is fetched from PhotoKit at once (PHAsset, newest first), each picture's 256 px image requested
|
||||
from PHImageManager (its local derivative; one only in iCloud is fetched at that size when "include photos only
|
||||
in iCloud" is on, by default), a video's frames from its local AVAsset, else its poster
|
||||
And an asset is keyed by its local identifier; its dates, place, favourite and media subtypes (screenshot,
|
||||
selfie, live photo, slo-mo) become filters
|
||||
And photos taken on the iPhone arrive through iCloud Photos and are indexed as they land (PHPhotoLibrary's change
|
||||
observer)
|
||||
|
||||
Scenario: IX7. iCloud Drive
|
||||
Then iCloud Drive is a folder source (~/Library/Mobile Documents/com~apple~CloudDocs); a file kept only in iCloud
|
||||
is indexed from its Quick Look thumbnail (QLThumbnailGenerator) without downloading it, marked "in iCloud", and
|
||||
downloaded only when opened
|
||||
Status 11-15: until the Quick Look path, a file kept only in iCloud (SF_DATALESS) is left out and counted
|
||||
(walk.rs cloud_only; Progress.cloud, and the CLI says "N only in iCloud, left out"). Reading one downloads its
|
||||
original: on this Mac all 3,849 iCloud Drive files were cloud-only, 2,245 of them pictures and videos, and
|
||||
switching iCloud Drive on would have pulled every one down
|
||||
Measured 11-15 for the Quick Look path (a Swift probe, QLThumbnailGenerator at 256 px, .thumbnail): 40 cloud-only
|
||||
pictures and videos gave 40 thumbnails in 23 s at once (1.7 a second, iCloud serving them about one at a time)
|
||||
and every file was still dataless after; the same 40 again took 0.02 s (Quick Look's cache). So cloud-only
|
||||
files can go in as a slow second stage after the local ones, about 20 minutes for this Mac's 2,245, with no
|
||||
download
|
||||
Built 11-15 (cloud.rs): a folder's cloud-only files in iCloud Drive are listed and go in after its local files,
|
||||
from Quick Look's thumbnail, eight asked for at once; a batch waiting on them is written after a second, so
|
||||
each lands as it comes. Measured: 40 fresh cloud-only pictures and videos searchable in 17.9 s (2 a second),
|
||||
all 40 still dataless after; a mixed folder (3 in iCloud, 2 local) searchable whole, and words found one of the
|
||||
iCloud ones. Cloud-only files of other providers (Google Drive, Dropbox under ~/Library/CloudStorage) stay out
|
||||
and counted until each is shown to answer Quick Look without a download. Not yet: marked "in iCloud" on the
|
||||
page, and downloaded only when opened (the original isn't opened from the Index yet)
|
||||
|
||||
Scenario: IX8. Google Drive
|
||||
Then through the Drive connection (raea-api src/connect; Drive is live since 11-11), raea-api lists the Drive's
|
||||
pictures and videos (files.list: id, name, mimeType, md5Checksum, imageMediaMetadata, videoMediaMetadata,
|
||||
thumbnailLink) and hands the Mac each thumbnail through the API; the Mac embeds it. The token stays in raea-api
|
||||
And a Drive of 20,000 pictures is searchable without one original downloaded; an original streams through the API
|
||||
(LB6's job media route) only when opened or deep-indexed
|
||||
And Google Drive for desktop's own folder (~/Library/CloudStorage/GoogleDrive-*), when it is there, is a folder
|
||||
source like any other
|
||||
Status 11-15: the folder route is built (raea-feed #36: Google Drive, Dropbox, OneDrive and Box are Index
|
||||
switches when their app mounts them; their local files go in at full speed, online-only ones are left out and
|
||||
counted until each provider is shown to answer Quick Look without a download). The API route is blocked on a
|
||||
scope: raea-api's Drive connection asks drive.file, which reaches only files picked in Google's Picker, and a
|
||||
picked folder shares the folder alone, never its contents (Google's docs; checked against developer reports
|
||||
through 2026-10). Listing a whole Drive needs drive.readonly or drive.metadata.readonly, restricted scopes that
|
||||
need Google's restricted-scope verification and a yearly security assessment (CASA) before a public app may
|
||||
ask for them. Shane's call (open question 3)
|
||||
Built 11-15 inside drive.file (raea-feed #41): files picked in Google's Picker go in. The Index's Google Drive row
|
||||
connects a Drive and opens the Picker in the browser; the feed's host takes the connection's token for the
|
||||
picked files from raea-api (the Picker page's own, GET /v1/connections/ID/token) and fetches Drive's thumbnail
|
||||
of each picture and video at 512 px into a folder beside the index, one per connection, which the indexer reads
|
||||
as a folder source. The token goes only to Google's hosts and no picture reaches raea-api, so Free can do it
|
||||
and raea-api needed no change. A picture Drive has no thumbnail of is fetched once and made small with sips; a
|
||||
video Drive hasn't pictured, a folder, a document is left out and said. A hit carries the file's Drive name
|
||||
and opens its page in Drive. Measured on the real indexer with a fake Google: 4 picks searchable in 25 ms of
|
||||
fetching plus one batch, each found by words under its Drive name. Tried 11-15 on a real Drive account: a video
|
||||
picked in Google's Picker went in from Drive's thumbnail in 1.2 s, came first for words describing its picture
|
||||
(0.20 against 0.06 for the next), and opened its page in Drive. The Picker's API key must list
|
||||
https://docs.google.com/* among its websites beside raea-api's: the Picker runs in a frame there and shows "The
|
||||
API developer key is invalid" without it (Google's web-picker guide). Not yet: the Picker showing only pictures
|
||||
and videos (the page is raea-api's, shared with Libraries), and a whole Drive without picking (the scope
|
||||
question above)
|
||||
|
||||
Scenario: IX9. The phone itself, later
|
||||
Then 0.1.5 reaches the phone's library through iCloud Photos on the Mac. Indexing on the iPhone in raea's iOS app
|
||||
(PhotoKit on the device, its Neural Engine, the same model) waits for its Photos usage string and a TestFlight
|
||||
build in App Store Connect
|
||||
|
||||
Rule: Plans
|
||||
|
||||
Scenario: IX10. Free keeps the index on the Mac; Pro and Team also keep it in raea's cloud
|
||||
Then on Free every source is indexed and searched on the Mac, and nothing leaves it (Libraries' local index)
|
||||
And on Pro and Team the index (vectors, thumbnails, the words and labels, never the media) also goes to raea's
|
||||
cloud through raea-api, so the library is searchable from raea.io, the iPad and the account's other Macs; a
|
||||
Team's workspace index is shared by its members
|
||||
And the cloud index counts toward the plan: its thumbnails and vectors as storage bytes (about 20 KB an item),
|
||||
shown on Settings → Storage beside media; what each plan includes is Shane's call (open question 1)
|
||||
Status 11-15, built for the account's other Macs and going out in 0.1.5: the indexer hands out its rows and a
|
||||
search's query vector (systems/index export.rs, serve's rows op and search vector: true; 0722ce3ae); raea-api
|
||||
keeps each Mac's rows in turbopuffer, one namespace per account (a Team's org), a row taken only with a
|
||||
thumbnail the person has in storage, refused on Free (402) (private 3b99935, POST /v1/fast/rows, search,
|
||||
forget; test/fast.sh); the feed copies each run's new rows there and merges the other Macs' hits into the Index
|
||||
page's search by score, each tagged with its Mac, a picture both Macs have shown once, and a removed source
|
||||
forgotten (raea-feed #44, merged 25a526b). Measured live on the real indexer and raea-api on wrangler dev: 3
|
||||
rows sent in 75 ms; the other Mac's search answers in 23 ms with them at the first Mac's own scores, the
|
||||
thumbnail byte for byte. raea-api deployed 11-15 with Shane's OK (version 137b25ad); the plans count it as
|
||||
storage only (Shane, 11-15): the thumbnails are the person's storage bytes, the vectors are free. Not yet: the
|
||||
copy's bytes shown apart on Settings → Storage, raea.io and the iPad (they need a text tower on the server: the
|
||||
query vector comes from the Mac)
|
||||
|
||||
Rule: Managing the index
|
||||
|
||||
Scenario: IX11. Settings → Index says what's indexed, where, by which model, and lets you change it
|
||||
Then per source: found, fast-indexed, deep-indexed, waiting and failed, with its speed while it runs; pause,
|
||||
resume, index again, and remove (its rows and thumbnails go; the files are never touched)
|
||||
And per model (siglip2-b16-256@768, embeddinggemma-2@768): rows, bytes on disk, bytes in the cloud, and its
|
||||
version; a model's vectors can be dropped and made again; a newer model makes its rows beside the old ones
|
||||
and search moves over once it is done
|
||||
And where it all lives (~/.raea/library), and a button that shows it in Finder
|
||||
Status 11-15 (raea-feed #38): the Index page says its rows, its bytes on this Mac (database, vectors,
|
||||
thumbnails), its model and its folder, which opens in Finder; a hit shows its file in Finder through the Index's
|
||||
own reveal (only inside one of its folders). Not yet: pause and resume, index again, a model's rows dropped
|
||||
and made again, bytes in the cloud
|
||||
|
||||
Scenario: IX12. The wow: the counter
|
||||
Then turning a source on starts the fast pass at once and shows it: items found, items searchable, pictures a
|
||||
second, and the newest thumbnails landing as a wall; search works from the first batch
|
||||
And the first run on a library of 10,000 photos is searchable in about a minute on an M-series Mac
|
||||
Measured 11-15 (IX14, bench/index on v0.1.5-rc4): 10,000 pictures searchable 55.7 to 57.1 s after `raea index
|
||||
add` started, the first at 0.4 s, on an M5 Pro
|
||||
Status 11-15 (raea-feed #39): the counter, the rate and the wall move in raea's own window, not only in Chrome:
|
||||
the window has no EventSource, so /host/index/events also answers its long poll (?after=N). The Index spec
|
||||
runs whole on raea's window (npm run e2e:blitz -- e2e/index.spec.ts, 4 of 4)
|
||||
|
||||
Rule: How it ships
|
||||
|
||||
Scenario: IX13. Where the work runs
|
||||
Then the engine does the work, in its own crate (systems/index, raea-sys-index: sources, decode, embed, store,
|
||||
search) on raea-sys-vision's Core ML (CpuAndNe), and `raea index` drives it: add, status, search, serve (a
|
||||
resident process the feed's host keeps, JSON lines)
|
||||
And the feed shows it: the Index plugin (its sources' switches and the counter), Settings → Index, and search,
|
||||
which asks `raea index search` and the deep index and fuses them
|
||||
And agents reach it as they reach Libraries: `raea library search` and the feed's library tools read both passes
|
||||
|
||||
Scenario: IX14. Measured, not guessed
|
||||
Then bench/index runs the fast pass on a fixed public set (pictures and clips under permissive licences) and
|
||||
prints pictures a second, video minutes a second, peak memory and recall@5 for a fixed list of queries; a
|
||||
release doesn't regress it
|
||||
Status 11-15: bench/index/run.sh [RAEA] [N]. Pictures: the first N of Open Images V4's validation set by id (CC BY
|
||||
2.0, 1024 px JPEGs with no embedded preview; labels CC BY 4.0), downloaded once to ~/.cache/raea-bench/index.
|
||||
Videos: Elephants Dream and Tears of Steel (CC BY, 720p H.264) cut once into 47 clips of 30 s. Each run indexes
|
||||
into a new home. Unsplash's Lite set was read and dropped: its terms forbid publishing any of it and grant use
|
||||
only for training. Each label has many pictures, so recall@5 is precision@5 here ("a photo of a dog": how many
|
||||
of the five carry Open Images' verified Dog label), a floor since the labels aren't exhaustive. First numbers,
|
||||
v0.1.5-rc4's Mac build on this Mac (M5 Pro), other sessions' jobs running:
|
||||
| measure | 10,000 pictures | 1,000 pictures |
|
||||
| searchable, from the command's start | 55.7-57.1 s | 8.2 s |
|
||||
| pictures a second, as the indexer counts | 177-181 | 167 |
|
||||
| the first pictures searchable | 0.35-0.42 s | 0.37 s |
|
||||
| peak memory (raea's own process) | 244-266 MB | 195 MB |
|
||||
| warm search, words to ranked hits | 12.8-18.8 ms | 19.4 ms |
|
||||
| precision@5 | 0.879 (38) | 0.733 (12) |
|
||||
Videos: 47 clips (23.2 min) searchable in 2.2 s, 10.5 video minutes a second, 371 frames each at its moment.
|
||||
Not yet a release gate: nothing compares a release's numbers with these
|
||||
|
||||
Rule: Open questions for Shane
|
||||
Scenario: To decide
|
||||
Then 1. What Pro and Team include for the cloud index (items or bytes), and what past it costs
|
||||
And 2. Whether Photos' "include photos only in iCloud" is on by default (it fetches each one's small copy over
|
||||
the network)
|
||||
And 3. Whether raea-api asks Google for drive.readonly (restricted: verification and a yearly CASA assessment) so
|
||||
a whole Drive indexes without Drive for desktop, or Drive stays the desktop app's folder plus picked files
|
||||
@@ -0,0 +1,159 @@
|
||||
@spec
|
||||
Feature: A render in layers: captions, text, graphics, footage and sound apart, for CapCut, Premiere, Resolve and raea's timeline
|
||||
wackyza, 2026-11-16: "export a rendered video, in all its component layers (video, audio, graphics, all separate) to
|
||||
Premiere, Resolve and Capcut ... keep graphics on one overlay track. Titles aka text elements should be their own
|
||||
track. And captions, if applicable, should be their own track. I think this separation would be valuable for the
|
||||
internal (in-app) timeline as well ... the best order of events might be to get the layers rendering really robust,
|
||||
then be able to push it to the in-app timeline and all the ext editors".
|
||||
|
||||
A cut finished in another editor needs its parts, not one flattened movie. `raea export capcut` (docs/capcut.feature)
|
||||
already hands CapCut the footage and sounds as clips of their own files and everything raea draws as one
|
||||
transparent overlay. This spec takes that split out of the CapCut export, makes it finer (captions and text apart
|
||||
from the other graphics), proves it against the render, and gives it to every editor from one place: CapCut,
|
||||
Premiere Pro and DaVinci Resolve, and the layout of raea's own timeline.
|
||||
|
||||
What there is to build on (read 11-16):
|
||||
- apps/capcut: the manifest's frames grouped into runs of footage and sound (plan.rs), the overlay rendered with
|
||||
the footage hidden (RAEA_HIDE_MEDIA=1) and what's under it (RAEA_HIDE_MEDIA=under), written as a CapCut draft
|
||||
(io/capcut). Its plan is written in CapCut's types, so no other editor can use it as it is.
|
||||
- systems/layers: hide.rs hides layers by key (RAEA_HIDE_LAYERS) and the footage (RAEA_HIDE_MEDIA) as page CSS;
|
||||
page.rs already calls an element whose children are all text "text", and footage "video".
|
||||
- io/alpha: transparent movies without ffmpeg (CC1): ProRes 4444, HEVC with alpha, QuickTime Animation, PNG.
|
||||
- sdk/timeline: tracks by kind (effect, text, overlay, main, sound, TL1a); the captions operation (TL7c) puts
|
||||
lines on a track named Captions, and read.ts writes each line into the composition as a `text` op, the same op
|
||||
a title is written with, so once in the code a caption and a title can't be told apart.
|
||||
|
||||
The layers, top to bottom, and what each is:
|
||||
| layer | what it holds | what the editor gets |
|
||||
| captions | the words said, as raea draws them (CA1) | a transparent movie + an .srt beside |
|
||||
| text | titles and other words on the picture that aren't captions | a transparent movie |
|
||||
| graphics | everything else raea draws over the footage: shapes, 3D, FX | a transparent movie |
|
||||
| footage | each <Video>'s file, at its trims, place and size (CC2a) | clips of the original files |
|
||||
| under | what raea draws beneath the footage: the backgrounds of what | a movie, left out when all black |
|
||||
| | holds it (CC2b) | |
|
||||
| sound | each sound clip, and footage's own sound linked to its clip | audio clips of the original files |
|
||||
A layer with nothing in it is left out, and costs no render.
|
||||
|
||||
The passes cost time only at export. Rendering a composition, in the app or with `raea render`, draws it once, as
|
||||
it does today; the marks LA1 adds are attributes in the code and draw nothing; raea's timeline reads the code (TL0c)
|
||||
and renders no layer. Only `raea export` (layers, capcut, premiere, resolve) renders the layers, each pass once.
|
||||
|
||||
Background:
|
||||
Given a composition renders with --manifest (render.json), as docs/capcut.feature's Background says
|
||||
And the reference render is the composition as `raea render` draws it, every layer at once
|
||||
|
||||
Rule: LA1. Captions and text are marked, so every pass and every tool tells them apart
|
||||
Scenario: LA1a. A caption carries data-raea-role="caption"
|
||||
Given words drawn as captions: lines the captions operation (TL7c) wrote, or a caption the SDK or an agent draws
|
||||
Then the element holding each caption's words carries data-raea-role="caption", and so does everything inside it
|
||||
(a word highlighted as it's said is part of its caption)
|
||||
And the captions operation's `text` ops say they are captions, and the code they write keeps the mark, so a
|
||||
timeline read back from the code (TL0c) puts them on the Captions track again
|
||||
And the raea skill's caption guide says to mark captions this way, and `raea check` names words that look like
|
||||
captions (timed to the transcript, one line at a time, at the bottom third) and aren't marked
|
||||
|
||||
Scenario: LA1b. Text is what Premiere, Resolve and CapCut call text
|
||||
Given a text item in each editor is words and their own style: Premiere's text layer (Essential Graphics),
|
||||
Resolve's Text+, CapCut's text, each with its font, fill, stroke, shadow and a background box of its own
|
||||
Then an element is text when it carries data-raea-role="text", or when it isn't a caption and its children are
|
||||
all words (page.rs's "text"), and it draws as those editors' text does: its words, its stroke and shadow, its
|
||||
own background
|
||||
And the elements around it (a lower third's bar, a card, a shape) are graphics, as a shape is its own item in
|
||||
each editor, so an editor can move the words apart from what they sit on
|
||||
And an element can opt out with data-raea-role="graphics" (a logo set in a font, a number in a chart)
|
||||
|
||||
Rule: LA2. Each layer is a pass of its own, rendered transparent, only when exported
|
||||
Scenario: LA2o. A render that isn't an export draws once
|
||||
Given a composition with captions, text, graphics and footage
|
||||
When it is rendered in the app or with `raea render`
|
||||
Then it is drawn in one pass, in the same time as before this spec, and no layer is written
|
||||
And an export of a version already rendered takes that render as its reference, and doesn't draw it again
|
||||
|
||||
Scenario: LA2a. The passes
|
||||
When the composition is exported in layers
|
||||
Then it is rendered once for each layer that has something in it, --alpha, with RAEA_LAYER naming the layer:
|
||||
| RAEA_LAYER | draws |
|
||||
| captions | only captions |
|
||||
| text | only text |
|
||||
| graphics | what RAEA_HIDE_MEDIA=1 draws today, less captions and text |
|
||||
| under | what RAEA_HIDE_MEDIA=under draws today |
|
||||
And RAEA_HIDE_MEDIA keeps working as it does, so `raea export capcut` from before this spec is unchanged
|
||||
And a pass is cut into clips where it draws something, frames that draw nothing a gap (CC2b)
|
||||
|
||||
Scenario: LA2b. Captions also go out as SubRip
|
||||
Then each run of frames a caption shows one line of words is an entry of NAME.srt: its words as the page shows
|
||||
them (a word highlight doesn't start a new entry), its first frame and the frame after its last, in timecode
|
||||
And the .srt is written beside the export for the person to upload to a network or keep, and no editor's
|
||||
project imports it (the captions movie is what the timeline shows, in raea's own style)
|
||||
|
||||
Rule: LA3. The layers put back together are the render
|
||||
Scenario: LA3a. The layers composited over each other match the reference render
|
||||
Given the layers' movies and the footage's frames as the manifest places them
|
||||
When they are composited bottom to top (under, footage, graphics, text, captions), each over the last
|
||||
Then every frame matches the reference render within the alpha codec's error (CC1a's numbers), checked at
|
||||
least at each clip's first, middle and last frame
|
||||
And a frame that doesn't match names the layer and the element (its key, file:line:col) that draws there
|
||||
|
||||
Scenario: LA3b. What can't be pulled apart is moved, and said
|
||||
Then a caption or a text element that something drawn after it covers goes down into the graphics layer, so
|
||||
what's in front stays in front, and the export says which and why
|
||||
And an element whose look depends on what's under it (mix-blend-mode, backdrop-filter, a mask over footage)
|
||||
stays in the layer that draws what it mixes with, or is named when no layer can hold it
|
||||
And CC2e's notes (filters, rotations, masks, notes and <Mix>) are said as they are
|
||||
|
||||
Scenario: LA3c. A fixture of each kind passes
|
||||
Given fixtures: full-frame footage with a title and captions; a lower third (bar and words); a picture in
|
||||
picture on a coloured card; captions with a word highlight; a title behind a graphic; 3D over footage
|
||||
Then LA3a passes for each, and LA3b's moves and notes are the ones listed for it
|
||||
|
||||
Rule: LA4. One layered timeline, written by `raea export layers`, read by every editor's export
|
||||
Scenario: LA4a. `raea export layers EDIT.tsx -o DIR` writes the layers and their timeline
|
||||
Then DIR holds layers.json, each layer's movie, NAME.srt when there are captions, and reference.mp4 (the
|
||||
reference render, to compare the editor's timeline against; on no timeline)
|
||||
And layers.json says the frame rate, size and length, and the tracks top to bottom, each with its layer and
|
||||
its clips: the file, where it starts and how long, its first source frame, its place and size, its gain and
|
||||
fades, and the id of the clip it's linked to (footage and its own sound)
|
||||
And it says what LA3b moved and what CC2e notes, the same lines the command prints
|
||||
And it names no editor's format: CapCut's draft, Premiere's and Resolve's XML are written from it
|
||||
|
||||
Scenario: LA4b. The CapCut export reads it
|
||||
Then `raea export capcut` is layers.json written as a CapCut draft, with a captions track and a text track
|
||||
above the overlay, and apps/capcut's tests pass as before for a composition with no captions or text
|
||||
And CapCut's tracks keep CapCut's order (TL1a): text above overlays above the main track, sound below
|
||||
And reference.mp4 is copied into the draft's folder, on no track, where CC2d kept it only beside the draft;
|
||||
every export's folder holds it, so the person can compare what the editor plays with what raea rendered
|
||||
|
||||
Rule: LA5. Premiere Pro and DaVinci Resolve take the same XML
|
||||
Scenario: LA5a. `raea export premiere EDIT.tsx` and `raea export resolve EDIT.tsx` write an FCP7 XML project
|
||||
Then each writes a folder: NAME.xml (xmeml version 5), the layers' movies, the .srt (LA2b) and reference.mp4,
|
||||
which the sequence doesn't use
|
||||
And the sequence has the composition's frame rate and size, its video tracks bottom to top under, footage
|
||||
(main, then each picture in picture on a track above), graphics, text, captions, and its audio tracks below
|
||||
And each clip of the original footage points at its file where it is, never copied (CapCut's draft copies,
|
||||
since sandboxed CapCut reads only its own folder, CC2d), at its trim, scaled and placed to its
|
||||
box (Basic Motion), at its gain (Audio Levels)
|
||||
And a video clip and its own sound are linked clipitems, so they move together, and each editor's own control
|
||||
separates them: in Premiere, Unlink; in Resolve, Link Clips off (Cmd/Ctrl+Shift+L); in CapCut, Extract audio
|
||||
And the two commands differ only where Premiere and Resolve read the same XML differently (found in LA5b)
|
||||
|
||||
Scenario: LA5b. Premiere and Resolve open it as raea rendered it
|
||||
Given the LA3c fixtures exported
|
||||
When the XML is imported (Premiere: File, Import; Resolve: File, Import, Timeline)
|
||||
Then every track and clip is where layers.json puts it, nothing is offline, and the frame at each clip's
|
||||
middle matches the reference render
|
||||
And which alpha codecs stay transparent in each is recorded here, with the version tested, and each command
|
||||
uses the first that does
|
||||
|
||||
Rule: LA6. raea's timeline is laid out the same way (raea-feed, after LA1)
|
||||
Scenario: LA6a. A timeline read from the code puts captions, text and graphics on their own tracks
|
||||
Given a composition read as a timeline (TL0c)
|
||||
Then elements marked or found as captions are on the Captions track, text on text tracks and other graphics
|
||||
on overlay tracks, as LA1 says, so the timeline and the exports agree on what each element is
|
||||
And they stay what TL0c makes them: clips that edit the code, not movies
|
||||
|
||||
Rule: LA7. The skill teaches it
|
||||
Scenario: LA7a. The delivery guide teaches layers
|
||||
Then sdk/guides/craft/motion/delivery.md says a cut an editor finishes goes out with raea export capcut,
|
||||
premiere or resolve, that captions arrive styled on their own track with an .srt beside them, and that words
|
||||
are fixed in raea and exported again, since the editors get them as pictures
|
||||
And it says to mark captions (LA1a) and to pass on what the export notes
|
||||
@@ -31,6 +31,124 @@ Feature: Lightspeed: raea as fast as anything could be, with the best quality, m
|
||||
And it updates the row here (value, date, commit) and appends a line to the log at the bottom
|
||||
And when an experiment doesn't pay, it records the numbers and reverts the change. A measured no is a result
|
||||
|
||||
Rule: 0.1.4, the performance release (set 2026-11-13: "the v0.1.4 update will be completely performance based")
|
||||
# Seven areas, each with a measured baseline before anything changes. Measured on a clone of a real workspace (9
|
||||
# projects, 21,713 files, a 19 GB media library), the built app headless, a Mac with 64 GB.
|
||||
Scenario: PF1. App start and data loading: seconds if not milliseconds
|
||||
Then the baseline, warm, headless: projects listed 0.61 to 0.67 s after the app is spawned (its host up at
|
||||
0.45 to 0.5 s); a project's feed shown 136 ms after the click with 6 cards, 260 to 282 ms with 41 (about 6 ms
|
||||
a card)
|
||||
And the largest real project's feed (93 cards): its first card 215 ms after the click, settled at 320 ms
|
||||
And the first launch after a new binary: 3.7 s to the projects listed (0.6 s warm)
|
||||
And open: a cold start after a reboot, the window on screen, and a feed of several hundred cards
|
||||
|
||||
Scenario: PF2. Thumbnails: feed items, the library, a project's Source
|
||||
Then a composition's still is `raea play FILE --offscreen --seek N` in a process of its own, two at a time:
|
||||
1.4 s, 1.9 s and 5.0 s for three real compositions (a ray-traced set is the 5 s one)
|
||||
And fixed (raea #141): beside a tsconfig.json, which raea writes into every new project, that play threw before
|
||||
its first frame, so every still there was a failed play and then a render (as slow, and the app's stage and
|
||||
`raea play` did not work at all in such a folder)
|
||||
And faster with PF4's start (raea #147): the same three stills 0.5 s, 1.2 s and 1.2 s warm, and one of the
|
||||
largest project that took 4.05 s as a one-frame render 0.63 s played
|
||||
And open: stills drawn in one long-lived process instead of one each (each pays the engine's start), and the
|
||||
library's tiles on a real library (the test copy has none)
|
||||
|
||||
Scenario: PF3. Video takes the space it needs, no more
|
||||
Then the baseline: 38 GB of video in 1,010 files on this Mac, most at 90 to 100 Mbit/s for 1080p, because every
|
||||
review version and every shot to be joined was rendered at `--quality master`
|
||||
And measured on 1080p24 film footage: default 16 Mbit/s, high 30, master 87; against the master encode the
|
||||
default scores VMAF 99.5 (worst frame 95.8) and high 99.7
|
||||
And fixed in the guides and the skill (raea #143, raea-skills #59, pinned 16ed215): a version made for notes
|
||||
takes no --quality flag, a film delivers at high, master is for delivered motion graphics and type, a
|
||||
replaced version is deleted
|
||||
And open: the app saying what renders take and offering to make old versions smaller; whether the library's
|
||||
copy of a render posted from a project is a clone of it or a second file
|
||||
|
||||
Scenario: PF4. Renders two to three times faster
|
||||
Then the baseline on a real ray-traced film at 1080p: a 61-frame shot is 5.2 to 5.8 s, of which the frames are
|
||||
about 2.2 s (25 to 30 a second: 18 to 20 ms waiting on the GPU and 14 to 22 ms making the frame's rows in
|
||||
JavaScript, one after the other) and the rest is the process starting; the whole 1,666-frame film is 53 s
|
||||
And the two levers that follow from it: a frame's rows made while the GPU draws the one before (they are
|
||||
independent: about 1.5 to 2 times on the frames), and every composition of a file rendered in one process (a
|
||||
film made a shot at a time pays about 3.3 s a shot for nothing: 33 shots, 110 s)
|
||||
And fixed (raea #144): a ray-traced camera's MSAA was turned on again every frame and off again by Bevy with a
|
||||
warning, a line a frame in the render's log
|
||||
And fixed (raea #147), the start: before its first frame a render read the first and last MiB of every picture,
|
||||
sound and video under the edit's folder (to ask for an optimized copy only a video has) and walked the whole
|
||||
folder, .git and node_modules included, for imports from outside it. Time to the first frame of an .mp4, bundle
|
||||
cached: 2.0 s to 0.35 s in a project of 1,234 files, 7.4 s to 0.62 s in one of 10,226; a 60-frame shot 4.7 s
|
||||
to 3.0 s end to end
|
||||
And measured since, what the frames themselves are: flat 2D at 1080p is 254 frames a second with no wait on the
|
||||
GPU; a ray-traced 1080p frame is 18 to 20 ms of GPU and about 5 ms of the scene's sync, so a long ray-traced
|
||||
render is the GPU's. Four ray-traced shots side by side take 7.4 s where in turn they take 11.3 (1.5 times),
|
||||
each frame two to three times slower: the GPU is one, and the window and every other render wait on it, so
|
||||
it is not a default. Two to three times on ray-traced frames is a cheaper trace (fewer pixels or samples
|
||||
traced, then upscaled), which changes the picture and is a rendering decision, not plumbing
|
||||
And measured 11-13 for drafts, where a smaller picture would change nothing that ships: `raea render` has no
|
||||
way to draw a composition smaller than it says it is (--w and --h only fill in a size a composition leaves
|
||||
out: the same 61-frame ray-traced shot with --w 960 --h 540 came out 1920 by 1080 in 4.1 s, against 4.7 s),
|
||||
so a draft (the composition editor's, a 3D scene's kept frames in docs/timeline.feature TL10f) pays for
|
||||
every pixel of the final. A render asked for again with nothing changed is the export cache's: 0.3 s
|
||||
And done 11-13 for drafts, in the SDK and not the engine: `<Composition edit={{ scale }}>` lays the composition
|
||||
out at its own size (useVideoConfig still says it) in a box drawn at that fraction, and registers the smaller
|
||||
size, so a 3D view, a whole-frame camera's or one in a page element's box, traces fewer pixels and a 2D layout
|
||||
written in px keeps every place (a title, a caption bar, a badge and a boxed 3D view drawn at 0.5 match the
|
||||
full-size frame but for softer type). The same 61-frame ray-traced 1080p shot, warm, three passes each: 2.75 s
|
||||
at full size, 1.6 to 1.7 s at 0.5 (1.7 times end to end, about twice on the frames once the start is taken
|
||||
out); the shot frames the same. The app's composition drafts and a scene's kept frames write it in their
|
||||
throwaway source (raea-feed host/edit.ts withDraftScale: the long side at 960 px, never larger, never under a
|
||||
quarter; RAEA_DRAFT_SCALE=1 draws them at full size). What ships is never scaled. It pays where the GPU
|
||||
does the work: the feed's sample room, a light scene, redraws two 3 s ranges in a headless raea window in
|
||||
8.9 s scaled against 9.4 s, since there the time is each render's start and its JavaScript, not pixels
|
||||
And open: the full-size render itself. Two to three times there is the cheaper trace upscaled (Solari at a
|
||||
lower main-pass resolution, Bevy's MainPassResolutionOverride, with MetalFX's denoised scaler taking it to
|
||||
full size: its input is the output's size today and it runs before the forward meshes), a rendering decision
|
||||
with its own picture checks
|
||||
|
||||
Scenario: PF5. What agents lose time on
|
||||
Then fixed in the lane check (tools/agents/check, on this Mac): the CLI surface step tests the raea it rebuilds
|
||||
(it tested an older build on PATH, and stayed failing after its own rebuild), and the skills step reads the feed
|
||||
app at raea-feed's main (it read whatever branch the shared checkout had out): a lane's check now passes with
|
||||
no variables set
|
||||
And fixed (raea #141, in 0.1.3): `raea play` beside a tsconfig.json, which every new project has
|
||||
And fixed in the app (raea-feed #13, not merged): a review sent on an item whose author is named over a
|
||||
connection went to an inbox it doesn't have, so its edits waited for good; and an agent whose session isn't
|
||||
open is started again by the send
|
||||
And open, each seen on 2026-11-13: a render with <Audio> that reaches no sound is refused only after every frame
|
||||
is drawn (53 s on a film; what sounds are known only once the frames are made); `-o DIR` writes every frame
|
||||
as a PNG (4.9 GB for a film) with nothing said of its size; `but commit` with a long message commits nothing
|
||||
and says so only in a hint; main can fail its own L1 after a GitHub merge (two stale generated pages blocked
|
||||
every lane for a morning)
|
||||
And a release's builds, about three hours each and run many times, moved to larger runners with a cache volume
|
||||
and a compile cache: a candidate after a small change should take minutes (the release lane's; rc4 and rc5
|
||||
are the first measured)
|
||||
|
||||
Scenario: PF6. Video playback and looking around a scene
|
||||
Then video (raea #137): frames decoded a quarter second ahead and shown when due, a faster pixel conversion, a
|
||||
small-drawn video drawn from a halving made off the page's thread: 4K30's worst wait between frames 76 ms to
|
||||
39, 4K60 on a page drawing 120 times a second 0 of 1,214 frames passed over
|
||||
And the app's player (raea-feed #13, not merged): the detail view's clock is outside React state, so a playing
|
||||
video's ticks render only what shows the time: the seconds of 60 fps play with a wait of 26 ms or more
|
||||
between frames go from nearly all to about half
|
||||
And a scene looked around (11-13, the feed's sample room live in a headless window, its counter read over
|
||||
5 s): 57 frames a second standing still, 58 while an orbit is dragged without pause (the headless window
|
||||
draws 60 at most)
|
||||
And open: frames still go through the CPU; a heavy or ray-traced scene's rate while orbiting is not measured
|
||||
|
||||
Scenario: PF8. Pages and assets from this Mac open at once
|
||||
Then covered so far by PF1 (a feed) and PF2 (stills)
|
||||
And a project's Source view (Stay: 159 rows), first visit with an empty proxy store, by wall-clock marks in
|
||||
the page: its rows committed 0.59 s after the click; 0.29 s with its views loaded ahead (raea-feed #17: a
|
||||
lazily loaded view waited out React's 300 ms hold on every first open). The 2.4 to 3.8 s written here before
|
||||
was the measuring script: the window's `ui` tool hands out its last 240 frames in order, and a slow poller
|
||||
reads frames seconds old
|
||||
And the host found a project's folder by starting git and `raea workspace --json` (0.1 s) on nearly every
|
||||
request (raea-feed #16 keeps both answers while their files stand): with 54 projects, 52 briefs read at page
|
||||
open went from 4,831 ms for the slowest to 68, a library's files from 1,710 ms to 3
|
||||
And a library's tiles have pictures before its files are indexed, and draw in raea's window (raea-feed #15):
|
||||
60 pictures (463 MB) 3.6 s to make the first time, 0.02 s after
|
||||
And open: an asset's preview and a model's; cold start after a reboot
|
||||
|
||||
Rule: Lightspeed's goals (set 2026-10-19, after the four multi-day levers; the user: "just focus on lightspeed work")
|
||||
Scenario: Who owns what now
|
||||
Then lightspeed owns performance and optimization end to end: it builds its levers itself, not only measures them
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// check: frames 0,45,89
|
||||
import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
|
||||
import { applyAll, empty, end, length, valueAt, type Clip, type Op, type Timeline } from "raea/editor";
|
||||
|
||||
// A timeline made in code and edited by operations, as the feed's editor and an agent's script both edit one: two
|
||||
// shots on the main track and a title over them.
|
||||
const before: Timeline = {
|
||||
...empty(30),
|
||||
tracks: [
|
||||
{ id: "text", kind: "text", clips: [{ id: "title", kind: "text", name: "Title", start: 0, length: 60 }] },
|
||||
{
|
||||
id: "main",
|
||||
kind: "main",
|
||||
clips: [
|
||||
{ id: "a", kind: "video", name: "Shot A", start: 0, length: 90, in: 0, source: 300 },
|
||||
{ id: "b", kind: "video", name: "Shot B", start: 90, length: 90, in: 0, source: 300 },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// Shot A split at one second, and the title faded in by two keys on its opacity.
|
||||
const first: Op[] = [
|
||||
{ op: "split", at: 30, ids: ["a"] },
|
||||
{ op: "key", id: "title", prop: "opacity", at: 0, value: 0, ease: [0.42, 0, 0.58, 1] },
|
||||
{ op: "key", id: "title", prop: "opacity", at: 20, value: 1 },
|
||||
];
|
||||
const cut = applyAll(before, first);
|
||||
// The half the split made is found where it starts, and played twice as fast: the main track's magnet closes the
|
||||
// gap, so Shot B comes in earlier.
|
||||
const half = cut.timeline.tracks[1].clips.find((c) => c.start === 30)!;
|
||||
const after = applyAll(cut.timeline, [{ op: "set", id: half.id, set: { speed: 2 } }]);
|
||||
// Every operation gives back its inverse: applied last first, they put the timeline back as it was.
|
||||
const undone = applyAll(after.timeline, [...after.inverse, ...cut.inverse]).timeline;
|
||||
|
||||
const SCALE = 5; // px a frame
|
||||
const COLOR: Record<string, string> = { video: "#3d7bd9", text: "#c9853d" };
|
||||
|
||||
function Row({ clips, top, frame }: { clips: Clip[]; top: number; frame: number }) {
|
||||
return (
|
||||
<>
|
||||
{clips.map((c) => {
|
||||
const on = frame >= c.start && frame < end(c);
|
||||
const opacity = typeof valueAt(c.keys?.opacity, frame - c.start) === "number" ? (valueAt(c.keys?.opacity, frame - c.start) as number) : 1;
|
||||
return (
|
||||
<div
|
||||
key={c.id}
|
||||
style={{ position: "absolute", left: 80 + c.start * SCALE, top, width: c.length * SCALE - 4, height: 64, borderRadius: 8, background: COLOR[c.kind] ?? "#777", opacity: on ? Math.max(0.35, opacity) : 0.35, color: "#fff", fontSize: 26, padding: "16px 14px", boxSizing: "border-box", overflow: "hidden", whiteSpace: "nowrap" }}
|
||||
>
|
||||
{c.name}
|
||||
{c.speed && c.speed !== 1 ? ` · ${c.speed}x` : ""}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function Edits() {
|
||||
const frame = useCurrentFrame();
|
||||
const label = (y: number, text: string) => <div style={{ position: "absolute", left: 80, top: y, color: "#aaa", fontSize: 28 }}>{text}</div>;
|
||||
return (
|
||||
<AbsoluteFill style={{ background: "#16181c", fontFamily: "sans-serif" }}>
|
||||
{label(100, `Before: ${length(before)} frames`)}
|
||||
<Row clips={before.tracks[0].clips} top={144} frame={frame} />
|
||||
<Row clips={before.tracks[1].clips} top={218} frame={frame} />
|
||||
{label(330, `After ${first.length + 1} edits: ${length(after.timeline)} frames`)}
|
||||
<Row clips={after.timeline.tracks[0].clips} top={374} frame={frame} />
|
||||
<Row clips={after.timeline.tracks[1].clips} top={448} frame={frame} />
|
||||
{label(560, `Undone: ${JSON.stringify(undone) === JSON.stringify(before) ? "as it was" : "changed"}`)}
|
||||
<div style={{ position: "absolute", left: 80 + frame * SCALE, top: 134, width: 3, height: 392, background: "#ff4d4d" }} />
|
||||
</AbsoluteFill>
|
||||
);
|
||||
}
|
||||
|
||||
registerRoot(() => <Composition id="edits" component={Edits} width={1280} height={720} fps={30} durationInFrames={90} />);
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: "Check a cut with it"
|
||||
summary: "Score a cut with your fingerprint before it's posted, check that a fix removed a flag instead of hiding it, judge scripts and stills, find things floating in a 3D shot, and compare a cut with work you admire."
|
||||
order: 2
|
||||
sources: ["docs/fingerprint.feature", "apps/fingerprint/src", "systems/fingerprint-use/src", "systems/fingerprint-things/src"]
|
||||
---
|
||||
|
||||
## Score a cut
|
||||
|
||||
```sh
|
||||
raea fingerprint score out/cut.mp4 # the moments it expects a note on, first
|
||||
raea fingerprint score out/cut.mp4 --sheet cut.png # the same on a sheet of frames, with where boxed
|
||||
raea fingerprint score out/cut.mp4 --timeline # the piece second by second, in words
|
||||
raea fingerprint which out/cut.mp4 # which fingerprint judged it, and why
|
||||
```
|
||||
|
||||
`score` names which fingerprint judged the piece, then lists the moments it expects a note on, each in your words. On
|
||||
a picture axis that has learned where, a moment also says where in the frame and, on a render with a layer pass, the
|
||||
layers there ("top right on Floor"). `--json` gives every axis for every window, for a script.
|
||||
|
||||
An axis that **knows** can hold a post back until you've looked. One that is **learning** only advises. Your agents
|
||||
run `score` before they post, fix each moment that holds the cut back, or tell you why they didn't.
|
||||
|
||||
## Check a fix
|
||||
|
||||
```sh
|
||||
raea fingerprint score out/v2.mp4 --was out/v1.mp4
|
||||
```
|
||||
|
||||
For each moment that held v1 back, this says whether v2 fixed it, still has it, or looks **disguised**: nearer the
|
||||
axis's disguised defects than clean work, so the fix hid the defect instead of removing its cause. Only a fixed flag
|
||||
counts as fixed.
|
||||
|
||||
## Scripts, briefs and stills
|
||||
|
||||
A fingerprint reads more than video. A script, a brief or another text file gets EmbeddingGemma 2 rows, one per
|
||||
paragraph, and a still gets the picture columns. Each axis judges only what the file has, so a script is never called
|
||||
blurry. raea's own axes judge pictures, sound and motion. To judge writing, add an axis that reads text to your
|
||||
fingerprint.ts and teach it like any other.
|
||||
|
||||
## Things in a shot
|
||||
|
||||
```sh
|
||||
raea render shot.tsx --layers -o shot.mp4 # the video and its layers (shot.layers)
|
||||
raea render shot.tsx --aov -o shot.aov # its depth, beside it
|
||||
raea fingerprint things shot.mp4 --json > things.json
|
||||
raea check shot.mp4 --things things.json
|
||||
```
|
||||
|
||||
`things` finds a piece's shots, the things in each (a render's layers, and anything marked on its notes) with their
|
||||
depth, and the camera's path. It says where a thing floats, where two pass through each other, where the camera lurches
|
||||
in the middle of a move, and where nothing is on screen. `raea check --things` turns those into findings beside the
|
||||
rest. Floating needs real depth: with the render's `--aov` pass beside it (`shot.aov` for `shot.mp4`) it uses the
|
||||
render's own depth, and without one it estimates depth from the picture, which can't always tell a hanging box from
|
||||
one on the floor.
|
||||
|
||||
## Profiles of work you admire
|
||||
|
||||
```sh
|
||||
raea fingerprint profile golden/*.mp4 --as reels --against others.txt
|
||||
raea fingerprint score cut.mp4 --profile reels
|
||||
```
|
||||
|
||||
A profile takes the ranges your references span: loudness, bass against treble, cuts a minute, motion, brightness,
|
||||
contrast, saturation and sharpness. A cut scored against it hears which measures fall outside, where, and which way
|
||||
to move. The profile checks itself: each reference has to fit the others' ranges more often than unrelated work does,
|
||||
or raea says it doesn't tell this taste apart.
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "Fingerprint: teach raea your eye"
|
||||
summary: "What raea learns about good work from your notes, marks and approvals, on your own computer: the axes it judges, the Fingerprint page, and what it can't judge yet."
|
||||
order: 0
|
||||
sources: ["docs/fingerprint.feature", "docs/fingerprint.md", "apps/fingerprint/src", "systems/fingerprint/src", "systems/fingerprint-use/src", "apps/app/src/fingerprint"]
|
||||
---
|
||||
|
||||
A fingerprint is your sense of good work, as raea has learned it on your own computer. It's a list of axes, the things you
|
||||
notice: blur, a black frame, hiss, clipping, a glow over everything, a frozen picture, and taste axes such as fake,
|
||||
barren or unreadable text. Each axis has a small model trained over the **Edit Embedding Zoo**: the encoders that run
|
||||
on your computer (SigLIP 2 for pictures, CLAP for sound, YAMNet for sound events, EmbeddingGemma 2 for scripts and other
|
||||
text, Depth Anything 3 for depth), so nothing leaves the machine unless you share it. The zoo is the same for everyone
|
||||
and never changes; what you train over it is yours.
|
||||
|
||||
Your agents use it before they post a cut: `raea fingerprint score` lists the moments your fingerprint expects a note
|
||||
on, each named in your words, and the agent fixes them or tells you why it didn't. It tells you the axis and the
|
||||
moment, never a number.
|
||||
|
||||
## In this section
|
||||
|
||||
- [Train your fingerprint](train.md): learning from your own renders, your notes and marks, a box on the part of a
|
||||
sound you mean, and a post-mortem when a project is done.
|
||||
- [Check a cut with it](check.md): scoring a cut, checking a fix, scripts and stills, things in a shot, and profiles
|
||||
of work you admire.
|
||||
- [Projects and teams](projects.md): one fingerprint for each kind of work, which one judges a project, keeping one
|
||||
with a project or workspace, and sharing with a team.
|
||||
|
||||
## The Fingerprint page
|
||||
|
||||
Open **Fingerprint** in the sidebar. The card at the top is your mark, one column of bits for each axis, grouped by
|
||||
sense: pictures, sound and motion. Point at a sense to see its axes and how well each one judges. Below it, every axis
|
||||
says whether it **knows** (it's trusted, and can hold a post back until you've looked), is **learning** (it gives
|
||||
advice), or is still **to learn** (it only has its words). **Can't judge yet** lists what no axis can see, such as
|
||||
whether a piece works as a whole.
|
||||
|
||||
The name in the page's title is a menu of your fingerprints. **Settings** holds what one is for, what it builds on,
|
||||
whether it's your default, and **Learn from renders**.
|
||||
|
||||
A fingerprint's axes are a file you can read and edit, `~/.raea/fingerprints/NAME/fingerprint.ts`, typed by
|
||||
`raea/fingerprint` ([the SDK page](../reference/sdk/fingerprint.md)). Add, remove or reword an axis there; its
|
||||
evidence is raea's to keep. Every command is on [the CLI page](../reference/cli/fingerprint.md).
|
||||
|
||||
## What it can't do yet
|
||||
|
||||
Axes judge two-second moments, so a fingerprint can't say whether a piece works as a whole, or judge story and pace
|
||||
across shots. It can say where in the frame only for blur, glitches and flat, barren surfaces; glow it can only
|
||||
flag. Sound axes judge the whole sound in each moment, so a box's pitch band is kept but not yet learned from. A
|
||||
stylised look or a held shot can read as a defect. And taste axes with only words never hold a post back.
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: "Projects and teams"
|
||||
summary: "One fingerprint for each kind of work, which one judges a project and why, keeping one with a project or its workspace from the app, and sharing one with a team."
|
||||
order: 3
|
||||
sources: ["docs/fingerprint.feature", "apps/fingerprint/src", "apps/app/src/fingerprint", "apps/app/host/fingerprint.ts"]
|
||||
---
|
||||
|
||||
## One for each kind of work
|
||||
|
||||
You can keep several fingerprints, each saying what it's for. One can build on another: a client's ads can start from
|
||||
your own and add what that client cares about. It inherits your axes and evidence, counts its own labels twice, and
|
||||
never changes yours.
|
||||
|
||||
```sh
|
||||
raea fingerprint new client-ads --about "Short ads for one brand: pace, type on screen" --extends me
|
||||
```
|
||||
|
||||
## Which one judges a project
|
||||
|
||||
Which one judges a piece is decided by where it lives: the project's fingerprints first, then the workspace's, then
|
||||
your own. At each level, the one whose `applies` matches the piece's kind wins, else that level's default.
|
||||
|
||||
In the app, a project's feed names it beside the project's name at the top: the fingerprint chip. Open it to see which
|
||||
fingerprint judges the project and why. When it's one of yours, **Open** takes you to its Fingerprint page. The chip
|
||||
shows once you have a fingerprint.
|
||||
|
||||
From a terminal:
|
||||
|
||||
```sh
|
||||
raea fingerprint which projects/brand/out/cut.mp4 # which one judges this, and why
|
||||
```
|
||||
|
||||
## Keep one with a project
|
||||
|
||||
The chip's menu has **Keep with this project** and **Keep with the workspace**. Pick one of your fingerprints under
|
||||
either and raea copies it into that folder and commits it, so it travels with the folder's repository: everyone on
|
||||
the team judges the project with the same taste, and the chip names it from then on.
|
||||
|
||||
The same from a terminal:
|
||||
|
||||
```sh
|
||||
raea fingerprint share client-ads --in project projects/brand # copy it into the project
|
||||
raea fingerprint use client-ads --in project projects/brand # and make it the one that judges there
|
||||
```
|
||||
|
||||
Use `--in workspace` for every project in the workspace.
|
||||
|
||||
## Sharing with a team
|
||||
|
||||
Sharing copies the axes and the evidence (embeddings, spans and labels) into the workspace or project, to travel with
|
||||
its repository. It never shares media or trained weights: each teammate's Mac trains its own from everyone's
|
||||
evidence, and each person's evidence sits in its own folder so two people labelling at once never edit the same
|
||||
file. When raea's encoders change, `raea fingerprint reembed FOLDER` moves the evidence to the new ones wherever it
|
||||
finds the media.
|
||||
|
||||
```sh
|
||||
raea fingerprint diff me ana # where two tastes differ, and the moments that show it
|
||||
```
|
||||
|
||||
## Notes teach the one that judged
|
||||
|
||||
Your notes and marks on a piece teach the fingerprint that judged it, so a client's notes stay with the client's
|
||||
fingerprint. When one of its lessons is really yours, move it up:
|
||||
|
||||
```sh
|
||||
raea fingerprint move --fp client-ads --axis glow # its glow labels become yours (me)
|
||||
```
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "Train your fingerprint"
|
||||
summary: "Teach a fingerprint from your own renders, your notes, marks and approvals, a box on the part of a sound you mean, and a post-mortem when a project is done; and when it trusts an axis."
|
||||
order: 1
|
||||
sources: ["docs/fingerprint.feature", "apps/fingerprint/src", "systems/fingerprint/src", "apps/app/src/fingerprint"]
|
||||
---
|
||||
|
||||
A new fingerprint judges from the words for each axis on day one. Everything after that is evidence: your own work,
|
||||
and what you say about it.
|
||||
|
||||
## From your renders
|
||||
|
||||
To train the mechanical axes, choose **Learn from renders** in the Fingerprint page's Settings, or run:
|
||||
|
||||
```sh
|
||||
raea fingerprint bootstrap ~/renders/*.mp4
|
||||
```
|
||||
|
||||
raea damages moments of your own finished work on purpose (a blur, a black frame, a gap in the sound) and learns the
|
||||
difference, held out by source, so it can't learn a shortcut. Each axis also has disguised versions of its defect, such
|
||||
as a blur that was sharpened afterwards or a freeze hidden under a slow zoom. An axis that misses its disguises stays
|
||||
advice.
|
||||
|
||||
The same run teaches picture axes where a defect sits. It blurs, punches a hole in, greys out or glows one patch of a
|
||||
frame, and learns to find the patch. An axis that finds it 85 times in 100 on renders it didn't learn from says where:
|
||||
`score` then gives the moment's place in the frame, such as "top right", and on a render with a layer pass the layers
|
||||
there, such as "on Floor", and `--sheet` boxes it on the frame.
|
||||
|
||||
## From your reviewing
|
||||
|
||||
Your own reviewing teaches it the rest:
|
||||
|
||||
```sh
|
||||
raea fingerprint teach cut.mp4 --axis blur --at 4.2 --bad # a moment you marked
|
||||
raea fingerprint approve final.mp4 # approved work is clean, except where you left a note
|
||||
raea fingerprint pair v1.mp4 v2.mp4 --axis glow # v2 is better on glow
|
||||
raea fingerprint read projects/stay # read your pinned notes into labels
|
||||
raea fingerprint readings --ask 50 # check 50 of those readings in the app
|
||||
raea fingerprint learn-notes projects/stay # once they read right, your notes become evidence
|
||||
```
|
||||
|
||||
Notes become evidence only after you've checked how they were read: the kind right 45 times in 50 and the axis 40. A
|
||||
note that asks for a creative change goes to the brief, never into an axis. Each project's notes teach the
|
||||
fingerprint that judges that project ([Projects and teams](projects.md)).
|
||||
|
||||
## Point at what you mean
|
||||
|
||||
A note can say exactly what it's about. On the picture, drop a pin and mark, box or lasso the thing you mean.
|
||||
|
||||
On the sound, choose **Spectrogram** on the timeline's sound track (or open the sound in Listen) and, with the Comment
|
||||
tool, drag a box around the part you mean, such as a hiss up high or a hum down low. A sound on its own shows its
|
||||
spectrogram under the waveform, where any drag draws a box. The note keeps the box's time as its span and its pitch
|
||||
band, your agent reads both with the note, and `learn-notes` labels that span and keeps the band in the label. Sound
|
||||
axes still judge the whole sound in each moment, so the band is kept but not yet learned from.
|
||||
|
||||
## When an axis is trusted
|
||||
|
||||
An axis is trusted once it has 16 labels of each kind from 3 projects, ranks real defects above clean work on
|
||||
projects it never saw, and catches its disguises. `raea fingerprint report` says where each one stands. An axis that is
|
||||
still under its bar with 300 labels is **stuck**: more labels won't help it, so `report` names it as one to try on
|
||||
another encoder.
|
||||
|
||||
## Looking back on a project
|
||||
|
||||
When a project is done, a post-mortem asks you what the fingerprint is least sure of:
|
||||
|
||||
```sh
|
||||
raea fingerprint postmortem projects/film # at most ten yes/no questions in the app, each with its moment
|
||||
raea fingerprint postmortem projects/film --tally # your answers become evidence; each head's score before and after
|
||||
```
|
||||
|
||||
It scores every version in the project's feed and first asks where a head disagrees with a label you gave on that
|
||||
moment, then where a head is nearest its flag, one question per axis within four seconds.
|
||||
@@ -14,8 +14,8 @@ the same calls.
|
||||
Anyone on **Pro** or **Team** can, a person on their own included: there's no separate developer plan and no
|
||||
per-call price. The API reaches what lives in raea's cloud, so it comes with the plans that have cloud storage.
|
||||
|
||||
On **Free**, libraries stay on your Mac, and so does their search. Search them from the app, or from a terminal or an
|
||||
agent on the same Mac with [`raea library`](../reference/cli/library.md), which needs no key. Asking for an agent key
|
||||
On **Free**, libraries stay on your computer, and so does their search. Search them from the app, or from a terminal or an
|
||||
agent on the same computer with [`raea library`](../reference/cli/library.md), which needs no key. Asking for an agent key
|
||||
on Free answers `402 agent_keys_paid`.
|
||||
|
||||
## Make an agent key
|
||||
@@ -92,7 +92,7 @@ Each hit is a moment: the file's `sha256`, the segment's `t0` and `t1` in second
|
||||
your words as keywords too: `"by": "meaning"`. Without one, it searches by keywords alone: `"by": "words"`. The vector
|
||||
is EmbeddingGemma 2's (`onnx-community/embeddinggemma-2-ONNX`, 768 numbers) for the text
|
||||
`task: search result | query: ` followed by your words. raea never runs a model in its cloud for you: the app embeds
|
||||
your words on your Mac, which is what `raea library search` and the app's Search do, and raea.io's Storage page
|
||||
your words on your computer, which is what `raea library search` and the app's Search do, and raea.io's Storage page
|
||||
borrows one of your computers that's online.
|
||||
|
||||
## Get a file
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
---
|
||||
title: "Fingerprint: teach raea your eye"
|
||||
summary: "What raea learns about good work from your notes, marks and approvals, on your Mac: the axes it judges, how one is trained and trusted, keeping one fingerprint for each kind of work, and sharing one with a team."
|
||||
order: 6
|
||||
sources: ["docs/fingerprint.feature", "docs/fingerprint.md", "apps/fingerprint/src", "systems/fingerprint/src", "systems/fingerprint-use/src", "systems/fingerprint-things/src", "apps/app/src/fingerprint"]
|
||||
---
|
||||
|
||||
A fingerprint is your sense of good work, as raea has learned it on your Mac. It's a list of axes, the things you
|
||||
notice: blur, a black frame, hiss, clipping, a glow over everything, a frozen picture, and taste axes such as fake,
|
||||
barren or unreadable text. Each axis has a small model over encoders that run on your Mac (SigLIP 2 for pictures, CLAP
|
||||
for sound, YAMNet for sound events, EmbeddingGemma 2 for scripts and other text), so nothing leaves the machine unless
|
||||
you share it.
|
||||
|
||||
Your agents use it before they post a cut: `raea fingerprint score` lists the moments your fingerprint expects a note
|
||||
on, each named in your words, and the agent fixes them or tells you why it didn't. It tells you the axis and the
|
||||
moment, never a number.
|
||||
|
||||
## The Fingerprint page
|
||||
|
||||
Open **Fingerprint** in the sidebar. The card at the top is your mark, one column of bits for each axis, grouped by
|
||||
sense: pictures, sound and motion. Point at a sense to see its axes and how well each one judges. Below it, every axis
|
||||
says whether it **knows** (it's trusted, and can hold a post back until you've looked), is **learning** (it gives
|
||||
advice), or is still **to learn** (it only has its words). **Can't judge yet** lists what no axis can see, such as
|
||||
whether a piece works as a whole.
|
||||
|
||||
The name in the page's title is a menu of your fingerprints. **Settings** holds what one is for, what it builds on,
|
||||
whether it's your default, and **Learn from renders**.
|
||||
|
||||
## Training one
|
||||
|
||||
A new fingerprint judges from the words for each axis on day one. To train the mechanical axes, choose **Learn from
|
||||
renders**, or run:
|
||||
|
||||
```sh
|
||||
raea fingerprint bootstrap ~/renders/*.mp4
|
||||
```
|
||||
|
||||
raea damages moments of your own finished work on purpose (a blur, a black frame, a gap in the sound) and learns the
|
||||
difference, held out by source, so it can't learn a shortcut. Each axis also has disguised versions of its defect, such
|
||||
as a blur that was sharpened afterwards or a freeze hidden under a slow zoom. An axis that misses its disguises stays
|
||||
advice.
|
||||
|
||||
The same run teaches picture axes where a defect sits. It blurs, punches a hole in, greys out or glows one patch of a
|
||||
frame, and learns to find the patch. An axis that finds it 85 times in 100 on renders it didn't learn from says where:
|
||||
`score` then gives the moment's place in the frame, such as "top right", and on a render with a layer pass the layers
|
||||
there, such as "on Floor", and `--sheet` boxes it on the frame.
|
||||
|
||||
Your own reviewing teaches it the rest:
|
||||
|
||||
```sh
|
||||
raea fingerprint teach cut.mp4 --axis blur --at 4.2 --bad # a moment you marked
|
||||
raea fingerprint approve final.mp4 # approved work is clean, except where you left a note
|
||||
raea fingerprint pair v1.mp4 v2.mp4 --axis glow # v2 is better on glow
|
||||
raea fingerprint read projects/stay # read your pinned notes into labels
|
||||
raea fingerprint readings --ask 50 # check 50 of those readings in the app
|
||||
```
|
||||
|
||||
Notes become evidence only after you've checked how they were read: the kind right 45 times in 50 and the axis 40. A
|
||||
note that asks for a creative change goes to the brief, never into an axis. An axis is trusted once it has 16 labels of
|
||||
each kind from 3 projects, ranks real defects above clean work on projects it never saw, and catches its disguises.
|
||||
`raea fingerprint report` says where each one stands. An axis that is still under its bar with 300 labels is
|
||||
**stuck**: more labels won't help it, so `report` names it as one to try on another encoder.
|
||||
|
||||
## Scripts, briefs and stills
|
||||
|
||||
A fingerprint reads more than video. A script, a brief or another text file gets EmbeddingGemma 2 rows, one per
|
||||
paragraph, and a still gets the picture columns. Each axis judges only what the file has, so a script is never called
|
||||
blurry. raea's own axes judge pictures, sound and motion. To judge writing, add an axis that reads text to your
|
||||
fingerprint.ts and teach it like any other.
|
||||
|
||||
## Looking back on a project
|
||||
|
||||
When a project is done, a post-mortem asks you what the fingerprint is least sure of:
|
||||
|
||||
```sh
|
||||
raea fingerprint postmortem projects/film # at most ten yes/no questions in the app, each with its moment
|
||||
raea fingerprint postmortem projects/film --tally # your answers become evidence; each head's score before and after
|
||||
```
|
||||
|
||||
It scores every version in the project's feed and first asks where a head disagrees with a label you gave on that
|
||||
moment, then where a head is nearest its flag, one question per axis within four seconds.
|
||||
|
||||
## Things in a shot
|
||||
|
||||
```sh
|
||||
raea render shot.tsx --layers -o shot.mp4 # the video and its layers (shot.layers)
|
||||
raea render shot.tsx --aov -o shot.aov # its depth, beside it
|
||||
raea fingerprint things shot.mp4 --json > things.json
|
||||
raea check shot.mp4 --things things.json
|
||||
```
|
||||
|
||||
`things` finds a piece's shots, the things in each (a render's layers, and anything marked on its notes) with their
|
||||
depth, and the camera's path. It says where a thing floats, where two pass through each other, where the camera lurches
|
||||
in the middle of a move, and where nothing is on screen. `raea check --things` turns those into findings beside the
|
||||
rest. Floating needs real depth: with the render's `--aov` pass beside it (`shot.aov` for `shot.mp4`) it uses the
|
||||
render's own depth, and without one it estimates depth from the picture, which can't always tell a hanging box from
|
||||
one on the floor.
|
||||
|
||||
## One for each kind of work
|
||||
|
||||
You can keep several fingerprints, each saying what it's for. One can build on another: a client's ads can start from
|
||||
your own and add what that client cares about. It inherits your axes and evidence, counts its own labels twice, and
|
||||
never changes yours.
|
||||
|
||||
```sh
|
||||
raea fingerprint new client-ads --about "Short ads for one brand: pace, type on screen" --extends me
|
||||
raea fingerprint which projects/brand/out/cut.mp4 # which one judges this, and why
|
||||
raea fingerprint use client-ads --in project projects/brand
|
||||
```
|
||||
|
||||
Which one judges a piece is decided by where it lives: the project's fingerprints first, then the workspace's, then
|
||||
your own. At each level, the one whose `applies` matches the piece's kind wins, else that level's default.
|
||||
|
||||
Your notes and marks on a piece teach the fingerprint that judged it, so a client's notes stay with the client's
|
||||
fingerprint. When one of its lessons is really yours, move it up:
|
||||
|
||||
```sh
|
||||
raea fingerprint move --fp client-ads --axis glow # its glow labels become yours (me)
|
||||
```
|
||||
|
||||
## Profiles of work you admire
|
||||
|
||||
```sh
|
||||
raea fingerprint profile golden/*.mp4 --as reels --against others.txt
|
||||
raea fingerprint score cut.mp4 --profile reels
|
||||
```
|
||||
|
||||
A profile takes the ranges your references span: loudness, bass against treble, cuts a minute, motion, brightness,
|
||||
contrast, saturation and sharpness. A cut scored against it hears which measures fall outside, where, and which way
|
||||
to move. The profile checks itself: each reference has to fit the others' ranges more often than unrelated work does,
|
||||
or raea says it doesn't tell this taste apart.
|
||||
|
||||
## Sharing with a team
|
||||
|
||||
```sh
|
||||
raea fingerprint share studio --in workspace
|
||||
raea fingerprint diff me ana # where two tastes differ, and the moments that show it
|
||||
```
|
||||
|
||||
Sharing copies the axes and the evidence (embeddings, spans and labels) into the workspace or project, to travel with
|
||||
its repository. It never shares media or trained weights: each teammate's Mac trains its own from everyone's
|
||||
evidence, and each person's evidence sits in its own folder so two people labelling at once never edit the same
|
||||
file. When raea's encoders change, `raea fingerprint reembed FOLDER` moves the evidence to the new ones wherever it
|
||||
finds the media.
|
||||
|
||||
## What it can't do yet
|
||||
|
||||
Axes judge two-second moments, so a fingerprint can't say whether a piece works as a whole, or judge story and pace
|
||||
across shots. It can say where in the frame only for blur, glitches and flat, barren surfaces; glow it can only
|
||||
flag. A stylised look or a held shot can read as a defect. And taste axes with only words never hold a post back.
|
||||
@@ -44,6 +44,13 @@ The raea skill (`raea skill` prints it) is the short version of the same loop; t
|
||||
- [3D scenes](guides/3d.md): cameras, lights, meshes and materials in TSX, drawn by Bevy.
|
||||
- [Apps on the web target or native](guides/apps.md): a React file that runs as a desktop app.
|
||||
|
||||
## Fingerprint
|
||||
|
||||
- [Fingerprint: teach raea your eye](fingerprint/index.md): what raea learns about good work from your notes, on your own computer.
|
||||
- [Train your fingerprint](fingerprint/train.md): your renders, notes and marks, and a box on the part of a sound you mean.
|
||||
- [Check a cut with it](fingerprint/check.md): score a cut before it's posted, and check that a fix really fixed it.
|
||||
- [Projects and teams](fingerprint/projects.md): which fingerprint judges a project, and keeping one with it for the team.
|
||||
|
||||
## Reference
|
||||
|
||||
- [The CLI](reference/cli.md): a page for each of the 43 `raea` verbs, with its forms, where it runs and what each flag does.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "raea blender"
|
||||
summary: "Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth."
|
||||
order: 104
|
||||
order: 106
|
||||
sources: ["apps/tools/src/blender.rs", "apps/engines/src/blender_ts.rs"]
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "raea bug"
|
||||
summary: "Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed."
|
||||
order: 129
|
||||
sources: ["engine/cli/src/bug.ts", "engine/cli/src/cli.rs"]
|
||||
---
|
||||
|
||||
Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea bug TITLE... --text TEXT [--command CMD] [--error TEXT] [--agent NAME] [--dry-run] (a bug in raea itself, not in your own composition, sent to raea's server with raea's version and the OS, no account needed: words only, paths, emails and keys taken out before it goes; five a day from a machine, the same bug again counted on the first report; --dry-run prints what would go and sends nothing)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--agent` | `NAME` | Who is reporting: the agent or harness's name (claude-code, codex, kimi). Unless said, `RAEA_AGENT`, else the harness raea finds it running under. |
|
||||
| `--command` | `CMD` | The raea command that went wrong, as you ran it (paths in it are taken out). |
|
||||
| `--dry-run` | – | Print exactly what would be sent, raea's version and the OS included, and send nothing. |
|
||||
| `--error` | `TEXT` | What the command printed when it went wrong, up to 4,000 characters (paths, emails and keys taken out). |
|
||||
| `--text` | `TEXT` | What you did, what you expected and what happened instead, up to 4,000 characters. Needed. |
|
||||
|
||||
<!-- generated:end -->
|
||||
|
||||
`raea bug` is how an agent tells raea about a bug it thinks it found in raea itself: a command that fails or hangs, a
|
||||
result that's wrong, or help that says one thing while raea does another. It's for raea's bugs, not the composition
|
||||
you're writing. It works in any shell, headless or in the app, and needs no account.
|
||||
|
||||
The report is words only. raea adds its version and the OS, and takes out paths, emails and anything shaped like a
|
||||
key or token before it leaves the machine; raea's server takes them out again. A machine sends at most five a day,
|
||||
and the same bug sent again (by the same line, numbers and paths aside, on the same version) is counted on the first
|
||||
report instead of being kept twice. `--dry-run` prints exactly what would be sent and sends nothing.
|
||||
|
||||
```sh
|
||||
raea bug "raea render stops at frame 12 with no error" \
|
||||
--text "Rendered compositions/teaser.tsx to mp4; it printed frame 12 of 240 and exited 0 with no file." \
|
||||
--command "raea render compositions/teaser.tsx -o out/teaser.mp4" --error "frame 12/240"
|
||||
```
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "raea clothes"
|
||||
summary: "Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body."
|
||||
order: 104
|
||||
sources: ["engine/cli/src/cli.rs"]
|
||||
---
|
||||
|
||||
Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea clothes [make NAME ["WHAT IT IS"] [--plain] [--set PATH=VALUE,...] [--colour #RRGGBB] | settings | cover NAME --parts PART[:SHARE],... --colour #RRGGBB [--stand MM] [--over UNDER] [--hard [--sole MM] [--sole-colour #RRGGBB] [--panels #RRGGBB,...]] | wear OUT_DIR GARMENT... [--body DIR] [--head HEAD_DIR]] (clothes for SOMA's body from words: make sews a garment: a sewing pattern (GarmentCode, MIT) from the words, or the plain base with --plain, its settings changed by --set PATH=VALUE (settings lists them and what each may be), cut to SOMA's measurements, draped by raea's own cloth and baked, as assets/clothes/NAME.json and its .glb, in --colour or the palette's next; the first make sets up GarmentCode and its Python in raea's models folder; cover makes one by procedure in the same file, no picture: the skin of the parts named (hips, waist, torso, chest, neck, head, upperArm, foreArm, hand, thigh, shin, foot, toes; a limb's SHARE is how far along it from its top), in one colour, MM off the skin (6 unless said), --over a garment already made as the one under it; wear puts garments on a body, innermost first (each GARMENT a name or its .json): OUT_DIR/NAME.glb each, with OUT_DIR/body.glb the body without the skin wholly under cloth; --body DIR another SOMA body folder (a headless one for a head part); --head HEAD_DIR the head that joins it (head.json), whose skin the body's is graded to at the collar; alone, the project's garments. The first use fetches SOMA's body (NVlabs/SOMA-X, Apache-2.0) into raea's models folder and needs Blender: raea setup blender)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--body` | `DIR` | With `wear`: dress this SOMA body folder (body.glb, skeleton.json) instead of SOMA's own, such as a headless body that a generated head joins at the collar. |
|
||||
| `--colour` | `#RRGGBB` | The garment's one colour. With `make` it is optional: one is picked from the name unless said. |
|
||||
| `--hard` | – | With `cover`: footwear, made as a hard piece. Each foot gets its own shape: a rounded last around the foot, so the toes and the foot's small forms go under it. Underneath is a flat sole, and the top over the leg is left open as the collar. It is skinned to the foot like the skin it covers, and it does not swing. |
|
||||
| `--head` | `HEAD_DIR` | With `wear`: the head folder (head.json, head.glb) that joins a headless body at the collar. The body's skin takes the head's neck colour and is graded to the head's own skin just under the collar, so no step of colour shows at the join. |
|
||||
| `--over` | `UNDER` | With `cover`: lay it over one garment made by `cover`, a layer's thickness off it. |
|
||||
| `--panels` | `#RRGGBB,...` | With `cover --hard`: the colours of up to three panels, in this order: a toe cap, a heel, and a band along each side. |
|
||||
| `--parts` | `PART` | With `cover`: the body's parts the garment covers, comma-separated; a limb takes a share, how far along it from its top (`foreArm:0.5` is the half nearest the elbow). |
|
||||
| `--plain` | – | With `make`: start from the plain base (a short-sleeved top) instead of a pattern guessed from words. The default when no words are given. |
|
||||
| `--set` | `PATH=VALUE,...` | With `make`: change settings of the garment's pattern by path, comma-separated (`sleeve.length=0.9,meta.bottom=Pants`). A choice must be one of its options and a number within its range; `raea clothes settings` lists them. |
|
||||
| `--sole` | `MM` | With `cover --hard`: the sole's thickness in millimetres (10 unless said, at most 60). Most of it is painted up the side; the bottom sits at most 8 mm below the bare foot, so the person does not sink into the floor. |
|
||||
| `--sole-colour` | `#RRGGBB` | With `cover --hard`: the sole's colour (an off-white unless said). |
|
||||
| `--stand` | `MM` | With `cover`: how far the cloth stands off the skin, in millimetres (6 unless said). |
|
||||
|
||||
<!-- generated:end -->
|
||||
|
||||
## An outfit
|
||||
|
||||
```sh
|
||||
raea clothes make tee --plain --set shirt.length=1.5 --colour "#e8e2d6"
|
||||
raea clothes make trousers --set meta.upper=none,meta.bottom=Pants,meta.wb=StraightWB,pants.length=0.8 --colour "#2f3b52"
|
||||
raea clothes wear assets/characters/dressed trousers tee
|
||||
```
|
||||
|
||||
`make` sews a garment: a sewing pattern (flat pieces joined by seams) cut to SOMA's measurements, draped on the body by gravity and baked to a skinned glb. It costs nothing and takes about 20 seconds. The pattern comes from the plain base (a short-sleeved top) with `--plain` or when no words are given, and each `--set PATH=VALUE` changes one of its settings; `raea clothes settings` lists them all with what each may be. Given words (`raea clothes make hoodie "a hooded sweatshirt"`), the pattern is the garment model's first guess from them; the command says what it made, and `--set` corrects it.
|
||||
|
||||
The first use sets up what sewing runs on in raea's models folder (`garments/`): GarmentCode's pattern components (MIT) at a fixed commit, a Python 3.11 environment made by `uv`, and SOMA's body as a distance grid for the drape.
|
||||
|
||||
A sewn garment is `assets/clothes/NAME.json` with its files in `assets/clothes/NAME/`: the glb, the design, the flat pattern and four pictures of it on the mannequin. Look at the pictures before you wear it.
|
||||
|
||||
`cover` lays a garment on the skin by procedure, for what is skin-tight; it can't hang free. `wear` writes a body folder with each garment's glb and the body without the skin that is wholly under cloth; with `--head`, the body's skin is graded to the head at the collar.
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "raea godot"
|
||||
summary: "Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project."
|
||||
order: 105
|
||||
order: 107
|
||||
sources: ["apps/engines/src/godot.rs", "apps/engines/src/godot_run.rs"]
|
||||
---
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ The workspace, its projects and what a project holds.
|
||||
| [`raea add`](add.md) | Add, remove and install npm packages for a project, with no Node or npm: raea.lock and node_modules. |
|
||||
| [`raea brand`](brand.md) | Read a brand kit from a website on this machine: colours, fonts and logos into brand/ and BRAND.md. |
|
||||
| [`raea library`](library.md) | Search and manage the person's media libraries in the raea app: folders and drives indexed on this machine, searched by meaning. |
|
||||
| [`raea index`](indexer.md) | Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app. |
|
||||
|
||||
## Check
|
||||
|
||||
@@ -103,12 +104,14 @@ Music read, foley and instruments made on this machine.
|
||||
|
||||
## Generate and 3D tools
|
||||
|
||||
Generated media, physics bakes, Blender and Godot.
|
||||
Generated media, physics bakes, clothes and motion for SOMA's body, Blender and Godot.
|
||||
|
||||
| Verb | What it does |
|
||||
| --- | --- |
|
||||
| [`raea gen`](gen.md) | Generate images, video, music, sound, speech, 3D models and text through made.app, fal, Replicate, OpenRouter, Modal or ComfyUI. |
|
||||
| [`raea physics`](physics.md) | Make the bakes <Physics> and <Goo> play: rigid bodies, soft goo, and parts cut out of a .glb. |
|
||||
| [`raea clothes`](clothes.md) | Clothes for SOMA's body from words: make sews a garment from a sewing pattern (GarmentCode, MIT), cut to SOMA's measurements and draped by raea's own cloth, as assets/clothes/NAME.json and its .glb; cover lays one on the skin by procedure; wear puts garments on a body. |
|
||||
| [`raea motion`](motion.md) | Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads. |
|
||||
| [`raea blender`](blender.md) | Run a Blender Python script headless, with raea's library of mesh scripts: convert, decimate, repair, split, bake, rig, cloth. |
|
||||
| [`raea godot`](godot.md) | Run a TypeScript script against Godot's whole API in a headless Godot with GodotJS, record what it draws as frames, or open the editor on the project. |
|
||||
|
||||
@@ -125,5 +128,6 @@ What an agent reads and shows the person, and the tools raea installs.
|
||||
| [`raea skill`](skill.md) | Print the agent skill this raea ships, matched to its version, or one of its references. |
|
||||
| [`raea skills`](skills.md) | Install raea's agent skill where Claude Code, Codex, Kimi or Gemini read skills, with its MCP server and hook. |
|
||||
| [`raea setup`](setup.md) | Find Blender, or download its current LTS, and install raea's add-on and the MCP add-on. |
|
||||
| [`raea bug`](bug.md) | Report a bug in raea itself to raea's server: a line saying what's wrong and what happened, with raea's version and the OS added, no account needed. |
|
||||
|
||||
<!-- generated:end -->
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "raea index"
|
||||
summary: "Make every picture on a folder or a drive searchable by words, embedded on this Mac's Neural Engine, and keep the index open for the raea app."
|
||||
order: 32
|
||||
sources: ["engine/cli/src/cli.rs"]
|
||||
---
|
||||
|
||||
Make every picture on a folder or a drive searchable by words, on this Mac. `add` lists the folder and embeds each
|
||||
picture's small copy with SigLIP 2 on the Neural Engine, about 170 a second on an M5 Pro, with a counter as it goes;
|
||||
`search` gives the best matches for words; `status` lists the sources; `remove` takes one out; `serve` keeps the index
|
||||
open for the raea app, one JSON ask a line on stdin. Nothing leaves the machine.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea index add FOLDER|photos:... [--json] | raea index search WORDS... [--k N] [--source ID|FOLDER] [--json] | raea index status [--json] | raea index remove ID|FOLDER | raea index serve [--home DIR] (every picture and video on a folder, a drive or Apple Photos (photos:) made searchable by words on this Mac, fast: add lists it and embeds each picture's small copy with SigLIP 2 on the Neural Engine, a counter as it goes, JSON lines with --json; search gives the best for the words; status lists the sources and what each holds; remove takes one out; serve keeps the index open for the raea app, one JSON ask a line on stdin; the index lives in ~/.raea/library/fast, or --home / RAEA_INDEX_HOME)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes any number of arguments besides its flags.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--home` | `DIR` | The index's folder (default ~/.raea/library/fast, or RAEA_INDEX_HOME). |
|
||||
| `--json` | – | Print JSON: progress lines for add, the hits for search, the sources for status. |
|
||||
| `--k` | `N` | How many hits search gives (10 by default). |
|
||||
| `--source` | `ID\|FOLDER` | Search only one source, by its id or the folder that was added. |
|
||||
|
||||
<!-- generated:end -->
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "raea motion"
|
||||
summary: "Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads."
|
||||
order: 105
|
||||
sources: ["engine/cli/src/cli.rs"]
|
||||
---
|
||||
|
||||
Body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea motion "LINE" [--keys KEYS.json] [--seconds 5 | --frames N] [--seed 1] [--steps 100] [-o CLIP.json] (body motion made on this Mac by Kimodo (NVIDIA, on MLX): a SOMA clip from a line of words and, with --keys, Kimodo constraints (full-body keyframes, hand or foot targets, a root path, as sdk/body/tools/between.ts writes them), as the clip sdk/body/tools/fromkimodo.ts reads; the first use fetches the motion model (1.1 GB) into raea's models folder, and the first new line its text encoder (8.8 GB: Llama 3 8B in 8 bits with LLM2Vec's adapters); a line's words are read once and kept. Licences: Kimodo's weights NVIDIA's Open Model License, Meta Llama 3 the Meta Llama 3 Community License, LLM2Vec's adapters MIT)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes up to 1 argument besides its flags.
|
||||
|
||||
## Flags
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--frames` | `N` | The clip's length in frames at 30 a second, 2 to 600. Instead of `--seconds`. |
|
||||
| `--keys` | `KEYS.json` | Kimodo constraints the motion must meet: full-body keyframes, a hand or foot at a place on a frame, a path for the hips. `bun sdk/body/tools/between.ts` writes them between two poses of the body library. |
|
||||
| `--seconds` | `5` | The clip's length in seconds (5 unless said). |
|
||||
| `--seed` | `1` | Which of the motions the line could be: another seed is another take of the same line. A seed here is not that seed on Kimodo's PyTorch code (the noise is drawn differently). |
|
||||
| `--steps` | `100` | Denoising steps (Kimodo's 100). Fewer is faster and rougher. |
|
||||
| `-o` | `CLIP.json` | Where the clip goes: `{fps, names, root, turns, contacts, ...}`, Kimodo's 77 SOMA joints as each one's turn in the world from the T-pose. Without it, the line's words name the file in the working folder. |
|
||||
|
||||
<!-- generated:end -->
|
||||
|
||||
## Example
|
||||
|
||||
A stage's `do` line made into a clip: the body stands at the start and the end, and the motion between comes from the
|
||||
words.
|
||||
|
||||
```sh
|
||||
bun sdk/body/tools/between.ts skeleton.json LIBDIR aMale2_A1_Stand:0 aMale2_A1_Stand:0 stand.json 4 0,0 0
|
||||
raea motion "A person waves at the camera with their right hand" --keys stand.json --seconds 4 --seed 2 -o wave.clip.json
|
||||
```
|
||||
|
||||
A clip takes about 8 seconds on an M5 Pro. `bun sdk/body/tools/makedo.ts` does the whole of it for a stage's lines:
|
||||
three seeds a line, each checked against the captures the body hands on to, and the one that does the most kept in the
|
||||
project's made clips.
|
||||
@@ -12,9 +12,15 @@ with [`raea setup-audio`](setup-audio.md)).
|
||||
|
||||
```sh
|
||||
raea sao "a heavy wooden door creaks open" --seconds 3 -o door.wav
|
||||
raea sao "rain on a tin roof" --seconds 8 --seed 4
|
||||
raea sao "rain on a tin roof" --seconds 8 --seed 4 -o media/sfx/rain-4.wav
|
||||
```
|
||||
|
||||
A take is up to 11.9 s long; a longer `--seconds` comes back that long. Another `--seed` is another take of the same
|
||||
prompt: `sao()` in a composition has no seed, so play a seed's take from its file (`staticFile("sfx/rain-4.wav")`).
|
||||
Stable Audio Open Small does better on effects and field recordings than on music, so build an effect from short
|
||||
layers (a transient, a body, a tail) and write music as notes on instruments (`raea guide music`). Its licence is
|
||||
Stability AI's Community License: [`raea setup-audio`](setup-audio.md) says what that means.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -14,6 +14,35 @@ raea setup-audio --check
|
||||
raea setup-audio tokensynth
|
||||
```
|
||||
|
||||
Each model's script (`share/raea/tools/sao/setup.sh` and `share/raea/tools/tokensynth/setup.sh` beside an installed
|
||||
raea) installs it into `~/.cache/raea-sao` or `~/.cache/raea-tokensynth` (`RAEA_SAO` and `RAEA_TOKENSYNTH` move them):
|
||||
|
||||
- **SAO, about 2 GB:** Stable Audio Open Small's Core ML models from a Hugging Face mirror at a pinned revision, each
|
||||
file checked against its SHA-256, t5-base's tokenizer, a small Python environment, and a T5 encoder converted once.
|
||||
Its licence is Stability AI's Community License
|
||||
([stability.ai/community-license-agreement](https://stability.ai/community-license-agreement)), not an open one.
|
||||
As between you and Stability, you own the sounds it makes, as far as the law allows; they may not be used to
|
||||
create or improve another generative AI model, and Stability's acceptable use policy applies to them. What else
|
||||
the licence asks, of raea and of a commercial user, raea hasn't written down yet: read it before an SAO sound goes
|
||||
into a commercial piece.
|
||||
- **TokenSynth, about 6 GB:** its code from GitHub, a Python environment with torch, and its weights, DAC and CLAP
|
||||
from Hugging Face, then a converted fp16 runtime. MIT.
|
||||
|
||||
Both need a network connection and [uv](https://docs.astral.sh/uv/) on the PATH; TokenSynth also needs `git`. On a
|
||||
Mac without them, `share/raea/tools/ensure.sh uv` and `ensure.sh git` install raea's pinned builds (uv 0.12.24 and
|
||||
git 2.56.0, each download checked against its SHA-256) and print where; put those folders on the PATH:
|
||||
|
||||
```sh
|
||||
B=$(dirname "$(realpath "$(command -v raea)")"); T=$B/../share/raea/tools; [ -d "$T" ] || T=$B/../../tools # an install, or a checkout
|
||||
PATH="$(dirname "$(bash "$T/ensure.sh" uv)"):$(dirname "$(bash "$T/ensure.sh" git)"):$PATH" raea setup-audio
|
||||
```
|
||||
|
||||
When a setup fails, the error names its script: run that with `sh` to see why. Exit status 127 is uv not found; 1
|
||||
with `xcrun: error: invalid active developer path` is macOS's stand-in git on a Mac without the Command Line Tools
|
||||
(use the git `ensure.sh` installs); 75 is another setup running in the same folder. `RAEA_OFFLINE` refuses the
|
||||
download. `RAEA_AUDIO_AUTOSETUP=0` stops a render from installing a model itself, and stops `raea setup-audio` and
|
||||
`ensure.sh` too: with it set, run the model's script yourself (`sh share/raea/tools/sao/setup.sh`).
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -23,7 +23,7 @@ raea skill --reference sdk
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is)
|
||||
raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini|grokbot [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is; grokbot, the Grok Bot app, keeps its skills on its own computer, so its copy is staged on this Mac (RAEA_GROKBOT_HOME moves it) with the grokbot:// links that finish it in Grok Bot, and gets no hooks or MCP server)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes up to 1 argument besides its flags.
|
||||
@@ -32,7 +32,7 @@ Headless: it needs nothing running and opens no window. Takes up to 1 argument b
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--agent` | `claude\|codex\|kimi\|gemini` | Used by `skills install`; see [`raea skills`](skills.md). |
|
||||
| `--agent` | `claude\|codex\|kimi\|gemini\|grokbot` | Used by `skills install`; see [`raea skills`](skills.md). |
|
||||
| `--no-hooks` | – | Used by `skills install`; see [`raea skills`](skills.md). |
|
||||
| `--no-mcp` | – | Used by `skills install`; see [`raea skills`](skills.md). |
|
||||
| `--pin` | `MOVE` | Used by `skills install`; see [`raea skills`](skills.md). |
|
||||
|
||||
@@ -26,7 +26,7 @@ raea skills install --agent claude --pin quieter --pin bolder # /quieter and
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is)
|
||||
raea skill [NAME] [--reference cli|feed|files|sdk] | raea skills install --agent claude|codex|kimi|gemini|grokbot [--pin MOVE]... [--no-mcp] [--no-hooks] (the agent skill this raea ships, for its version, which raea --version prints: an agent whose copy names another version reads this; install puts raea's skills where that agent reads skills, adds the blender MCP server unless --no-mcp, makes each --pin MOVE a /MOVE of its own, and adds raea's hooks to that agent unless --no-hooks (raea hook AGENT: media opened in the Mac's viewer goes to raea show, and the quick check after a composition is saved); a skill folder that's a link is left as it is; grokbot, the Grok Bot app, keeps its skills on its own computer, so its copy is staged on this Mac (RAEA_GROKBOT_HOME moves it) with the grokbot:// links that finish it in Grok Bot, and gets no hooks or MCP server)
|
||||
```
|
||||
|
||||
Headless: it needs nothing running and opens no window. Takes up to 1 argument besides its flags.
|
||||
@@ -35,7 +35,7 @@ Headless: it needs nothing running and opens no window. Takes up to 1 argument b
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--agent` | `claude\|codex\|kimi\|gemini` | Which agent to install for. |
|
||||
| `--agent` | `claude\|codex\|kimi\|gemini\|grokbot` | Which agent to install for. |
|
||||
| `--no-hooks` | – | Leave Claude Code's settings alone: don't add the quick-check hook. |
|
||||
| `--no-mcp` | – | Don't add the Blender MCP server to the agent. |
|
||||
| `--pin` | `MOVE` | Install a note's guide as a skill of its own, so `/MOVE` loads just it (`quieter`, `bolder`, `layout`, `adapt` and the rest). Repeatable. |
|
||||
|
||||
@@ -11,10 +11,16 @@ Tone.js `Sampler`. For a pitched instrument it takes one sample per note, at the
|
||||
|
||||
```sh
|
||||
raea sounds piano
|
||||
raea sounds get vcsl/upright-piano --notes C2,C3,C4,C5 -o media/piano/
|
||||
raea sounds get vcsl/bass-drum --all
|
||||
raea sounds get vcsl/upright-piano-knight --notes C2,C3,C4,C5 -o media/piano/
|
||||
raea sounds get vcsl/bass-drum-1 --all
|
||||
```
|
||||
|
||||
The ids are exact: `raea sounds kick` lists the kicks by their ids (`vcsl/bass-drum-1`, `-2`, `-3-legacy`). A drum or a
|
||||
hit comes as its first 12 takes unless `--all` is given. The four libraries are Salamander's grand piano, FluidR3's
|
||||
General MIDI set and tonejs-instruments (all three CC-BY 3.0: credit them), and the Versilian Community Sample Library
|
||||
(CC0). Larger libraries, effect packs and MIDI grooves are fetched by hand: `raea guide sources` lists them with
|
||||
their licences and the command that fetches each.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
@@ -29,7 +35,7 @@ Headless: it needs nothing running and opens no window. Takes up to 2 arguments
|
||||
|
||||
| Flag | Takes | What it does |
|
||||
| --- | --- | --- |
|
||||
| `--all` | – | Fetch every sample the instrument has: every note, dynamic and round robin. |
|
||||
| `--all` | – | Fetch every sample: a pitched instrument's every sampled note (still one take a note, at the middle dynamic), a drum's every take. |
|
||||
| `--notes` | `..\|--all` | Fetch only these notes, comma-separated (`C2,C4`). |
|
||||
| `-o` | `DIR` | The folder the samples go to. |
|
||||
|
||||
|
||||
@@ -11,9 +11,13 @@ writes one file per note: a sample set for a Sampler. Like `raea sao`, it shares
|
||||
|
||||
```sh
|
||||
raea tokensynth "warm analog bass" --notes C1,C2,C3 -o media/bass/
|
||||
raea tokensynth "glassy bell pad" --seconds 4 --velocity 80
|
||||
raea tokensynth "a bowed saw, close, eerie" --notes C3,E3,G#3,C4 --seconds 4 --velocity 80 --seed 7
|
||||
```
|
||||
|
||||
Use it for a timbre no recorded library has ([`raea sounds`](sounds.md) first for a piano, strings or drums). A take
|
||||
can miss its pitch or come out as hiss, so make a few seeds of each root and keep the ones that pass
|
||||
(`raea guide music`, "Instruments from TokenSynth"). A note is held under 5 s.
|
||||
|
||||
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -178,8 +178,6 @@ A compute over the frame, in the 3D beside the camera; several run in the order
|
||||
|
||||
Rust: `raea_sys_compute::Computes`.
|
||||
|
||||
Takes [`ComputeProps`](#computeprops)'s props.
|
||||
|
||||
Used in: [shader/compute_shader_game_of_life](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/shader/compute_shader_game_of_life.tsx), [shader_advanced/compute_mesh](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/shader_advanced/compute_mesh.tsx).
|
||||
|
||||
### `Cone`
|
||||
@@ -290,6 +288,7 @@ Used in: [ui/widgets/viewport_node](https://github.com/shinyobjectz/raea/blob/ma
|
||||
Light from all around, out of a panorama: soft light from the sky and reflections of it in every glossy or metal
|
||||
surface (image-based lighting), and with `background` the panorama as the sky. Put it inside the Canvas3D, once a
|
||||
frame; its src, intensity, rotation and background may change from frame to frame (a cut from a hall to a street).
|
||||
With `room` in place of a panorama it is three.js's RoomEnvironment, soft studio light with no file.
|
||||
Bevy's EnvironmentMapLight with maps already filtered is <EnvironmentMapLight>.
|
||||
Its panorama is filtered by Bevy's generator and, with `background`, drawn as the sky (engine/render
|
||||
environment.rs):
|
||||
@@ -1357,6 +1356,7 @@ as bevy_light's ShadowFilteringMethod or bevy_pbr's ScreenSpaceReflections), app
|
||||
| `threshold` | `number` | only what's brighter than this glows (0 = everything a little; 1 = only emissive parts and highlights) |
|
||||
| `skip` | `string[]` | composition passes (a part's `pass`) left out of it: they neither glow nor take the glow |
|
||||
| `passes` | `Record<string, number>` | each named pass's share of it, 0 (as skip) to 1 (all of it, as "scene" has) |
|
||||
| `additive` | `boolean` | the glow added on top of the frame, brightening it, as three.js's and postprocessing's bloom do; by default it takes its light from around the bright parts (Bevy's energy-conserving bloom) |
|
||||
|
||||
### `BodyProps`
|
||||
|
||||
@@ -1379,6 +1379,7 @@ The props of [`Body`](#body), tabled there.
|
||||
| `uvs` | `number[]` | u, v of each vertex (without them a picture map is projected onto the mesh's bounds) |
|
||||
| `colors` | `number[] \| string[]` | each vertex's colour: r, g, b, a (linear, 0 to 1) per vertex, or one "#rrggbb" per vertex; the material's colour is multiplied by it (Bevy's ATTRIBUTE_COLOR), so leave the material white to see them as given |
|
||||
| `attributes` | `Record<string, { size: number; values: number[] }>` | a mesh's own attributes beyond those, for a three.js shader that reads them (<ThreeShaderMaterial>): each one's size (1 to 4 numbers a vertex) and values, per vertex |
|
||||
| `copies` | `{ count: number; attributes?: Record<string, { size: number; values: number[] }>; matri…` | the mesh repeated `count` times as one, for a three.js node material drawn as copies: each copy's number is its own attribute `tsl_copy`, each of `attributes` (size numbers a copy) is on every vertex of its copy, and `matrices` (16 numbers a copy, column-major) place the copies (none: each where the mesh is) |
|
||||
|
||||
### `Canvas3DProps`
|
||||
|
||||
@@ -1522,7 +1523,9 @@ The props of [`Entity`](#entity), tabled there.
|
||||
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `src` (required) | `string` | an equirectangular panorama in the media folder: a Radiance.hdr (Poly Haven's), an OpenEXR.exr, or an 8-bit.png/.jpg. Change it between frames to cut from one place to another |
|
||||
| `src` | `string` | an equirectangular panorama in the media folder: a Radiance.hdr (Poly Haven's), an OpenEXR.exr, or an 8-bit.png/.jpg. Change it between frames to cut from one place to another. Give it or `room`, not both |
|
||||
| `room` | `boolean` | three.js's RoomEnvironment in place of a panorama: a white studio room with soft light boxes, made by raea with no file. It is the light a three.js scene gets from PMREMGenerator.fromScene(new RoomEnvironment(), blur), which <R3F> turns into this |
|
||||
| `blur` | `number` | with `room`, its blur in radians before it lights (fromScene's sigma: three's examples use 0.04); 0 by default |
|
||||
| `intensity` | `number` | how strongly it lights the scene (1 by default: a sky about as bright as an AmbientLight of 2.5 overall); animate it, or set 0 to switch it off for a shot |
|
||||
| `rotation` | `number` | a turn about the vertical axis, in radians, for both the light and the sky: puts the sun where the shot wants it |
|
||||
| `background` | `boolean` | draw the panorama as the sky behind everything (off by default: light only) |
|
||||
@@ -1729,6 +1732,7 @@ The props of [`Goo`](#goo), tabled there.
|
||||
| `temperature` | `number` | warmer (+) or cooler (-): a shift of the CIE x chromaticity, about -0.3 to 0.3 |
|
||||
| `tint` | `number` | magenta (+) or green (-) |
|
||||
| `saturation` | `number` | the whole frame's saturation after tone mapping (1 keeps it) |
|
||||
| `exposure` | `number` | stops of exposure on every pixel just before tone mapping, unlit colours and emission included (0 keeps it): <ToneMapping exposure> is the camera's, which brightens only what lights shade |
|
||||
| `shadows` | `GradeSection` | the grade on the shadows: saturation, contrast, gamma, gain, lift |
|
||||
| `midtones` | `GradeSection` | the grade on the midtones |
|
||||
| `highlights` | `GradeSection` | the grade on the highlights |
|
||||
@@ -1808,6 +1812,7 @@ copy together). Rotation in radians, XYZ order, as everywhere.
|
||||
| `position` (required) | `Vec3` | where this copy stands, metres, in the Instances' space |
|
||||
| `rotation` | `Vec3` | its rotation, Euler angles in radians (x, y, z) |
|
||||
| `scale` | `number \| Vec3` | its scale: one number, or x, y and z |
|
||||
| `color` | `string \| Vec3` | this copy's colour, multiplied with the material's (as three's instanceColor): "#rrggbb", or linear [r, g, b]. When any copy has one, a copy without is white |
|
||||
|
||||
### `InstancesProps`
|
||||
|
||||
@@ -2279,7 +2284,7 @@ The props of [`Screen`](#screen), tabled there.
|
||||
| `background` | `string` | behind the picture ("#000000"). A see-through one ("#ffffff00", "transparent", rgba(..., 0.5)) makes the screen see-through where its page paints nothing, so what's behind it in the scene shows (a flat screen: a layer of a page pulled apart in 3D); an opaque one keeps the screen opaque, which writes depth for DepthOfField |
|
||||
| `brightness` | `number` | a flat screen's (`crt={false}`) light: 1, the default, draws its page at the page's own colours, unlit (scene lights don't touch it); above 1 it glows, and blooms under a <Bloom>. A tone curve on the camera bends it like the rest of the frame: give the scene <ToneMapping mode="none" /> to keep the page's colours exact. A CRT's is `crt.brightness` |
|
||||
| `src` | `string` | a video to show instead of children: staticFile("clip.mp4"), filling the picture |
|
||||
| `app` | `string` | an app to show instead of children: a module's path from the composition's folder ("chat.tsx"), its default export a React component given {width, height}. It runs on real react-dom in a document of its own, so npm's React libraries work on it (assistant-ui, Radix; installed with `raea add`). In play the pointer reaches it through the 3D, where it lands on the picture, and a press on it gives it the keys (the game doesn't get them) until a press elsewhere or Escape; in a render it runs on the frame's clock, so the render repeats |
|
||||
| `app` | `string` | an app to show instead of children: a module's path from the composition's folder ("chat.tsx"), its default export a React component given {width, height}. It runs on react-dom (@raea/ui's) in a Blitz document of its own, so npm's React libraries work on it (assistant-ui, Radix; installed with `raea add`). In play the pointer reaches it through the 3D, where it lands on the picture, and a press on it gives it the keys (the game doesn't get them) until a press elsewhere or Escape; in a render it runs on the frame's clock, so the render repeats |
|
||||
| `children` | `ReactNode` | the nested composition or game |
|
||||
|
||||
### `Section`
|
||||
@@ -2541,7 +2546,7 @@ from the first frame.
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `glsl` | `{ vertex: string; fragment: string; raw?: boolean; vertexColors?: boolean }` | a ShaderMaterial's GLSL, its `#include`s expanded and its `defines` as #define lines in front; `raw` for a RawShaderMaterial (which declares three's built-ins itself), `vertexColors` as the material's |
|
||||
| `wgsl` | `{ vertex: string; fragment: string; uniforms?: { name: string; type: string; array?: nu…` | a node material's WGSL, as three's TSL builder writes it for raea (sdk/r3f's input/tsl.ts): the contract's `three_vertex` and `three_fragment`, its uniforms' types, the mesh attributes it reads beyond the standard four |
|
||||
| `wgsl` | `{ vertex: string; fragment: string; uniforms?: { name: string; type: string; array?: nu…` | a node material's WGSL, as three's TSL builder writes it for raea (sdk/r3f's input/tsl.ts): the contract's `three_vertex` and `three_fragment`, its uniforms' types, the mesh attributes it reads beyond the standard four, whether it is a lit surface (three_surface), and the storage buffers it reads (`tsl_s0`, `tsl_s1`: each a buffer a <Compute>'s kernels share by key, its size in bytes and first contents) |
|
||||
| `uniforms` | `Record<string, ThreeUniform>` | each uniform's value this frame |
|
||||
| `textures` | `Record<string, string \| { src: string; colorSpace?: "srgb" \| "linear"; sampler?: Record…` | each sampler's picture: a file, a data URL, "render:NAME" (at most four); `colorSpace: "linear"` for one three samples raw (NoColorSpace: a distance field, a data map), "srgb" (the default) for a colour picture |
|
||||
| `output` | `"display" \| "linear"` | "display": its colour is what three's canvas shows (a ShaderMaterial's); "linear": scene light, tone-mapped as the rest of the frame is (a node material's) |
|
||||
|
||||
@@ -247,6 +247,7 @@ a split, a cut word or a moved span is a change to this list; the length becomes
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `segments` | `readonly (readonly [number, number])[]` | the composition's own frame ranges, [from, to), played one after another |
|
||||
| `scale` | `number` | the composition drawn at this fraction of its size (above 0, at most 1), what is where kept: it is laid out at its width and height (useVideoConfig still says them) and the whole drawn smaller, so a 3D view traces fewer pixels. A draft's, where a smaller picture changes nothing that ships: the app's composition drafts and a scene's kept frames draw at 0.5 |
|
||||
|
||||
### `OpenOptions`
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import { Audio, Mix } from "raea/audio";
|
||||
function Soundtrack() {
|
||||
return (
|
||||
<Mix lufs={-14} ceiling={-1}>
|
||||
<Audio src={staticFile("media/voice.wav")} bus="voice" />
|
||||
<Audio src={staticFile("media/bed.m4a")} bus="music" gainDb={-12} fadeOut={1.5} />
|
||||
<Audio src={staticFile("voice.wav")} bus="voice" />
|
||||
<Audio src={staticFile("rain.m4a")} bus="ambience" gainDb={-18} fadeOut={1.5} />
|
||||
</Mix>
|
||||
);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ Sound in step with the frame; no picture. A muted or ended Audio is silent.
|
||||
|
||||
| Prop | Type | What it does |
|
||||
| --- | --- | --- |
|
||||
| `src` (required) | `string \| GeneratedAsset` | a file URL, or a generated asset from lyria() or sao() |
|
||||
| `src` (required) | `string \| GeneratedAsset` | a file URL (staticFile), or a generated sound from sao() |
|
||||
|
||||
Also takes the props of [`MediaProps`](video.md#mediaprops).
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -31,7 +31,7 @@ The composition, the app, and the specs and notes an agent writes.
|
||||
|
||||
| Import | What it's for | Exports |
|
||||
| --- | --- | --- |
|
||||
| [`raea`](raea.md) | The main entry: compositions, sequences, time, interpolation, springs, footage, sound and words. | 18 components, 8 hooks, 55 functions, 9 values, 91 types |
|
||||
| [`raea`](raea.md) | The main entry: compositions, sequences, time, interpolation, springs, footage, sound and words. | 20 components, 8 hooks, 62 functions, 11 values, 98 types |
|
||||
| [`raea/app`](app.md) | The App, its plugins and schedules, and the registry a video's compositions are kept in. | 1 component, 4 functions, 3 classes, 17 values, 8 types |
|
||||
| [`raea/brief`](brief.md) | The specs an agent writes as data: brief, script, taste, plan and controller, checked against raea's schemas. | 6 functions, 32 types |
|
||||
| [`raea/note`](note.md) | A person's note as a file in the project: their words kept as written, and the asks the agent restates it as. | 1 function, 4 types |
|
||||
@@ -51,16 +51,17 @@ Frames, animation, springs, states and input, and holding a frame until it's rea
|
||||
|
||||
## Video, sound and text
|
||||
|
||||
Footage, pictures, sound, words and colour.
|
||||
Footage, pictures, sound, words and colour, and the timeline they are edited on.
|
||||
|
||||
| Import | What it's for | Exports |
|
||||
| --- | --- | --- |
|
||||
| [`raea/video`](video.md) | Footage and time-shifted sequences: Video, Sequence, Series, Loop and Freeze. | 5 components, 7 types |
|
||||
| [`raea/video`](video.md) | Footage and time-shifted sequences: Video, Sequence, Series, Loop and Freeze. | 5 components, 8 types |
|
||||
| [`raea/audio`](audio.md) | Sound: Audio, the master Mix, speech, sound in 3D space, and a song's energy map. | 6 components, 1 hook, 7 functions, 1 value, 25 types |
|
||||
| [`raea/text`](text.md) | Text in the 3D world, fonts, and time anchored to the words said. | 3 components, 1 hook, 3 functions, 6 types |
|
||||
| [`raea/image`](image.md) | Pictures on the page and in the world, and texture atlases packed from them. | 3 components, 1 class, 5 types |
|
||||
| [`raea/asset`](asset.md) | Files the project holds and assets made for it: staticFile, generated sound and music, and glTF bytes. | 9 functions, 1 value, 8 types |
|
||||
| [`raea/color`](color.md) | Bevy's colour types: Srgba, LinearRgba, Hsla, Oklab, Oklch and the rest, with their conversions. | 2 functions, 7 classes |
|
||||
| [`raea/editor`](editor.md) | The timeline the feed edits a film, a scene or a sound on, as data: tracks, clips, keys and markers, every edit an operation with its inverse, a film's scenes read in (fromRender) and its cut read back out as segments (segmentsOf). No React and no DOM: an agent's script, the app's host and a test use the same model the app's timeline does. | 63 functions, 28 values, 45 types |
|
||||
|
||||
## 3D
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ Used in: [ui/render_ui_to_texture](https://github.com/shinyobjectz/raea/blob/mai
|
||||
Light from all around, out of a panorama: soft light from the sky and reflections of it in every glossy or metal
|
||||
surface (image-based lighting), and with `background` the panorama as the sky. Put it inside the Canvas3D, once a
|
||||
frame; its src, intensity, rotation and background may change from frame to frame (a cut from a hall to a street).
|
||||
With `room` in place of a panorama it is three.js's RoomEnvironment, soft studio light with no file.
|
||||
Bevy's EnvironmentMapLight with maps already filtered is <EnvironmentMapLight>.
|
||||
Its panorama is filtered by Bevy's generator and, with `background`, drawn as the sky (engine/render
|
||||
environment.rs):
|
||||
@@ -384,7 +385,9 @@ The props of [`DirectionalLight`](#directionallight), tabled there.
|
||||
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `src` (required) | `string` | an equirectangular panorama in the media folder: a Radiance.hdr (Poly Haven's), an OpenEXR.exr, or an 8-bit.png/.jpg. Change it between frames to cut from one place to another |
|
||||
| `src` | `string` | an equirectangular panorama in the media folder: a Radiance.hdr (Poly Haven's), an OpenEXR.exr, or an 8-bit.png/.jpg. Change it between frames to cut from one place to another. Give it or `room`, not both |
|
||||
| `room` | `boolean` | three.js's RoomEnvironment in place of a panorama: a white studio room with soft light boxes, made by raea with no file. It is the light a three.js scene gets from PMREMGenerator.fromScene(new RoomEnvironment(), blur), which <R3F> turns into this |
|
||||
| `blur` | `number` | with `room`, its blur in radians before it lights (fromScene's sigma: three's examples use 0.04); 0 by default |
|
||||
| `intensity` | `number` | how strongly it lights the scene (1 by default: a sky about as bright as an AmbientLight of 2.5 overall); animate it, or set 0 to switch it off for a shot |
|
||||
| `rotation` | `number` | a turn about the vertical axis, in radians, for both the light and the sky: puts the sun where the shot wants it |
|
||||
| `background` | `boolean` | draw the panorama as the sky behind everything (off by default: light only) |
|
||||
|
||||
@@ -316,6 +316,7 @@ type Animate3d = Record<string, TrackSpec | TrackSpec[] | Keys> | Move
|
||||
| `uvs` | `number[]` | u, v of each vertex (without them a picture map is projected onto the mesh's bounds) |
|
||||
| `colors` | `number[] \| string[]` | each vertex's colour: r, g, b, a (linear, 0 to 1) per vertex, or one "#rrggbb" per vertex; the material's colour is multiplied by it (Bevy's ATTRIBUTE_COLOR), so leave the material white to see them as given |
|
||||
| `attributes` | `Record<string, { size: number; values: number[] }>` | a mesh's own attributes beyond those, for a three.js shader that reads them (<ThreeShaderMaterial>): each one's size (1 to 4 numbers a vertex) and values, per vertex |
|
||||
| `copies` | `{ count: number; attributes?: Record<string, { size: number; values: number[] }>; matri…` | the mesh repeated `count` times as one, for a three.js node material drawn as copies: each copy's number is its own attribute `tsl_copy`, each of `attributes` (size numbers a copy) is on every vertex of its copy, and `matrices` (16 numbers a copy, column-major) place the copies (none: each where the mesh is) |
|
||||
|
||||
### `Capsule3dProps`
|
||||
|
||||
@@ -381,6 +382,7 @@ copy together). Rotation in radians, XYZ order, as everywhere.
|
||||
| `position` (required) | `Vec3` | where this copy stands, metres, in the Instances' space |
|
||||
| `rotation` | `Vec3` | its rotation, Euler angles in radians (x, y, z) |
|
||||
| `scale` | `number \| Vec3` | its scale: one number, or x, y and z |
|
||||
| `color` | `string \| Vec3` | this copy's colour, multiplied with the material's (as three's instanceColor): "#rrggbb", or linear [r, g, b]. When any copy has one, a copy without is white |
|
||||
|
||||
### `InstancesProps`
|
||||
|
||||
@@ -423,8 +425,8 @@ copy together). Rotation in radians, XYZ order, as everywhere.
|
||||
| `onPointerOver` | `(e: Event3d) => void` | the pointer came over the part (bubbles, as the DOM's) |
|
||||
| `onPointerOut` | `(e: Event3d) => void` | the pointer left the part (bubbles) |
|
||||
| `onWheel` | `(e: Event3d) => void` | the wheel turned over the part (`deltaX`, `deltaY`) |
|
||||
| `quat` | `Quat` | Bevy's rotation as it is, a quaternion [x, y, z, w] in Bevy's axes (y up, z toward the viewer), in place of `rotation`: a turn out of the frame's plane too, as a Sprite's Transform takes it (camera/2d_on_ui) |
|
||||
| `opacity` | `number` | 0 to 1 (1 by default) |
|
||||
| `quat` | `Quat` | Bevy's rotation as it is, a quaternion [x, y, z, w] in Bevy's axes (y up, z toward the viewer), in place of `rotation`: a turn out of the frame's plane too, as a Sprite's Transform takes it (camera/2d_on_ui) |
|
||||
|
||||
### `Mesh3dProps`
|
||||
|
||||
|
||||
@@ -626,7 +626,7 @@ from the first frame.
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `glsl` | `{ vertex: string; fragment: string; raw?: boolean; vertexColors?: boolean }` | a ShaderMaterial's GLSL, its `#include`s expanded and its `defines` as #define lines in front; `raw` for a RawShaderMaterial (which declares three's built-ins itself), `vertexColors` as the material's |
|
||||
| `wgsl` | `{ vertex: string; fragment: string; uniforms?: { name: string; type: string; array?: nu…` | a node material's WGSL, as three's TSL builder writes it for raea (sdk/r3f's input/tsl.ts): the contract's `three_vertex` and `three_fragment`, its uniforms' types, the mesh attributes it reads beyond the standard four |
|
||||
| `wgsl` | `{ vertex: string; fragment: string; uniforms?: { name: string; type: string; array?: nu…` | a node material's WGSL, as three's TSL builder writes it for raea (sdk/r3f's input/tsl.ts): the contract's `three_vertex` and `three_fragment`, its uniforms' types, the mesh attributes it reads beyond the standard four, whether it is a lit surface (three_surface), and the storage buffers it reads (`tsl_s0`, `tsl_s1`: each a buffer a <Compute>'s kernels share by key, its size in bytes and first contents) |
|
||||
| `uniforms` | `Record<string, ThreeUniform>` | each uniform's value this frame |
|
||||
| `textures` | `Record<string, string \| { src: string; colorSpace?: "srgb" \| "linear"; sampler?: Record…` | each sampler's picture: a file, a data URL, "render:NAME" (at most four); `colorSpace: "linear"` for one three samples raw (NoColorSpace: a distance field, a data map), "srgb" (the default) for a colour picture |
|
||||
| `output` | `"display" \| "linear"` | "display": its colour is what three's canvas shows (a ShaderMaterial's); "linear": scene light, tone-mapped as the rest of the frame is (a node material's) |
|
||||
|
||||
@@ -55,8 +55,6 @@ A compute over the frame, in the 3D beside the camera; several run in the order
|
||||
|
||||
Rust: `raea_sys_compute::Computes`.
|
||||
|
||||
Takes [`ComputeProps`](3d.md#computeprops)'s props.
|
||||
|
||||
### `DepthOfField`
|
||||
|
||||
A lens's depth of field: what's nearer or farther than the camera's `focus` blurs. Put it inside the Canvas3D;
|
||||
@@ -152,6 +150,7 @@ Takes [`ToneMappingProps`](3d.md#tonemappingprops)'s props.
|
||||
| `threshold` | `number` | only what's brighter than this glows (0 = everything a little; 1 = only emissive parts and highlights) |
|
||||
| `skip` | `string[]` | composition passes (a part's `pass`) left out of it: they neither glow nor take the glow |
|
||||
| `passes` | `Record<string, number>` | each named pass's share of it, 0 (as skip) to 1 (all of it, as "scene" has) |
|
||||
| `additive` | `boolean` | the glow added on top of the frame, brightening it, as three.js's and postprocessing's bloom do; by default it takes its light from around the bright parts (Bevy's energy-conserving bloom) |
|
||||
|
||||
### `ComputeProps`
|
||||
|
||||
@@ -221,6 +220,7 @@ A shader over the whole frame. Its source defines
|
||||
| `temperature` | `number` | warmer (+) or cooler (-): a shift of the CIE x chromaticity, about -0.3 to 0.3 |
|
||||
| `tint` | `number` | magenta (+) or green (-) |
|
||||
| `saturation` | `number` | the whole frame's saturation after tone mapping (1 keeps it) |
|
||||
| `exposure` | `number` | stops of exposure on every pixel just before tone mapping, unlit colours and emission included (0 keeps it): <ToneMapping exposure> is the camera's, which brightens only what lights shade |
|
||||
| `shadows` | `GradeSection` | the grade on the shadows: saturation, contrast, gamma, gain, lift |
|
||||
| `midtones` | `GradeSection` | the grade on the midtones |
|
||||
| `highlights` | `GradeSection` | the grade on the highlights |
|
||||
|
||||
@@ -38,7 +38,7 @@ See [Your first video](../../start/first-video.md) for the whole loop, and
|
||||
import { AbsoluteFill, ACTION_KEY, actionsIn, Animate } from "raea"
|
||||
```
|
||||
|
||||
`raea` exports 18 components, 8 hooks, 55 functions, 9 values, 91 types. Source: [sdk/raea/src/index.tsx](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/index.tsx).
|
||||
`raea` exports 20 components, 8 hooks, 62 functions, 11 values, 98 types. Source: [sdk/raea/src/index.tsx](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/index.tsx).
|
||||
|
||||
## Components
|
||||
|
||||
@@ -52,7 +52,7 @@ A box over the whole of its parent, laid out as a flex column; `style` is merged
|
||||
| `className` | `string` | Tailwind or CSS classes |
|
||||
| `children` | `ReactNode` | what fills it |
|
||||
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 98 more.
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 99 more.
|
||||
|
||||
### `Animate`
|
||||
|
||||
@@ -69,7 +69,7 @@ Sound in step with the frame; no picture. A muted or ended Audio is silent.
|
||||
|
||||
| Prop | Type | What it does |
|
||||
| --- | --- | --- |
|
||||
| `src` (required) | `string \| GeneratedAsset` | a file URL, or a generated asset from lyria() or sao() |
|
||||
| `src` (required) | `string \| GeneratedAsset` | a file URL (staticFile), or a generated sound from sao() |
|
||||
|
||||
Also takes the props of [`MediaProps`](video.md#mediaprops).
|
||||
|
||||
@@ -108,7 +108,19 @@ Declares a composition inside the root. It draws nothing itself; a renderer find
|
||||
| `defaultProps` | `P` | the props it's rendered with (JSON-like values only) |
|
||||
| `edit` | `Edit` | a hand edit laid over the composition (docs/craft-system.md, L): written back by the app's timeline |
|
||||
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 152 more.
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 153 more.
|
||||
|
||||
### `Effect`
|
||||
|
||||
The picture under it, through the effect, for as long as its <Sequence> runs.
|
||||
|
||||
| Prop | Type | What it does |
|
||||
| --- | --- | --- |
|
||||
| `kind` (required) | `string` | which effect: blur, mono, sepia, vivid, faded, contrast, bright, dark, invert or hue; with `parts`, its own name |
|
||||
| `parts` | `EffectPart[]` | an effect of its own, as CSS filter functions (a plugin's): each [function, value at amount 0, value at amount 1, unit], such as [["blur", 0, 6, "px"], ["saturate", 1, 1.6]] |
|
||||
| `amount` | `number` | how much of it, from 0 (none) to 1 (all, the default) |
|
||||
| `in` | `number` | frames it takes to come on at its part's start (0: on at once) |
|
||||
| `out` | `number` | frames it takes to go off by its part's end (0: off at once) |
|
||||
|
||||
### `Freeze`
|
||||
|
||||
@@ -168,7 +180,7 @@ The master: every sound in the composition brought to `lufs` integrated loudness
|
||||
### `Nudge`
|
||||
|
||||
Places its child: an element gets the move in front of its own transform and the fade times its own opacity; a
|
||||
component, whose box it can't reach, is placed inside a full-frame layer.
|
||||
component, whose box it can't reach, or a part with a mask, is placed inside a full-frame layer.
|
||||
|
||||
| Prop | Type | What it does |
|
||||
| --- | --- | --- |
|
||||
@@ -177,6 +189,13 @@ component, whose box it can't reach, is placed inside a full-frame layer.
|
||||
| `scale` | `number` | how much bigger (2) or smaller (0.5), about its centre |
|
||||
| `rotate` | `number` | a turn, in degrees, about its centre |
|
||||
| `opacity` | `number` | 0 (gone) to 1 (as it was), times its own opacity |
|
||||
| `mirror` | `boolean` | flipped left to right |
|
||||
| `crop` | `[left: number, top: number, right: number, bottom: number]` | how much is cut off its left, top, right and bottom, each a share of that side from 0 to 0.9 |
|
||||
| `mask` | `Mask` | what of it is seen: a shape in shares of the frame (line, mirror, circle, rect, heart, star), turned, feathered or inverted (sdk/video cutout.ts, TL7f) |
|
||||
| `blend` | `Blend` | how it is drawn over what is under it: screen, multiply, overlay and the rest of CSS's blend modes |
|
||||
| `chroma` | `ChromaKey` | a colour taken out of it, as a green screen is: { color, strength, shadow } |
|
||||
| `adjust` | `Adjust` | its brightness, contrast, saturation, exposure, sharpen, highlights, shadows, temperature, tint, fade, vignette and grain, each 0 as shot (sdk/video adjust.ts, TL7g) |
|
||||
| `keys` | `Partial<Record<NudgeProp, NudgeKey[]>>` | any of the above over time: its keys, each [frame, value, ease?], in frames from where this part's time starts (its <Sequence>'s first frame), by the names in NUDGE_KEYED ("mask.x", "chroma.strength", "crop.left" for what is inside a mask, a key or a crop). A keyed property's still value is ignored. |
|
||||
| `children` | `ReactNode` | the part it places: an element, or a component, which moves inside a full-frame layer |
|
||||
|
||||
### `Overlay`
|
||||
@@ -245,6 +264,17 @@ render gives the same element back.
|
||||
|
||||
Also takes the props of [`StaggerProps`](animation.md#staggerprops) (`each`, `grid`, `exitEach`); [`AnimateOwnProps`](animation.md#animateownprops).
|
||||
|
||||
### `Transition`
|
||||
|
||||
Its children, coming in over the part's first frames, going out over its last, and moving by a Combo throughout.
|
||||
|
||||
| Prop | Type | What it does |
|
||||
| --- | --- | --- |
|
||||
| `in` | `TransitionEdge` | over the part's first frames |
|
||||
| `out` | `TransitionEdge` | over the part's last frames |
|
||||
| `combo` | `ComboLoop` | a Combo over the whole part: a cycle every `frames`, from its first frame |
|
||||
| `children` | `ReactNode` | the part it brings in and takes out: what the <Sequence> holds |
|
||||
|
||||
### `Video`
|
||||
|
||||
A video clip in step with the frame; `data-source-time` is the source time (seconds) to show.
|
||||
@@ -253,6 +283,7 @@ A video clip in step with the frame; `data-source-time` is the source time (seco
|
||||
| --- | --- | --- |
|
||||
| `framing` | `"face"` | ours: frame the take on the largest face |
|
||||
| `punchIn` | `number` | ours: multiplies the framing's scale (1.15 is the usual) |
|
||||
| `matte` | `VideoMatte` | ours: its cutout: the mattes made of its file, which it wears as its mask, so what is cut out shows what is under it |
|
||||
|
||||
Also takes the props of [`MediaProps`](video.md#mediaprops).
|
||||
|
||||
@@ -266,7 +297,7 @@ The frame being rendered, counted from the start of the nearest enclosing Sequen
|
||||
function useCurrentFrame(): number
|
||||
```
|
||||
|
||||
Used in: [ui/scroll_and_overflow/overflow_transform](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/scroll_and_overflow/overflow_transform.tsx), [ui/render_ui_to_texture](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/render_ui_to_texture.tsx), [ui/ui_material](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/ui_material.tsx), [ui/styling/gradients](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/styling/gradients.tsx), [ui/text/text_debug](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/text_debug.tsx), [ui/text/text](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/text.tsx), [ui/text/font_atlas_debug](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/font_atlas_debug.tsx), [3d/fog_volumes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/3d/fog_volumes.tsx), and 46 more.
|
||||
Used in: [ui/scroll_and_overflow/overflow_transform](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/scroll_and_overflow/overflow_transform.tsx), [ui/render_ui_to_texture](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/render_ui_to_texture.tsx), [ui/ui_material](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/ui_material.tsx), [ui/styling/gradients](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/styling/gradients.tsx), [ui/text/text_debug](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/text_debug.tsx), [ui/text/text](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/text.tsx), [ui/text/font_atlas_debug](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/text/font_atlas_debug.tsx), [3d/fog_volumes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/3d/fog_volumes.tsx), and 47 more.
|
||||
|
||||
### `useGameEvents`
|
||||
|
||||
@@ -323,7 +354,7 @@ function useSong(map: SongMap, options?: UseSongOptions): SongMoment & { song: S
|
||||
|
||||
### `useVideoConfig`
|
||||
|
||||
The settings of the composition being rendered (a Sequence's width and height win inside it).
|
||||
The settings of the composition being rendered (inside a Sequence, its width, height and length win).
|
||||
|
||||
```ts
|
||||
function useVideoConfig(): VideoConfig
|
||||
@@ -397,6 +428,30 @@ Hold the frame until `continueRender(handle)`. `label` names it if it's still op
|
||||
function delayRender(label?: string, options?: { timeoutInMilliseconds?: number; } | undefined): number
|
||||
```
|
||||
|
||||
### `effectAt`
|
||||
|
||||
How much of the effect is on at `frame` of a part `duration` frames long, coming on over `enter` and off over `exit`.
|
||||
|
||||
```ts
|
||||
function effectAt(frame: number, duration: number, enter?: number, exit?: number): number
|
||||
```
|
||||
|
||||
### `effectFilter`
|
||||
|
||||
The CSS filter of `kind` at `amount` (0 to 1, clamped); undefined for a kind raea doesn't draw.
|
||||
|
||||
```ts
|
||||
function effectFilter(kind: string, amount?: number): string | undefined
|
||||
```
|
||||
|
||||
### `effectPartsError`
|
||||
|
||||
Why `parts` isn't an effect's parts, or undefined when it is.
|
||||
|
||||
```ts
|
||||
function effectPartsError(parts: unknown): string | undefined
|
||||
```
|
||||
|
||||
### `fade`
|
||||
|
||||
opacity 0 to 1 over `frames` (6).
|
||||
@@ -545,6 +600,14 @@ Every step at once.
|
||||
function parallel(...steps: Step[]): Group
|
||||
```
|
||||
|
||||
### `partsFilter`
|
||||
|
||||
The CSS filter of an effect given as parts, at `amount` (0 to 1, clamped).
|
||||
|
||||
```ts
|
||||
function partsFilter(parts: EffectPart[], amount?: number): string
|
||||
```
|
||||
|
||||
### `pop`
|
||||
|
||||
scale `from` (0.6), `peak` (1.08) at `frames`/2, 1 at `frames` (8); in over 3 frames.
|
||||
@@ -594,7 +657,7 @@ Names the root component the renderer starts from, and records its compositions.
|
||||
function registerRoot(given: ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentType): void
|
||||
```
|
||||
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 152 more.
|
||||
Used in: [ui/images/image_node](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node.tsx), [ui/images/ui_texture_slice_flip_and_tile](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice_flip_and_tile.tsx), [ui/images/image_node_resizing](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/image_node_resizing.tsx), [ui/images/ui_texture_atlas_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas_slice.tsx), [ui/images/ui_texture_slice](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_slice.tsx), [ui/images/ui_texture_atlas](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/images/ui_texture_atlas.tsx), [ui/layout/grid](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/grid.tsx), [ui/layout/ghost_nodes](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/bench/bevy-parity/ui/layout/ghost_nodes.tsx), and 153 more.
|
||||
|
||||
### `replayDecider`
|
||||
|
||||
@@ -687,6 +750,30 @@ Where the song is at `t` seconds: a pure function of the map.
|
||||
function songAt(map: SongMap, t: number): SongMoment
|
||||
```
|
||||
|
||||
### `speedLength`
|
||||
|
||||
How many frames `span` source frames take under the curve (points from speedPoints).
|
||||
|
||||
```ts
|
||||
function speedLength(ps: SpeedPoint[], span: number): number
|
||||
```
|
||||
|
||||
### `speedPoints`
|
||||
|
||||
The points checked and in order, one at each end.
|
||||
|
||||
```ts
|
||||
function speedPoints(owner: string, curve: SpeedPoint[]): SpeedPoint[]
|
||||
```
|
||||
|
||||
### `speedSource`
|
||||
|
||||
The source frame, counted from the curve's start, showing `frame` frames in; `span` once the curve has run out.
|
||||
|
||||
```ts
|
||||
function speedSource(ps: SpeedPoint[], span: number, frame: number): number
|
||||
```
|
||||
|
||||
### `spring`
|
||||
|
||||
A damped spring's value at `frame`: from `from` (0) to `to` (1), started `delay` frames late, by its `config`
|
||||
@@ -829,6 +916,12 @@ turn one round. Pass one as `interpolate`'s `easing`.
|
||||
|
||||
Used in: [manual: turntable](https://github.com/shinyobjectz/raea/blob/main/docs/manual/examples/turntable.tsx).
|
||||
|
||||
### `EFFECT_FNS`
|
||||
|
||||
The filter functions a part may name, each with the units it takes.
|
||||
|
||||
### `EFFECTS`
|
||||
|
||||
### `FEED_KEY`
|
||||
|
||||
The prefix of the keys the app hands every panel for what it knows: `feed:transcript` (the conversation's last lines,
|
||||
@@ -1073,6 +1166,28 @@ a split, a cut word or a moved span is a change to this list; the length becomes
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `segments` | `readonly (readonly [number, number])[]` | the composition's own frame ranges, [from, to), played one after another |
|
||||
| `scale` | `number` | the composition drawn at this fraction of its size (above 0, at most 1), what is where kept: it is laid out at its width and height (useVideoConfig still says them) and the whole drawn smaller, so a 3D view traces fewer pixels. A draft's, where a smaller picture changes nothing that ships: the app's composition drafts and a scene's kept frames draw at 0.5 |
|
||||
|
||||
### `EffectKind`
|
||||
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `kind` (required) | `string` | its name in the composition's code: <Effect kind> |
|
||||
| `title` (required) | `string` | what the person sees |
|
||||
| `filter` (required) | `(amount: number) => string` | the CSS filter at `amount` |
|
||||
|
||||
### `EffectPart`
|
||||
|
||||
An effect as data: each part one CSS filter function, its value going
|
||||
from `from` (amount 0, where it changes nothing) to `to` (amount 1), with its unit: ["blur", 0, 6, "px"].
|
||||
|
||||
```ts
|
||||
type EffectPart = [fn: string, from: number, to: number, unit?: string]
|
||||
```
|
||||
|
||||
### `EffectProps`
|
||||
|
||||
The props of [`Effect`](#effect), tabled there.
|
||||
|
||||
### `ExtrapolateMode`
|
||||
|
||||
@@ -1212,6 +1327,7 @@ The props of [`Loop`](#loop), tabled there.
|
||||
| `fadeIn` | `number` | ours: seconds to ramp the sound in from silence at its start (applied by the renderer at the audio's rate) |
|
||||
| `fadeOut` | `number` | ours: seconds to ramp the sound out to silence by its end: the end of its Sequence or Loop pass, or endAt, whichever comes first (one removed some other way fades out after it's gone) |
|
||||
| `playbackRate` | `number` | how fast it plays (1): 2 is double speed |
|
||||
| `speedCurve` | `SpeedPoint[]` | ours: its speed as a curve over its source, [place, speed] points: the place from 0 (startFrom) to 1 (endAt, which it needs), the speed from 0.1 to 10 and changing in a straight line between two points. Wins over playbackRate; its Sequence is as long as the curve takes (`speedLength`) |
|
||||
| `muted` | `boolean` | play no sound |
|
||||
| `loop` | `boolean` | start again from `startFrom` when it reaches `endAt` |
|
||||
| `bus` | `string` | the bus it plays into: a named channel of the edit's Tone graph (music, sfx, voice, ambience, ui), so it takes that bus's volume, effects and ducking (raea/tone `buses`) |
|
||||
@@ -1569,6 +1685,12 @@ The props of [`SongPlot`](#songplot), tabled there.
|
||||
| `energy` (required) | `number` | its mean energy, 0..1 |
|
||||
| `cuts` (required) | `number` | suggested cuts per bar: 0.25, 0.5, 1, 2 or 4 |
|
||||
|
||||
### `SpeedPoint`
|
||||
|
||||
```ts
|
||||
type SpeedPoint = [place: number, speed: number]
|
||||
```
|
||||
|
||||
### `SpringConfig`
|
||||
|
||||
| Field | Type | What it is |
|
||||
@@ -1686,6 +1808,27 @@ many steps in the state at least (`after`), and what to do on the way (`actions`
|
||||
type TransitionConfig = Target<N> & When<C, E> & { /** steps in the state before this transition may fire (0) */ after?: number; actions?: Actions<C, E>; /** what the transition means: a decider reads it (a model's option description), reports show it */ description?: string; }
|
||||
```
|
||||
|
||||
### `TransitionEdge`
|
||||
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `kind` (required) | `TransitionKind` | which transition: fade, slide, wipe or zoom |
|
||||
| `frames` (required) | `number` | how many of the part's frames it takes |
|
||||
|
||||
### `TransitionKind`
|
||||
|
||||
fade: through black. slide: in from the right, out to the left. wipe: uncovered from the left, covered from the
|
||||
left. zoom: grows in from 85%, shrinks out to 85%, fading. A dissolve between two parts that only touch has no
|
||||
frames of the other to mix with, so it is written as a fade.
|
||||
|
||||
```ts
|
||||
type TransitionKind = "fade" | "slide" | "wipe" | "zoom"
|
||||
```
|
||||
|
||||
### `TransitionProps`
|
||||
|
||||
The props of [`Transition`](#transition), tabled there.
|
||||
|
||||
### `TransitionRecord`
|
||||
|
||||
One transition as a row: what a trace keeps and rdb loads (step, machine, from, to, edge, decider, evidence). `from` is
|
||||
|
||||
@@ -320,8 +320,8 @@ The props of [`Ellipse`](#ellipse), tabled there.
|
||||
| `onPointerOver` | `(e: Event3d) => void` | the pointer came over the part (bubbles, as the DOM's) |
|
||||
| `onPointerOut` | `(e: Event3d) => void` | the pointer left the part (bubbles) |
|
||||
| `onWheel` | `(e: Event3d) => void` | the wheel turned over the part (`deltaX`, `deltaY`) |
|
||||
| `quat` | `Quat` | Bevy's rotation as it is, a quaternion [x, y, z, w] in Bevy's axes (y up, z toward the viewer), in place of `rotation`: a turn out of the frame's plane too, as a Sprite's Transform takes it (camera/2d_on_ui) |
|
||||
| `opacity` | `number` | 0 to 1 (1 by default) |
|
||||
| `quat` | `Quat` | Bevy's rotation as it is, a quaternion [x, y, z, w] in Bevy's axes (y up, z toward the viewer), in place of `rotation`: a turn out of the frame's plane too, as a Sprite's Transform takes it (camera/2d_on_ui) |
|
||||
|
||||
### `MeshAttributes`
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ function useLocalTime(caller: string): LocalTime
|
||||
|
||||
### `useVideoConfig`
|
||||
|
||||
The settings of the composition being rendered (a Sequence's width and height win inside it).
|
||||
The settings of the composition being rendered (inside a Sequence, its width, height and length win).
|
||||
|
||||
```ts
|
||||
function useVideoConfig(): VideoConfig
|
||||
@@ -115,6 +115,7 @@ The local time a subtree sees: its own frame, and the composition frame its fram
|
||||
| `origin` (required) | `number` | the composition frame the subtree's frame 0 falls on |
|
||||
| `width` (required) | `number` | width and height a Sequence overrides for its children |
|
||||
| `height` (required) | `number` | in px, what the Sequence gives its children |
|
||||
| `duration` (required) | `number` | frames the subtree runs for from its frame 0, which useVideoConfig reports as durationInFrames: a Sequence's own length cut where its parent's ends, a Loop's one pass, the composition's at the root |
|
||||
|
||||
### `Perception`
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ function Cut() {
|
||||
import { Freeze, Loop, Sequence, Series } from "raea/video"
|
||||
```
|
||||
|
||||
`raea/video` exports 5 components, 7 types. Bevy's counterpart: `raea's own; Bevy has no video crate`. Source: [sdk/raea/src/video.ts](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/video.ts).
|
||||
`raea/video` exports 5 components, 8 types. Bevy's counterpart: `raea's own; Bevy has no video crate`. Source: [sdk/raea/src/video.ts](https://github.com/shinyobjectz/raea/blob/main/sdk/raea/src/video.ts).
|
||||
|
||||
## Components
|
||||
|
||||
@@ -93,6 +93,7 @@ A video clip in step with the frame; `data-source-time` is the source time (seco
|
||||
| --- | --- | --- |
|
||||
| `framing` | `"face"` | ours: frame the take on the largest face |
|
||||
| `punchIn` | `number` | ours: multiplies the framing's scale (1.15 is the usual) |
|
||||
| `matte` | `VideoMatte` | ours: its cutout: the mattes made of its file, which it wears as its mask, so what is cut out shows what is under it |
|
||||
|
||||
Also takes the props of [`MediaProps`](#mediaprops).
|
||||
|
||||
@@ -120,6 +121,7 @@ The props of [`Loop`](#loop), tabled there.
|
||||
| `fadeIn` | `number` | ours: seconds to ramp the sound in from silence at its start (applied by the renderer at the audio's rate) |
|
||||
| `fadeOut` | `number` | ours: seconds to ramp the sound out to silence by its end: the end of its Sequence or Loop pass, or endAt, whichever comes first (one removed some other way fades out after it's gone) |
|
||||
| `playbackRate` | `number` | how fast it plays (1): 2 is double speed |
|
||||
| `speedCurve` | `SpeedPoint[]` | ours: its speed as a curve over its source, [place, speed] points: the place from 0 (startFrom) to 1 (endAt, which it needs), the speed from 0.1 to 10 and changing in a straight line between two points. Wins over playbackRate; its Sequence is as long as the curve takes (`speedLength`) |
|
||||
| `muted` | `boolean` | play no sound |
|
||||
| `loop` | `boolean` | start again from `startFrom` when it reaches `endAt` |
|
||||
| `bus` | `string` | the bus it plays into: a named channel of the edit's Tone graph (music, sfx, voice, ambience, ui), so it takes that bus's volume, effects and ducking (raea/tone `buses`) |
|
||||
@@ -150,6 +152,17 @@ The props of [`Sequence`](#sequence), tabled there.
|
||||
| `width` | `number` | the width its children see, px (the parent's by default) |
|
||||
| `durationInFrames` | `number` | how many frames it shows its children (forever by default) |
|
||||
|
||||
### `VideoMatte`
|
||||
|
||||
A clip's mattes: PNGs whose alpha is what is kept, m00001.png on, in one folder of the media folder.
|
||||
|
||||
| Field | Type | What it is |
|
||||
| --- | --- | --- |
|
||||
| `src` (required) | `string` | the folder, as staticFile gives it: staticFile("matte/take-person") |
|
||||
| `fps` (required) | `number` | the file's frame rate: m00001.png is its frame 0 |
|
||||
| `every` | `number` | one matte each `every` frames of the file, held until the next (1, every frame, when left out) |
|
||||
| `count` (required) | `number` | how many mattes there are: past the last, the last is worn |
|
||||
|
||||
### `VideoProps`
|
||||
|
||||
The props of [`Video`](#video), tabled there.
|
||||
|
||||
@@ -62,6 +62,21 @@ curl -fsSL https://raea.io/install | sh
|
||||
|
||||
Then see what changed in [What's new](../whats-new/index.md).
|
||||
|
||||
### The desktop app
|
||||
|
||||
The desktop app looks for a newer raea when it starts and every six hours, and a card in the bottom right corner says
|
||||
when one is out. On the Mac, raea.app downloads and checks the update itself: press **Restart now**, or it switches the
|
||||
next time you quit. On Windows and Linux, **Download** gets the new build, and you install it over this one. Your
|
||||
projects and settings stay as they are.
|
||||
|
||||
To look for an update yourself, open **Settings → General** and press **Check for updates**. From 0.1.3, an update
|
||||
that is waiting also shows as **Update** at the foot of the sidebar.
|
||||
|
||||
On the Mac, drag raea.app into Applications before you open it. Opened straight from Downloads, macOS runs it from a
|
||||
read-only copy, and raea 0.1.1 and 0.1.2 can't replace themselves there: Restart now does nothing. If that happened to
|
||||
you, download raea from [raea.io/download/mac](https://raea.io/download/mac), drag it into Applications and open it
|
||||
from there. From 0.1.3, raea updates wherever it was opened from, and says so if it ever can't.
|
||||
|
||||
## Pick a version
|
||||
|
||||
Set `RAEA_VERSION` to install a particular release instead of the newest:
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: "raea 0.1.2"
|
||||
version: "0.1.2"
|
||||
date: "2026-11-13"
|
||||
summary: "Components that measure as they do in Chrome, a fingerprint of what you judge good, and one timeline for picture and sound in the app's player."
|
||||
sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.2"]
|
||||
---
|
||||
|
||||
raea 0.1.2 lets compositions measure themselves the way a web page does, teaches raea what you judge good, and gives the app's player one timeline for picture and sound.
|
||||
|
||||
**Get the app at [raea.io](https://raea.io)** (a Mac with Apple silicon, Windows 10 or 11, or Linux on x86_64).
|
||||
|
||||
The engine alone:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://raea.io/install | sh
|
||||
```
|
||||
|
||||
On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`.
|
||||
|
||||
## What changed since 0.1.1
|
||||
|
||||
**Components that measure, as in Chrome (#54, #13).** Many components written for the web measure before they draw: a title sized to its box, captions wrapped where a line really ends, a caret after the last typed letter. In a composition those reads now answer as Chrome does, from the same layout and font files that draw the frame: `getBoundingClientRect` (through transforms and perspective), `offsetWidth` and the rest, `getComputedStyle`, a ref's children and selectors, `document.createElement`, Range, `document.fonts`, `ResizeObserver`, a canvas's `measureText`, and svg text's lengths. Hold the frame with `delayRender` and `continueRender` until a measure lands. Reads answer in live play too (the app's stage, `raea play`, exported games). In a render the first read in a frame costs about 0.4 ms, and more in the same frame almost nothing. Measured against headless Chrome on snapcn's measuring components, 23 of 33 now land within a pixel (3 before). The manual's new guide, "Web components that measure", lists what answers and what doesn't yet.
|
||||
|
||||
**Text set as Chrome sets it.** Letters set a span each keep their kerning. A `visibility: hidden` word keeps its place and isn't drawn. A web font from `loadFont` is the one measured and drawn at every weight (raea's own Inter drew 500 as 400 and 600 as 700), and it's loaded before your first effect runs. A canvas's `system-ui` is the Mac's system font. An svg `<text>` with letter-spacing lands where Chrome puts it.
|
||||
|
||||
**Canvas, requestAnimationFrame and Image (#55, #56).** Compositions get the web's 2D canvas context, `requestAnimationFrame` (called once per frame drawn, with that frame's time) and `new Image()`.
|
||||
|
||||
**raea learns what you judge good.** `raea fingerprint` keeps a fingerprint of your taste: axes such as blur, glow or a frozen picture, each a small model over encoders that run on your Mac (SigLIP 2 for pictures, CLAP and YAMNet for sound, EmbeddingGemma for scripts). Your notes, approvals and picks between two cuts teach it, and `raea fingerprint score` says where a piece stands on each axis and whether a fix fixed what it claimed (`--was OLD`). `raea fingerprint things` finds a shot's things, their depth and the ground under them, and `raea check --things` reports one floating, passing through another, or a camera that changes speed mid-move. Archiving a project runs a post-mortem. The app has a Fingerprint page: what it knows, what it's learning, and fingerprints of your own for different kinds of work.
|
||||
|
||||
**One timeline in the player.** A video's player in the app is one deck: the picture on top, the sound under it and your comments' pins between them. The picture track shows frames, energy, scenes, captions or checks, and the sound track a waveform, beats or words; what a render hasn't got yet is offered with its verb (Transcribe, Detect). An agent at work has a stop button wherever the app shows it working, a feed or the Inbox can be summed up on its timeline, and a new project waits for you to make the first move.
|
||||
|
||||
**Review links by email.** Under a live review link in the Share panel, type up to 25 addresses and an optional note, and raea mails them the link. Sign-in codes come by email too.
|
||||
|
||||
**Video with alpha (#113).** A VP9 WebM's transparency and a ProRes 4444's are drawn, not refused or made opaque, and `render --alpha` leaves a frame with 3D transparent where nothing is drawn (#114).
|
||||
|
||||
**Projects with room to grow.** A new project has compositions/, components/, controllers/, assets/ and artifacts/, and a workspace has shared/ for what every project imports as `@shared/...`. `raea component add` (raea part's new name, which still works) copies a ready component into the project, or into shared/ with `--shared`.
|
||||
|
||||
**raea's Claude plugin** installs from raea's marketplace and is the raea skill with its two hooks, which run raea locally and send nothing.
|
||||
|
||||
**Fixes**
|
||||
- The Windows app stays open when a video opens: every raea executable on Windows now has an 8 MB main-thread stack, not the 1 MB default (#112).
|
||||
- The Windows app no longer crashes at launch reading a blob: FileReader, fetch's request body and a WebSocket's binary send turn bytes into a string a slice at a time, and a frame's own script is found under the app's folder (#124).
|
||||
- When an agent's Claude sign-in runs out mid-conversation, the app says so and signs you in again there, instead of failing every turn (#111).
|
||||
- On a Retina display the page fills the window instead of a quarter of it (#120, with Treamz), and the window is sharp.
|
||||
- A frame that comes out all black though its page shows something is a warning, said once over its run of frames (#96), and a filter of opacity() alone draws as the layer's opacity (#96).
|
||||
- Dark gradients no longer band in 8-bit H.264: the colour conversion dithers (#87).
|
||||
- canvas `arcTo` draws the corner's short arc, as a browser does (#97).
|
||||
- A Cone takes clicks only across its height (#98).
|
||||
- A mesh's emissive colour changes the frame it's set in live 3D (#106).
|
||||
- `getBoundingClientRect` no longer panics on a removed element and answers a zero rect under `display: none` (#108).
|
||||
- A relayout keeps an inline box's baseline (#109).
|
||||
- `raea check`'s safe-area rule tests a text's letters, not its box; a card that shares one word with a line isn't held to it as a caption; and a missing taste file is a note (#89, #102, with SirSicard).
|
||||
- `raea cut` takes a sound-only take (#89).
|
||||
- A still no longer prints dozens of CommandQueue warnings, and the 3D camera is the shadow origin (#89, #104, with SirSicard).
|
||||
- A fresh `raea init` renders again.
|
||||
- R3F: an opacity outside 0 to 1 is clamped instead of throwing (#117), and three.js 0.180 or later is the peer range (#118), both with Ragulsundaram. The three.js host draws `<Instances>` at each placement.
|
||||
- A ShaderMaterial under Solari lighting draws instead of failing its prepass.
|
||||
- raea's own commits work on a machine whose git has no `user.name`.
|
||||
- `import.meta.url` is set in every module on macOS 15.
|
||||
|
||||
Thank you to everyone who filed issues and sent PRs this round: augusbazan, SirSicard, Ragulsundaram, Treamz, revouwu, kevinschaich, connorads and Razepriv.
|
||||
|
||||
Its binaries are `v0.1.2-rc5`'s, built from 1be8199c8 and checked there.
|
||||
|
||||
## Known missing
|
||||
|
||||
- Of snapcn's measuring components, 10 still don't land within a pixel of Chrome (a font's tracking table, a few transforms' ink); docs/layout-reads.feature lists each. A Range across wrapped lines is one rect, and an element has no `innerHTML`.
|
||||
- `raea fingerprint` doesn't judge how real a sound is yet: it was measured on CC0 and CC BY recordings and didn't clear the bar for every kind of sound.
|
||||
- The Windows and Linux apps don't update themselves yet: download the next version from raea.io.
|
||||
- On Linux, raea needs ALSA, fontconfig and Vulkan (Ubuntu 24.04: `sudo apt install libasound2t64 libfontconfig1 libvulkan1 mesa-vulkan-drivers`).
|
||||
- The OCR half of the reading check runs on the Mac only.
|
||||
- The engine's own binaries aren't notarized. The Mac app is signed and notarized.
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "raea 0.1.3"
|
||||
version: "0.1.3"
|
||||
date: "2026-11-13"
|
||||
summary: "Updates that land, a box on the part of a sound you mean, and a fingerprint kept with the project it judges."
|
||||
sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.3"]
|
||||
---
|
||||
|
||||
raea 0.1.3 makes the app's updates land, puts a 3D scene in the feed for you to walk around in and mark up, gives every feed a to-do list, lets you point at the part of a sound you mean, and keeps a fingerprint with the project it judges.
|
||||
|
||||
**Get the app at [raea.io](https://raea.io)** (a Mac with Apple silicon, Windows 10 or 11, or Linux on x86_64).
|
||||
|
||||
The engine alone:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://raea.io/install | sh
|
||||
```
|
||||
|
||||
On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`.
|
||||
|
||||
## What changed since 0.1.2
|
||||
|
||||
**Updates that land.** On a Mac, raea opened straight from Downloads runs from a read-only copy macOS makes, so 0.1.1 couldn't replace itself with 0.1.2 and Restart now did nothing. From 0.1.3 the app replaces the original wherever you opened it, and when an update can't install itself the card says so, with a Download button. The sidebar shows **Update** while one waits, and **Check for updates** is in Settings → General. If you're on 0.1.2 and Restart now did nothing, download 0.1.3 from raea.io once and move it into Applications.
|
||||
|
||||
**A cleaner update card.** It plays a short, silent loop of what's new above its words, with Restart now, What's new beside it, and a close button for later.
|
||||
|
||||
**Scenes in the feed.** Your agent can post a 3D scene, a prop, a character, a model or a splat as a scene, and you look at it from inside: walk around it, scrub its timeline when it moves, and pin a comment to a place in it. Pick a part to move, turn or scale it by hand, change a procedural part's props in its details, draw new parts into the scene, or reshape a part's motion as a path of keys. Every change is written into the scene's own code, with Undo, and your agent reads what you changed and where you pinned. Several files posted together open as a board first.
|
||||
|
||||
**A to-do list in every feed.** The agents button in a feed's header now opens the project's to-do list: its brief's tasks and the edits you've sent on its items, one line each, with who has it and what they last did. Add, check off, reword, drag to reorder and remove, with Undo. The Inbox's list has every project's.
|
||||
|
||||
**Sessions you start outside raea, in the feed.** A Claude Code session you start in a terminal or another app is a bubble in its project's feed while it's open, with its last words, the tool it's on and its plan, and it shows on the tasks it has. Other agents are in the feed by what they post.
|
||||
|
||||
**Point at the part of a sound you mean.** Pick **Spectrogram** on the timeline's sound track (or in Listen) and drag a box around the hiss up high or the hum down low. The note keeps that span of time and that band of pitch, your agent reads both with the note, and `raea fingerprint learn-notes` keeps the band with the label in your fingerprint's evidence. Sound axes still judge the whole sound in each moment, so the band is kept but not yet learned from.
|
||||
|
||||
**Keep a fingerprint with a project.** A project's **judged by** chip is now a menu: it says which fingerprint judges the project and why, and **Keep with this project** or **Keep with the workspace** copies one of yours into that folder and commits it, so your team's raea judges with the same taste.
|
||||
|
||||
**Fingerprint has its own docs.** [raea.io/docs/fingerprint](https://raea.io/docs/fingerprint/) covers training one, checking a cut with it, and keeping one with a project for your team, and the raea skill has a page that teaches your agent the same.
|
||||
|
||||
**Fixes**
|
||||
- Each project's feed shows its own work and nothing else. With more than one workspace on a Mac, a project could show another project's cards, a card could be saved into a project of the same name in another workspace, and a terminal session's bubble could pull in what other sessions posted elsewhere. raea now holds one workspace's projects at a time, saves each card back only to the folder it came from, never makes a project just because something asked for it by name, and fills a session's bubble with its own posts in its own project.
|
||||
- A composition kept beside a `tsconfig.json`, as at a new project's root, plays again: `raea play`, the app's stage and stills drawn by playing stopped before the first frame with "__at is not a function".
|
||||
- A fingerprint judges on every machine. raea now downloads YAMNet, the sound-events model, once like its other models. Before, only some machines had it, so a fingerprint trained on one of them refused a teammate's fresh install.
|
||||
- In raea's window, a graph zoomed past the edge of its canvas no longer takes the clicks meant for the sidebar and header around it.
|
||||
- Inside a `<Sequence>`, `useVideoConfig().durationInFrames` is the Sequence's length (its own, cut where its parent's ends; a Loop's one pass), so an animation scaled to its scene runs over the scene, as in Remotion. If one of your compositions read the composition's length from inside a Sequence, read it outside the Sequence and pass it down. Thanks @Ragulsundaram (#126).
|
||||
- A release's `.sha256` files name their file alone, so `shasum -c` passes on a download (0.1.1's and 0.1.2's named the builder's path; 0.1.2's were re-uploaded).
|
||||
|
||||
**Known**
|
||||
- The Windows app is unsigned, as before: Windows asks once whether to run it.
|
||||
@@ -0,0 +1,123 @@
|
||||
---
|
||||
title: "raea 0.1.4"
|
||||
version: "0.1.4"
|
||||
date: "2026-11-14"
|
||||
summary: "The speed release: faster views, cards and playback, a timeline you edit by hand, agents with faces, and a plan for every project."
|
||||
sources: ["https://github.com/shinyobjectz/raea/releases/tag/v0.1.4"]
|
||||
---
|
||||
|
||||
raea 0.1.4 is the speed release: views, cards and playback come up faster, and raea's window keeps up with a busy timeline. It also brings a timeline you edit by hand the way CapCut works, agents with faces of their own, a plan for every project that you and your agents keep together, a Source page for everything a project is made of, a Get Started project that teaches raea down its feed, and a clear view of what raea keeps on your disk.
|
||||
|
||||
**Get the app at [raea.io](https://raea.io)** (a Mac with Apple silicon, Windows 10 or 11, or Linux on x86_64).
|
||||
|
||||
The engine alone:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://raea.io/install | sh
|
||||
```
|
||||
|
||||
On Windows, in PowerShell: `irm https://raea.io/install.ps1 | iex`.
|
||||
|
||||
## What changed since 0.1.3
|
||||
|
||||
**Faster where you wait.**
|
||||
- A view opens at once the first time. Source, the editors, Plugins and the rest used to pause about 300 ms on their first open.
|
||||
- A `raea show` from your terminal is a card in the feed within a second (0.12 to 0.83 s, down from 0.85 to 1.83 s).
|
||||
- The app no longer starts two processes to find a project's folder on each request, so a page full of thumbnails stops queueing behind itself.
|
||||
- Playback is smoother: with two 1080p60 videos side by side, the worst wait between frames each second averages 24 to 26 ms, down from 29 to 31. A film playing with its timeline open no longer redraws the whole watch view on every tick.
|
||||
- In raea's window, changing an element restyles only what the change touches, so dragging a clip on a 400-clip timeline runs at 48 to 50 frames a second, up from 38 to 41.
|
||||
- A ray-traced shot's first frame waits less for its models (744 ms down to 529 to 632 ms on a 61-frame shot). Drafts are drawn smaller than they ship and laid out as they ship, which makes a ray-traced draft about 1.7 times faster.
|
||||
- Library tiles show a picture before the file is indexed, instead of the word IMAGE.
|
||||
|
||||
**A timeline you edit by hand.** Watch, Listen and a scene's view have a CapCut-style timeline under the picture. Trim, split and move clips, change a clip's speed or draw a speed curve, freeze a frame, play footage backward, set keys and shape their curves, and copy a clip's attributes onto others. Put a mask, a blend or a chroma key on a clip with handles on the picture, and use Adjust's sliders. Add In, Out and Combo animations, transitions, effects and styled text. You can also:
|
||||
- make captions from what is said, and have a text read aloud;
|
||||
- record a voice-over at the playhead;
|
||||
- hold shaky footage steady;
|
||||
- cut a subject out automatically or by brushing over it (Apple's Vision, on your Mac);
|
||||
- retouch faces;
|
||||
- reduce a sound's noise or change its voice.
|
||||
|
||||
Every edit is written into the composition's own code, and **Send** hands what you changed to your agent. Plugins can add effects, text styles, tools, snap grids and kinds of track. The same model is in the SDK as `raea/editor`.
|
||||
|
||||
Getting around it works the way editors do:
|
||||
- The wheel moves through time and down the tracks, and ⌘ or a pinch zooms about the pointer without zooming the page.
|
||||
- A zoom bar under the tracks shows the whole film and the part in view: drag it to scroll, drag its ends to zoom, double-click to fit.
|
||||
- The playhead stays in view as it plays and after a jump.
|
||||
- The top edge resizes the panel, and resizing is never an undo step. Collapsed, the timeline is one row with a scrubber.
|
||||
- Many tracks scroll in a height of their own, with their names beside them.
|
||||
- The volume is a slider that stands up over the speaker, so the speaker never moves under your click.
|
||||
|
||||
**Agents with faces.** The Agents pane sits at the bottom of the sidebar, folded until you need it. Each agent is a small object rendered by raea, in one of five shapes and sixteen materials (jade, copper, obsidian, marble, velvet, pearl and more), with dark pill eyes that follow your pointer and show what it's doing: thinking, working, waiting, needing you or done. You name your AI when you set it up, and you right-click an agent to make it your primary AI or archive it. An avatar SDK lets you draw faces of your own.
|
||||
|
||||
**Get Started.** A new studio's only project is Get Started, and setup ends on it. It's a lesson you follow down its feed:
|
||||
1. how raea works;
|
||||
2. a video made from code;
|
||||
3. a game;
|
||||
4. a 3D scene;
|
||||
5. a small app;
|
||||
6. making your own.
|
||||
|
||||
Each card points at its own file, so you can change it, and a note on one goes to your AI with the file.
|
||||
|
||||
**A plan for every project.** A project's to-do list is now one file at the top of its folder, `plan.org`, in Org mode. Your agents keep it as they work: they plan anything with more than one step there, mark what they're making and what waits on you, close each task with what it made, and add what's left. A message you send becomes a task for the agent it went to. You can edit the file in Emacs or any editor, and the list picks the change up. Builders get the same plan as typed tasks in `@raea/task`, with keywords, properties, kinds and views a plugin can add, and React hooks and components.
|
||||
|
||||
**Source is one page.** A project's compositions, components, files and apps sit together as cards, with search and a filter. Click one to inspect it beside the list: its picture, facts, versions, renders, what it uses and what uses it. Add files with **Add files** or by dropping them anywhere on the page, from the Finder too. What raea's scan finds loose waits quietly behind **Tidy** instead of a red bar. Controllers keep their own tab.
|
||||
|
||||
**The Library searches everything.** Search reaches every project's compositions, components, files and artifacts as you type, and your libraries by what's in each picture, video and sound. A hit opens its project's Source with the thing already picked. Storage and People on projects sit in the Library too, beside review links and what's shared with you.
|
||||
|
||||
**See what raea keeps on your disk.** Settings → Storage lists each project's files and where they live. It has Sync now, a breakdown of what raea keeps on this Mac, and Old and unused, which checks again before it moves anything. Footage added in Source is copied in without doubling the space it takes. Your agent gets the same tools (`storage_status`, `storage_plan`, `storage_trash`, `footage_add`) and a guide for old video.
|
||||
|
||||
**Controls that feel like hardware.** Switches, selectors and keys are drawn as dark hardware and click on raea's own mixer, since a page in raea's window can play sound now. Every page's tabs share one look.
|
||||
|
||||
**Chats and the feed.**
|
||||
- What an agent reads, looks at or posts (a sheet, a still, a frame) shows as pictures in the chat. Click one to see it over the whole window: zoom, pan, step through them, and pin a comment on a spot, which goes to the agent with the file and where on it you mean.
|
||||
- **Copy reference** on anything's right-click menu copies a line naming it by id (the item, its project and its workspace) to paste to an agent, so it acts on exactly that thing.
|
||||
- Agents name projects by id rather than title, and `raea show --project` takes one, so their posts stop landing in the wrong project. Before making anything, they settle which workspace and project the work is for and go there.
|
||||
- Stopping an agent reads as stopped, everywhere you can stop it.
|
||||
- A chat's header shows that chat's own state, and its project's name takes you to the project's feed.
|
||||
- What a chat posted opens over its feed, with **Back to the chat**.
|
||||
- The chat beside each feed stays where you left it.
|
||||
- A Claude Code session started in a terminal opens as a chat beside its feed, with where it came from on an icon in the chat's header. What it posts while it runs shows under its card in the feed.
|
||||
- A chat whose agent crashed starts it again when you write.
|
||||
- raea's own agents no longer show up twice in the feed.
|
||||
- An empty project's feed points you at its to-do list.
|
||||
- An agent's question is a plain form with no editing toolbar.
|
||||
|
||||
**Workspaces.** Give a workspace an icon of your own from the whole Solar icon set (about 1,400, searchable), from its menu's **Change icon**.
|
||||
|
||||
**Setting up.** Onboarding chooses nothing for you: no AI is connected or picked until you pick it, and a message you send before then waits for **Pick an AI**. A downloaded app starts with no sample workspace. A workspace you name goes in ~/Documents/raea (~/raea when Documents is in iCloud), and the Welcome screen got a stage of its own. Opening raea again goes straight into the app, with what finished while you were away at the top of the Inbox, instead of a Welcome back card.
|
||||
|
||||
**More ways to make pictures and clips.** Setup's Images and video step, and Plugins, offer a made.app key, an OpenRouter sign-in in your browser, or a fal key, besides ChatGPT. made.app's sign-in is gone: it couldn't give raea a key, so it now takes a pasted one. Without a made.app key, `raea gen` makes pictures with fal's Nano Banana 2, or else OpenRouter's Gemini image model, so either account works on its own.
|
||||
|
||||
**Signing in.**
|
||||
- Kimi signs you in where your account is, kimi.ai or kimi.com, instead of always the same one.
|
||||
- A signed-out Claude says so and offers its sign-in.
|
||||
- When the keychain won't keep raea's sign-in, raea says so at once.
|
||||
- **Continue on raea.io** tries a dropped connection again and says why when it can't get through.
|
||||
- raea now uses the proxy set in your Mac's network settings, as your browser does.
|
||||
- A Mac that finished setting up through raea.io opens into the app even when raea.io can't be reached.
|
||||
|
||||
**For builders.**
|
||||
- `raea skills install --agent grokbot` stages raea's skill for Grok Bot and prints Grok Bot's own links to finish it.
|
||||
- A package in your project's `node_modules` that imports `raea` shares the composition's SDK instead of failing with "Can't find variable: raea". Thanks @Ragulsundaram (#151).
|
||||
- An error thrown inside `<R3F>` fails the render with its message instead of drawing nothing, and three's `PMREMGenerator` works there. Thanks @Ragulsundaram (#131).
|
||||
- `<Composition edit={{ scale }}>` draws a draft at a fraction of its size.
|
||||
- New SDK pieces for edits as code: `<Transition>`, `<Effect>`, `speedCurve`, `<Nudge keys>`, masks and keys, and a `<Video>` matte.
|
||||
- Text with an ellipsis is cut only when it doesn't fit.
|
||||
|
||||
**Fixes**
|
||||
- The feed and Inbox badges count only what the feed shows. They used to count posts from a terminal session that the feed never drew, and things you'd hidden or muted.
|
||||
- Signed in on raea.io without GitHub, your account's picture no longer asks GitHub for one with your email in its address, and Settings → Account names your email instead of saying you signed in with GitHub.
|
||||
- Agents' faces at rest no longer redraw every frame, so they stop slowing the window.
|
||||
- One item the feed can't read no longer blanks the whole Inbox: it's left out, and a card that fails to draw shows a line in its place.
|
||||
- Comments written after a reload no longer reuse ids from before it.
|
||||
- Back and forward go back and forward, and a reload lands where you were.
|
||||
- Open login, Open page and Discord's Join open in raea's window, and say so when a page didn't open.
|
||||
- raea never commits a render's frames or a half-written file.
|
||||
- TikTok, X and the other one-colour marks in Publish and Plugins are light on dark in raea's window, not black.
|
||||
- An SVG coloured by a class (a timeline curve's handles, a chart's labels) draws in its colour in raea's window, not black.
|
||||
|
||||
**Known**
|
||||
- The Windows app is unsigned, as before: Windows asks once whether to run it.
|
||||
- A proxy set by an automatic configuration (PAC) file isn't read. If yours uses one, start raea with `HTTPS_PROXY` set.
|
||||
- Drawn characters (the Character SDK) come in 0.1.5.
|
||||
@@ -0,0 +1,260 @@
|
||||
@spec
|
||||
Feature: Plans: a project's plan.org, kept by its agents
|
||||
Shane, 2026-11-14: "create a subagent that can flesh out the skills needed for tasks/plannig to be fully carried out
|
||||
by the agent right now its just blank and even if user doesnt touh it we need to have the againt use and maintain it
|
||||
and actualy use it for project managemtn and make that project managemnt system extensible with the task SDK. as a
|
||||
personal notel i liek or mode for managing projects so id liek to have that eb part of the base layer and make sure
|
||||
it integrates well with typescript/react/jsx correctly and the larger project in a way that is integral to the system"
|
||||
|
||||
"or mode" is Emacs org-mode. A project's plan is one Org file, plan.org. It is the base layer: the app, raea's own
|
||||
agents, agents outside raea (Claude Code in a terminal) and people in Emacs all read and write the same plain text.
|
||||
The to-do list was blank because nothing wrote to it but the composer; now every agent plans in it, marks what it's
|
||||
doing and closes what it made, whether or not the person ever opens it. @raea/task (sdk/task) reads and writes the
|
||||
file without losing a byte, edits it by task id, lets a plugin add keywords, properties, kinds and views, and gives
|
||||
React its hooks and components.
|
||||
|
||||
# Status 11-14: landed for 0.1.4. sdk/task (@raea/task) and this file in raea; the app in raea-feed (tasks-org merged
|
||||
# into integration-014 at 1214a21: vitest 242 files, 1509 tests, e2e todo, outside, messages, primary, heads,
|
||||
# consolidate 36 of 36); the skill in raea-skills #75 (skills/raea/plan.md).
|
||||
# Checked after the review: sdk/task 32 bun tests (org, edit, extend, tools), 35 with its react
|
||||
# tests under the app's vitest; the app's vitest 237 files, 1458 tests (base 229 files, 1403 tests, the same skips),
|
||||
# src/plan/agent.test.ts driving a turn's plan tools end to end on a faked host; tsc -b clean; e2e todo.spec.ts and
|
||||
# outside.spec.ts (7) and messages, primary, heads, consolidate (26) in Chrome; todo.spec.ts (4) and outside.spec.ts
|
||||
# (3) in raea's window (BLITZ_E2E bundle, node blitz/pw-run.mjs). The board (feed/Board.tsx, board/Lanes.tsx,
|
||||
# board/CardSheet.tsx) reads the plan now, but no route mounts it. Not done: `raea project new` writes no plan.org yet
|
||||
# (Rust, engine/cli), so reference/files.md, generated from it, doesn't list one; the page makes it on the first
|
||||
# write. The brief page (BriefView, unmounted) still draws a brief's own ## Tasks. Compositions can't import
|
||||
# @raea/task until sdk/tsconfig.base.json and raea's bundler map it.
|
||||
# 11-16: PL7, agents finish what they plan (raea-feed plan-finish: plan/keeper.ts, PlanKeeper.tsx; sdk/task tools.ts).
|
||||
# Checked in raea's window: e2e chat-plan 2 of 2 with a real ACP stand-in planning through the tool port, and
|
||||
# chat-goal, respawn, todo, outside, heads, primary, consolidate, ai-login unchanged; vitest 1621; sdk/task 33.
|
||||
|
||||
Background:
|
||||
Given the app's code is apps/app (raea-feed), the SDK sdk/task, the skill skills/raea/plan.md in raea-skills
|
||||
And the plan's tests: sdk/task/test/*.test.ts (PL2, PL3, PL5, PL6), apps/app src/plan/plan.test.ts (PL1c, PL4, PL4c,
|
||||
PL5), src/plan/agent.test.ts (PL5a, PL5b), host/plan.test.ts (PL4, PL5), src/feed/todo.test.ts and outside.test.ts
|
||||
(PL4b), e2e/todo.spec.ts (PL4b), apps/app src/plan/keeper.test.ts and e2e/chat-plan.spec.ts (PL7)
|
||||
|
||||
Rule: PL1. A project's plan is plan.org at the top of its folder
|
||||
# Why there: it's the project's own file, versioned with it in the workspace's repo, found by anyone who opens the
|
||||
# folder (a person, Emacs, an agent in a terminal). Not under .raea/, which is raea's state, not the person's. One
|
||||
# file a project: the Inbox reads each project's in turn.
|
||||
|
||||
@done
|
||||
Scenario: PL1a. The file says its title and raea's keywords
|
||||
Given a project with no plan.org
|
||||
When anything adds a task to it (the to-do list, the composer, an agent's plan_add)
|
||||
Then <project>/plan.org is made, starting "#+TITLE: <project's name>" and "#+TODO: TODO MAKING REVIEW | DONE DROPPED"
|
||||
And an Org reader (Emacs) cycles the same keywords: TODO, MAKING and REVIEW are open, DONE and DROPPED closed
|
||||
And a keyword written into a plan whose #+TODO: lines don't name it (MAKING in a file written by hand, a plugin's
|
||||
SHOT) adds its sequence's #+TODO: line to the head, so Emacs cycles it too; Org's own TODO and DONE need none
|
||||
|
||||
@done
|
||||
Scenario: PL1b. The Org it uses
|
||||
Given a plan.org
|
||||
Then a headline with a keyword is a task; a headline with none is a heading: a stage that groups the tasks under it
|
||||
And a task may carry a priority ([#A]), tags (:look:sound:; a dash is written _), a planning line (SCHEDULED,
|
||||
DEADLINE, CLOSED), a PROPERTIES drawer, checkboxes (- [ ], - [X]), a progress cookie ([2/5] or [40%]) and links
|
||||
And its properties are :ID: (t- and eight letters and digits), :ITEM: (the feed item it stands on), :AGENT: (who
|
||||
has it), :FROM: (what asked for it), :KIND: and :VERB:; any other property is kept as written
|
||||
And links name feed items and tasks by id: [[item:i-door-2]], [[id:t-ab12cd34]]
|
||||
And a subtask is a task under a task; its parent's cookie counts its subtasks, or with none its checkboxes
|
||||
|
||||
@done
|
||||
Scenario: PL1c. Everything is linked by id, never by name
|
||||
Given a task typed with "@grade #look due 11-20 → i-hall" (the to-do list, the composer)
|
||||
Then :AGENT: holds the agent's id; an @name no agent has yet is kept as @name, and shows that name
|
||||
And :ITEM: holds the item's id, the tags are the task's tags, and DEADLINE is that day this year
|
||||
And a task the composer writes for a message has :FROM: the message's id; one for a comment, ITEM#COMMENT
|
||||
|
||||
Rule: PL2. @raea/task reads a plan without losing a byte
|
||||
@done
|
||||
Scenario: PL2a. A round trip changes nothing
|
||||
Given any text, Org or not: drawers it doesn't know, #+BEGIN blocks, tables, CRLF endings, tabs, no final newline
|
||||
When it's read and printed with no edits
|
||||
Then the text is the same, byte for byte
|
||||
And a planning line with a stamp it can't wholly read (a range of days, a habit's .+2d/3d) is still the planning
|
||||
line: the drawer under it, and its :ID:, are read, and the part it couldn't read is written back as it was
|
||||
|
||||
@done
|
||||
Scenario: PL2b. A plan as values
|
||||
Given a plan.org
|
||||
Then readPlan gives every headline as an entry and the ones with a keyword as tasks, each with its state (todo,
|
||||
making, review, done, dropped, whatever its keyword is called), priority, tags and inherited tags, dates,
|
||||
properties, item, agents, from, parent and children, its stage, checkboxes, progress, links and body
|
||||
And a plan's own #+TODO: lines add keywords; a word a plugin defined keeps its plugin's state
|
||||
|
||||
@done
|
||||
Scenario: PL2c. A changed entry is written again part by part
|
||||
Given an edit that changes one task's keyword
|
||||
Then only its headline line is written again; its drawer, body and every other entry are as they were
|
||||
And the headline keeps its own spacing and its tags end where they ended, as Org's org-todo leaves them; a
|
||||
planning line written again keeps its parts' order, with a new CLOSED first
|
||||
|
||||
Rule: PL3. Every change is an edit by task id
|
||||
@done
|
||||
Scenario: PL3a. The edits
|
||||
Then applyEdits(text, edits) makes add, set, state, move, remove and check, in order, each naming its task by
|
||||
:ID: (or #N, its place among the headlines, for one that has no id yet)
|
||||
And add goes under a heading by its words (made when there's none), under a task (a subtask), or before or
|
||||
after a task; with none of them, at the end
|
||||
And every task is given an :ID: it lacks, and every progress cookie counts again
|
||||
|
||||
@done
|
||||
Scenario: PL3b. Closing stamps CLOSED; reopening takes it off
|
||||
When a task's state becomes done or dropped
|
||||
Then its planning line gets CLOSED: [YYYY-MM-DD Day HH:MM], as Org's org-log-done does
|
||||
And opening it again removes CLOSED
|
||||
|
||||
@done
|
||||
Scenario: PL3c. A wrong edit changes nothing
|
||||
When an edit names a task that isn't there (under: a task id included, which never becomes a stage heading), a
|
||||
day that isn't one, a keyword the plan doesn't know or a move into the task's own subtree
|
||||
Then applyEdits throws, saying what's wrong and how to find the right id, and the text is as it was
|
||||
|
||||
Rule: PL4. The app keeps its tasks in the plan
|
||||
@done
|
||||
Scenario: PL4a. The host reads and writes plan.org whole
|
||||
Given POST /host/plan {op: read | apply | put, workspace, project}
|
||||
Then read answers the text and a stamp (same: true when the page's stamp still holds); a read for an agent
|
||||
(name: true: its turn, its plan_read) first gives each task written without an :ID: one, and writes it
|
||||
And apply makes the edits on the file (or on a new plan) and writes it through a temporary file, renamed over,
|
||||
answering with the text they were made on; edits naming a task by its place (#N) carry the text that place
|
||||
was counted in, and are refused when the file has changed since
|
||||
And put writes an older text back for Undo only while the file is still the text the page last saw
|
||||
And the e2e host (RAEA_FEED_KEEP=0) keeps nothing: the page's plan is the plan
|
||||
|
||||
@done
|
||||
Scenario: PL4b. The to-do list, the composer and raea's own work write plan edits
|
||||
Given the to-do list (feed/TodoPanel.tsx) open on a project or the Inbox
|
||||
Then its rows are the plan's tasks as written (subtasks too) and the edits sent on the project's items
|
||||
And a task linked to an item stands where the item does (the work is the truth)
|
||||
And add, check off, reword, reorder and remove are plan edits made at once in the page and then on the file
|
||||
And Undo puts the text back only while the plan hasn't changed since ("The plan has changed since: nothing
|
||||
undone"), and puts back the file as the edit found it, so a task another writer added before the edit stays
|
||||
And the list reads the plan again every few seconds and on focus, so an edit in Emacs or a terminal shows; an
|
||||
agent's turn and its plan_read read it again first
|
||||
And a message sent in the composer is a task in the plan: after the last task carrying the view's tags, held by the
|
||||
agent it went to, :FROM: the message's id
|
||||
And raea's shaping, storyboards, directions and renders are its tasks under Plan and Make, each :ITEM: the card it
|
||||
waits on; a critique's gate is "<title> passes check and critique" with :ITEM: the newest critique
|
||||
And an item carries the tags of the tasks linked to it, a workflow field places a channel by its plan's tasks, and
|
||||
a session outside raea holds the tasks whose :AGENT: is @its-name or its inbox
|
||||
And the board (feed/Board.tsx, board/Lanes.tsx, board/CardSheet.tsx) reads and edits the plan the same way, by
|
||||
task id; no route mounts it yet
|
||||
|
||||
@done
|
||||
Scenario: PL4c. A brief's tasks move into the plan once
|
||||
Given a project whose brief.md still has ## Tasks (every brief before this, and the starter brief's "Write the plan")
|
||||
When the page has read its kept brief
|
||||
Then each task is added to the plan with its mark as its keyword, its ### stage as its heading, its @agents by id,
|
||||
its #tags, its due day as DEADLINE, its → item as :ITEM: and its craft verb as :VERB:
|
||||
And the task lines, the stages and an emptied ## Tasks leave the brief; everything else in it stays
|
||||
And a brief the plan can't take (the host refused the write) keeps its tasks, and is tried again next load
|
||||
And each task's id comes from its stage, its words and which of the same words it is, so a brief moved twice (two
|
||||
pages open on it, a reload before the brief was saved) adds nothing the second time
|
||||
|
||||
@done
|
||||
Scenario: PL4d. Comment tasks stay where they are
|
||||
Given an edit sent on an item (model/tasks.ts, raea show --working/--done)
|
||||
Then it is not copied into the plan; it shows in the same to-do list, under the plan's tasks, as it did
|
||||
|
||||
Rule: PL5. Agents use and maintain the plan, whether the person opens it or not
|
||||
@done
|
||||
Scenario: PL5a. The plan tools
|
||||
Given an agent the raea app launches (the feed MCP server, apps/app host/acp/feed-mcp.ts)
|
||||
Then it has plan_read (the open tasks by id; full: the whole file), plan_add (tasks under a stage or a task,
|
||||
held by the agent unless it names others), plan_update (mark, tick or add a checkbox, change fields, move,
|
||||
remove) and plan_close (DONE with CLOSED and the item it made, or dropped)
|
||||
And the page answers them through its plans (@raea/task answerPlanTool), a headless run (host/acp/memory.ts) on
|
||||
the folder's plan.org; a session with no project has no plan, and says so
|
||||
|
||||
@done
|
||||
Scenario: PL5b. Every turn carries the plan
|
||||
Given an agent's turn in a project (src/acp/session.ts prompt)
|
||||
Then the prompt carries raea://plan/<project>: the rule to keep the plan, the task this message is (by :FROM:),
|
||||
and the open tasks by id under their stages (planDigest)
|
||||
And the rule: plan work of more than one step first, mark a task MAKING as you start it and REVIEW when it waits
|
||||
on the person, close it as you finish with the item it made, add what's left, drop rather than remove
|
||||
And every task it names has an id: a task written without one is given one before the plan is read for the turn
|
||||
And an agent launched without the plan tools is told to keep plan.org as text; a message whose task is already
|
||||
closed says so, rather than asking for it to be marked
|
||||
|
||||
Scenario: PL5c. An agent outside raea keeps the same file
|
||||
Given Claude Code in a terminal in the project's folder, with the raea skill
|
||||
Then it opens plan.org (skills/raea/plan.md), plans and marks there as plain Org text, keeping each :ID:
|
||||
And the person sees its changes in the to-do list within a few seconds
|
||||
|
||||
Rule: PL6. A plugin extends plans; React and raea's window read them
|
||||
@done
|
||||
Scenario: PL6a. Keywords, properties, kinds and views
|
||||
Then defineKeywords adds a sequence ("SHOT LIT GRADED | APPROVED") with each word's state; defineProperty a
|
||||
property with a check; definePlanKind a kind (its keywords, required properties, a check, defaults an add
|
||||
starts with; a new task of the kind starts at its sequence's first word); defineView a view any page can
|
||||
build (view(plan, name)); createRegistry one of a plugin's own
|
||||
And checkPlan says what's wrong by those rules: ids used twice, failing properties, unknown kinds, missing
|
||||
properties, keywords outside a kind's sequence
|
||||
And board, agenda and outline are the views raea ships
|
||||
|
||||
@done
|
||||
Scenario: PL6b. React
|
||||
Then usePlan(text or source) gives the plan, its text and edit; useView a registered view; TaskLine, PlanOutline,
|
||||
Agenda and BoardLanes draw them, with toggled for a checkbox's edit
|
||||
And none of it uses a dynamic import or dangerouslySetInnerHTML, so raea's window bundle (one IIFE) holds it
|
||||
|
||||
Rule: PL7. An agent finishes what it planned
|
||||
# Shane, 2026-11-16: "i notice often that it makes tasks but never completes them itself". His plans that morning:
|
||||
# TarotChess's agent posted a first pass and left its own follow-ups TODO (frame rate, a clipping score, a dark
|
||||
# encode); Cadence's said "all six masters are finished and posted" over a plan still saying Track MAKING and Build,
|
||||
# Render and Masters TODO (it had woken itself on a render's report, a turn raea sends no plan with); v0.1.5's
|
||||
# closed five tasks with every checkbox unticked, so the list read 0/4 on finished work; and its last turn ended
|
||||
# with Film v2's tasks MAKING, "waiting on three helpers", when the session stopped under them. Nothing asked any
|
||||
# of them to go on: only a /goal does that, and only when the person sets one.
|
||||
|
||||
@done
|
||||
Scenario: PL7a. Each time an agent stops with tasks of its own open, raea asks it to settle them
|
||||
Given a chat in a project whose agent's turn ends (apps/app src/plan/PlanKeeper.tsx, beside GoalKeeper)
|
||||
And tasks of its own are TODO or MAKING in the plan, read from the file first
|
||||
Then raea's next turn to it lists them by id ("[raea plan] Ask N: ...") and says how each is settled: closed with
|
||||
the item it made, done now and closed, REVIEW saying what it needs from the person, dropped with why, or a
|
||||
line starting "WAITING:" naming the job of its own that will report back
|
||||
And it asks again each time the agent stops while one is TODO or MAKING; REVIEW is the person's, and ends it
|
||||
And the rule each turn carries says the same: finish what you planned; before you stop, every task of yours is
|
||||
closed, REVIEW or waiting on a job; close what a job finished when it reports back in a turn you started
|
||||
|
||||
@done
|
||||
Scenario: PL7b. The asks stop
|
||||
Then they stop when none of its tasks is TODO or MAKING, or pause, saying why, when the person presses Stop, its
|
||||
session closes or the turn fails, its reply has a WAITING: line, two asks in a row leave the plan as it was, or
|
||||
12 have gone since the person's last message
|
||||
And the person's next message starts them again from nothing, and Continue over the composer asks at once
|
||||
And a chat with an open /goal is the goal's: its checks keep it going, and the plan's asks wait until it's met
|
||||
|
||||
@done
|
||||
Scenario: PL7c. Which tasks are the agent's
|
||||
Then a task is the chat's when its agent (or the chat) holds it; or nobody holds it and it stands on an item the
|
||||
chat posted (its :ITEM:, or a note's item in its :FROM:: an agent writing plan.org by hand leaves :AGENT: out);
|
||||
or nobody holds it and it's MAKING while no other agent holds open work
|
||||
And a task nobody holds otherwise is the person's (written in the to-do list or Emacs, moved from a brief): never
|
||||
pushed on whoever is chatting; one SCHEDULED for a later day waits for that day
|
||||
|
||||
@done
|
||||
Scenario: PL7d. Done means its checkboxes and subtasks are done
|
||||
When an agent marks a task done (plan_close, or plan_update's state) while a checkbox under it is unticked or a
|
||||
subtask open, as Org's org-enforce-todo-dependencies refuses
|
||||
Then the tool refuses, naming each by its place or id, and nothing is written
|
||||
And plan_close with all: true ticks them and closes the subtasks with it; ticked in the same call, it closes
|
||||
And dropped closes whatever is under it as it is; the person's own check-off in the to-do list isn't refused
|
||||
|
||||
@done
|
||||
Scenario: PL7e. A post names what's still open
|
||||
Given an agent's feed_post in a project
|
||||
Then its answer carries the agent's open tasks and asks it to close what the post finished, with the item, so a
|
||||
turn the agent started itself (a job reporting back carries no plan) still closes them
|
||||
|
||||
@done
|
||||
Scenario: PL7f. Seen in the chat
|
||||
Then each ask is a small line of its own ("Finishing the plan (2): 3 open"), never the marker in the person's words
|
||||
And over the composer, while it asks or after it pauses with tasks open, one line: "Plan 3 of its tasks open",
|
||||
"Finishing · ask 2" with × to stop asking until the next message, or "Paused · Continue" with why on hover
|
||||
|
||||
@@ -247,3 +247,442 @@ Feature: React Three Fiber both ways: an R3F scene drawn by raea, a raea composi
|
||||
facing that light or sideways, as the hemisphere light is), and its constant band is scaled as three's
|
||||
irradiance is (0.886, where 0.282 made it a third as bright)
|
||||
And in-approx: SSIM 0.9848 (Phong's F0 is held at Bevy's highest, 0.16, so its orange highlight glints less)
|
||||
|
||||
@done
|
||||
Scenario: R3F15. What an R3F scene throws is the composition's error (#131)
|
||||
Given an <R3F> whose scene throws: rendering a component, in an effect, in a ref
|
||||
Then the frame throws it out of the <R3F> drawing it (src/input/session.ts: the scene under raea's own error
|
||||
boundary), so the render is refused naming it, exactly as a throw outside R3F is: "REFUSED the composition threw
|
||||
at frame 0: Error: ...", exit 1
|
||||
And never as R3F's own root reported it (reportError, else a stack without its message), the scene drawing nothing
|
||||
and the render ending with 0 errors
|
||||
And three's PMREMGenerator makes no GPU cube map in raea (src/input/pmrem.ts): fromEquirectangular of a panorama
|
||||
raea loads is that panorama, lighting the scene as scene.environment does; fromScene (RoomEnvironment) and
|
||||
fromCubemap are left out with a warning naming them, the scene drawn without them
|
||||
And test/errors.test.tsx holds it
|
||||
|
||||
@done
|
||||
Scenario: R3F15b. three's RoomEnvironment lights an R3F scene (#165)
|
||||
Given an <R3F> scene whose scene.environment is new PMREMGenerator(gl).fromScene(new RoomEnvironment(), sigma)
|
||||
.texture, three's own recipe for soft studio light with no HDR file
|
||||
When raea renders it
|
||||
Then it is lit by the same room, made by raea's engine: <Environment room blur={sigma}>, which src/input/pmrem.ts
|
||||
and lights.ts make of it (its intensity, its turn about +Y, and as the background when the room is that too)
|
||||
And the room is three's (systems/environment room.rs): RoomEnvironment's boxes, light boxes and point light,
|
||||
each direction from fromScene's cube camera traced to what it hits and lit by three's formulas, blurred by
|
||||
sigma as fromScene blurs it, then filtered like any panorama
|
||||
And fromScene of any other scene, and fromCubemap, are still left out with a warning naming them
|
||||
And raea's own <Environment room> is drawn by three as RoomEnvironment through fromScene (src/three/scene.ts),
|
||||
and the source export writes it so (src/export/emit.ts)
|
||||
Status (11-16): done. The front face of #131's box, 136,76,58 before (no environment), is 255,189,155; three
|
||||
draws 255,195,160. Two grey boxes lit by the room alone at half intensity: 137 and 125 against three's 140 and
|
||||
127 (23 and 19 before). three's pixels come from test/room/three.ts, which runs three 0.185's PMREM (the room
|
||||
in its 256 cube, the GGX filter chain, textureCubeUV) and MeshStandardMaterial's shading on the CPU, so the
|
||||
check needs no browser; test/room/check.sh renders test/room/room.tsx and holds each pixel within 8 levels.
|
||||
The room's light at 14 directions matches three's own RoomEnvironment object to 1e-3 (room.rs tests); Bevy's
|
||||
filter in place of three's PMREM puts the rest within 3 to 6 levels. Not done: fromScene's options.position
|
||||
(a cube camera away from the origin) is drawn from the origin, with a warning
|
||||
|
||||
Rule: What three.js work online is made of draws in raea (0.1.5)
|
||||
|
||||
Goal, 2026-11-15: "ship all of this in 0.1.5". An audit that day rendered 25 probes of what people post online made
|
||||
with three.js and R3F (TSL compute particles, render targets, plain three.js with its own renderer, drei's showpiece
|
||||
helpers, postprocessing) through 0.1.4's <R3F>: six refused the render, five drew wrong, moving instances cost a
|
||||
mesh a copy, and the raea skill told agents R3F doesn't exist here. Each scenario below is one of those, held by a
|
||||
case in test/parity (SSIM against three.js in Chrome, R3F8) or a test that refuses the old behaviour.
|
||||
|
||||
@done
|
||||
Scenario: R3F16. What three can't draw in raea is named and drawn, never refused
|
||||
Given an <R3F> scene with any of: a TSL node material on an InstancedMesh, a compute dispatched through `gl.compute`,
|
||||
drei's <MeshReflectorMaterial>, drei's <Environment> with children (Lightformers), drei's <Stars>, drei's <Clouds>
|
||||
When raea renders it
|
||||
Then the render isn't refused for what raea's stand-in renderer lacks: it answers what three's renderers ask as they
|
||||
draw (a WebGPU backend's device limits, WebGLRenderer's `state`, `compute`, a CubeCamera's coordinate system)
|
||||
And what raea can't draw yet is named once in a warning and drawn as the documented fallback (flat, or its base
|
||||
material), the rest of the scene drawn as three would
|
||||
And a ShaderMaterial on Points (drei's <Stars>) draws its points with its shader
|
||||
And a texture three loads from an http(s) URL is fetched through raea's cache, never read as a path in the project
|
||||
And test/errors.test.tsx renders each of the six without a refusal
|
||||
Status (11-15): session.ts's stand-in WebGLRenderer answers coordinateSystem (WebGL's), `state` (an inert GL state:
|
||||
every call does nothing), `extensions`, a full `info`, and takes `compute`/`computeAsync` into gl.__raea.computes
|
||||
(warned once: R3F22 runs them); tsl.ts's stand-in WebGPURenderer has a backend device with wgpu's limits, any Error
|
||||
building a graph is named and the material drawn flat, and a graph reading an attribute the drawn mesh can't carry
|
||||
(an InstancedMesh's matrices past 1,024 copies, an InstancedBufferAttribute) is refused there, not by the engine;
|
||||
shader.ts gives a sampler2D the material never sets a 1x1 opaque black picture (WebGL's unbound read); texture.ts
|
||||
fetches an http(s) picture through raea's cache (`asset.load`). The six probes from the audit render (stars, clouds with the CDN's cloud.png, the
|
||||
reflector's plane as its base material, Environment+Lightformer without the cube map, TSL on 100 and 2,000
|
||||
copies, gl.compute), each named; test/errors.test.tsx 10/10
|
||||
|
||||
@done
|
||||
Scenario: R3F17. A sky at three's far plane is drawn behind the scene
|
||||
Given a shader that puts its vertices on the far plane as three does (`gl_Position.z = gl_Position.w`, drei's and
|
||||
three's <Sky>, any skybox ShaderMaterial), or a node material's WGSL doing the same
|
||||
When raea translates it (Bevy's projection is reverse-Z: the far plane is z = 0)
|
||||
Then it is written onto reverse-Z's far plane, so the scene in front of it shows
|
||||
And in-sky (three's Sky behind a box): SSIM at least 0.92 against three.js
|
||||
Status (11-15): shader.ts farPlane() rewrites `X.z = X.w;` and `gl_Position = X.xyww;` to z = 0 in a ShaderMaterial's
|
||||
vertex GLSL and in a node material's vertex WGSL (material.ts, on the part tsl.ts makes); in-sky SSIM 0.9986 (in-shader 0.9935, in-drei 0.9932,
|
||||
in-approx 0.9848 unchanged); test/errors.test.tsx holds the rewrite
|
||||
|
||||
@done
|
||||
Scenario: R3F18. Agents are taught <R3F>
|
||||
Given the raea skill (raea-skills skills/raea) and its source guides (sdk/guides/craft/bevy)
|
||||
When an agent reads what 3D in raea can be written with
|
||||
Then 3d/r3f.md says when to use <R3F> (an R3F or three.js scene, drei, postprocessing, GLSL or TSL shaders), how to
|
||||
set up a project for it, what draws exactly, what differs, and what raea's own parts do better
|
||||
And the lines saying useFrame, refs and drei "don't exist" say instead that they don't exist in raea's own 3D parts
|
||||
and do inside <R3F>
|
||||
And SKILL.md's router sends an agent with three.js or R3F code to 3d/r3f.md
|
||||
Status (11-15): sdk/guides/craft/bevy/r3f.md, copied as the skill's 3d/r3f.md (raea-skills #81, pinned at
|
||||
89ab557): when to use <R3F> and <Three program>, the project set-up (raea add three @react-three/fiber), an
|
||||
example of each, how their loops are stepped from the frame, what draws (by kind, the postprocessing effects
|
||||
raea has) and what doesn't yet, each named once in a render's output. bevy.md's router, the skill's 3d.md and
|
||||
SKILL.md route three.js work to it; the four lines (bevy.md and 3d.md's rule 1, bevy/scene.md, bevy/animation.md,
|
||||
bevy/limits.md) say useFrame, refs and drei don't drive raea's own components and work inside <R3F>. Landed
|
||||
1f02317e8.
|
||||
|
||||
@done
|
||||
Scenario: R3F19. Plain three.js with its own renderer
|
||||
Given a composition whose three.js code makes its own renderer, as single-file demos do: `new
|
||||
THREE.WebGLRenderer({ canvas })` or three/webgpu's `WebGPURenderer`, a scene and camera, `renderer.render(scene,
|
||||
camera)` from `setAnimationLoop` or requestAnimationFrame, `document.body.appendChild(renderer.domElement)`
|
||||
When raea renders or plays it
|
||||
Then raea's bundler gives it a renderer that draws nothing and records what it was asked to render, and each frame
|
||||
that scene is drawn by raea's engine as <R3F>'s scene is, in the canvas's box
|
||||
And its animation loop steps 1/fps a frame from the composition's frame (render equals play)
|
||||
And in-vanilla (a plain three.js page): SSIM at least 0.92 against the same page in Chrome
|
||||
Status (11-15): `<Three program={fn}>` (raea/r3f, src/input/Three.tsx, program.ts): fn is the page's script as a
|
||||
function given a canvas. engine/bundle edit.rs resolves `three` and `three/webgpu` imported by the edit's own
|
||||
code (src/, ext/ of the work folder; never the SDK's copies, so the playable host keeps three's real renderer) to
|
||||
the r3f copy's vanilla.ts and vanilla-webgpu.ts: three re-exported, its renderer a class whose constructor
|
||||
returns R3F's stand-in (renderer.ts, moved out of session.ts with the seeded random in seed.ts, so a
|
||||
composition's three needs nothing of React Three Fiber's) wrapped to record a render to the screen and the
|
||||
animation loop into the program running it. Each frame steps its loops and requestAnimationFrame callbacks at
|
||||
i*1000/fps ms with performance.now() at that time and Math.random seeded by the <Three>'s key; a frame before
|
||||
the last runs it again; an async program (await renderer.init()) holds raea's frame and steps from 0 once ready;
|
||||
a full-screen pass to the screen (EffectComposer's quad) draws the scene it rendered. test/program.test.ts 7/7,
|
||||
edit.rs's own-code test; in-vanilla (test/parity/programs.ts: a knot, a ring of boxes, a sun and shadows, turned
|
||||
by the loop's time and by += a call) SSIM 0.9921, and the R3F cases whose `three` is now the stand-in 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).
|
||||
|
||||
@done
|
||||
Scenario: R3F20. An InstancedMesh's moving copies are one instance buffer a frame
|
||||
Given an InstancedMesh whose matrices or colours change every frame (a field of 20,000 copies moved in useFrame)
|
||||
When raea draws it
|
||||
Then its copies are one row drawn by Bevy's instancing, their transforms and colours that frame's buffer, never a
|
||||
mesh a copy
|
||||
And 20,000 moving copies at 640x360 take at most 100 ms a frame (0.1.4: 1,220 ms), 2,000 at most 40 ms (0.1.4: 94)
|
||||
And in-instanced (2,000 moving copies with colours): SSIM at least 0.92 against three.js
|
||||
# The plan (r3f-gpu, 11-15). 0.1.4's cost is each copy a Mesh with its own BufferMesh: 20,000 copies of a box's
|
||||
# arrays as JSON a frame. raea's <Instances> already moves a set frame by frame (its data-at list a frame, the
|
||||
# row's inst_all/inst_k, scene3d's sync_instances: one entity a copy sharing the mesh and material, which Bevy's
|
||||
# automatic batching draws as one instanced call), so the frame's buffer is one column holding that frame's list,
|
||||
# not keyed columns per copy. What it lacks is a colour a copy, and a list that isn't text parsed every frame.
|
||||
# R3F20a. raea/3d <Instances>: an Instance takes `color` (a hex string, or linear [r, g, b]), multiplied with the
|
||||
# material's as three's instanceColor is; a set with colours packs 12 numbers a copy, written as data-at
|
||||
# {"stride":12,"at":[...]}; runtime/look's inst column is then 13 numbers a copy (placement, linear rgb) with
|
||||
# inst_tint 1. scene3d: a tinted set's copies share one TintMaterial (raea-sys-material tint.rs: the standard
|
||||
# material extended by a storage buffer of the copies' colours, read by the copy's MeshTag above the two bits
|
||||
# compose's pass keeps), the buffer rewritten when the frame's list changes; the parent's standard material
|
||||
# copied into its base when it changes (sync_meshes recolours the set as before). compose's sync_passes keeps
|
||||
# a tag's high bits.
|
||||
# R3F20b. sdk/r3f scene.ts: an InstancedMesh with a standard surface is always one <Instances>, still or moving,
|
||||
# coloured or not: its copies from the instance matrices (instanceMatrix.count of them, those past `count` at
|
||||
# scale 1e-6 so the count holds), instanceColor as each copy's colour. A ShaderMaterial or several materials
|
||||
# keep the mesh-a-copy path.
|
||||
# R3F20c. Speed: each render list parsed once into transforms (scene3d Placements), not each frame it shows;
|
||||
# look packs without reformatting text where it can. Measured before and after on 2k and 20k (probes
|
||||
# inst-2k-48f, inst-20k-48f), with RAEA_FRAME_LOG's react/sync/draw split.
|
||||
# R3F20d. in-instanced in test/parity (2,000 moving copies with colours under a directional light), SSIM >= 0.92.
|
||||
Status (11-15): built as planned, the coloured list 13 numbers a copy (placement, linear rgb). scene.ts sends
|
||||
every InstancedMesh with a standard surface as one <Instances>; raea/3d's Instance takes `color`; runtime/look
|
||||
reads data-at as plain numbers; scene3d's copies of a coloured set share one TintMaterial (raea-sys-material
|
||||
tint.rs) whose ShaderBuffer of colours is written in place each frame, each copy's MeshTag its number above
|
||||
compose's pass bits (sync_passes keeps them). A list is still text parsed once each frame it shows (R3F20c's
|
||||
parse-once gave nothing for a list that changes every frame). Measured on this Mac with test/parity/speed.tsx,
|
||||
48 frames at 640x360 (0.1.4 in brackets): 2,000 moving copies 25.5 ms a frame (94), 20,000 41.9 ms (1,220);
|
||||
coloured every frame, 43.7 and 74.6 ms, of which the TintMaterial's pipeline is 0.5 to 0.7 s on the first
|
||||
frame (steady frames 10.5 and 46.8 ms). in-instanced SSIM 0.9819; in-things and in-basic unchanged (0.9917);
|
||||
a plain <Instances> scene (bench/rerender shot-1, shot-2) the same as 0.1.4's (SSIM 0.99999, 1). Tests:
|
||||
conformance instances (12 numbers a copy), runtime/look a_colour_a_copy, tint's tag bits, test/input.test.tsx
|
||||
(moving and coloured copies stay one Instances; a ShaderMaterial is a mesh a copy), test/instances.test.tsx (the
|
||||
three.js host's instanceColor).
|
||||
|
||||
@done
|
||||
Scenario: R3F21. A lit TSL node material is lit by the scene's lights
|
||||
Given the plan
|
||||
| crate | file | lines | job |
|
||||
| raea-sys-three-shader | systems/three-shader/src/surface.rs | 90 | the lit fragment entry: three's surface as Bevy's PbrInput, lit |
|
||||
| sdk/r3f | sdk/r3f/src/input/tsl-lit.ts | 85 | three's builder writing the surface, the lit contract |
|
||||
And a MeshStandardNodeMaterial or MeshPhysicalNodeMaterial (or a Lambert, Phong or toon one) with nodes of its
|
||||
own (colorNode, positionNode, normalNode, roughnessNode, metalnessNode, emissiveNode, opacityNode)
|
||||
When raea draws it
|
||||
Then three's builder writes its surface with no lights of three's: its output (three's `context.getOutput`) is
|
||||
the colour and opacity, the view-space normal and roughness three lights with, the emission and metalness, and
|
||||
the point in world space after positionNode, returned by the fragment stage as `three_surface` (tsl-lit.ts)
|
||||
And three-shader's lit entry makes Bevy's PbrInput of it and runs the standard material's lighting, fog and tone
|
||||
mapping (surface.rs): lit by Bevy's lights and shadows as raea's StandardMaterial is, in three-shader's own
|
||||
material rather than SH1's ShaderExt, so the vertex stage is three's (positionNode moves it) and its uniforms
|
||||
have 254 slots, not 16
|
||||
And a Lambert surface is fully rough and Phong's shininess a roughness, neither metal; a basic, shadow or volume
|
||||
node material, or one with a fragmentNode, keeps three's own output
|
||||
And in-tsl-lit (a noise-displaced, noise-coloured icosahedron under a directional light): SSIM at least 0.92
|
||||
And the status, 2026-11-15: built as planned. in-tsl-lit SSIM 0.9906 against three.js (WebGPURenderer, its WebGL 2
|
||||
backend) in Chrome at frame 12, where 0.1.4 drew the same blob black (the 11-15 audit's tsl-displace). Proof:
|
||||
sdk/r3f test/tsl.test.ts (the lit contract: three_surface returns base, normal, emissive and world, no three
|
||||
light code in the graph, the instance carried flat; a Lambert surface rough and unmetallic) and
|
||||
raea-sys-three-shader's surface test; tools/parity.sh runs in-tsl-lit. A displaced mesh's shadow is still its
|
||||
undisplaced shape (three-shader's shadow pass is the standard one), and a fragmentNode keeps three's output
|
||||
|
||||
@done
|
||||
Scenario: R3F22. TSL compute and storage buffers
|
||||
Given the plan
|
||||
| crate | file | lines | job |
|
||||
| raea-sys-shader | systems/shader/src/shared.rs | 130 | storage buffers shared by key, kept, reset to their first contents |
|
||||
| raea-sys-compute | systems/compute/src/three.rs | 220 | three's kernels: the frame's dispatches run once, in order |
|
||||
| raea-sys-three-shader | systems/three-shader/src/storage.rs | 200 | a node material's storage reads; a mesh drawn as copies |
|
||||
| sdk/r3f | sdk/r3f/src/input/tsl-compute.ts | 200 | a ComputeNode's WGSL, each dispatch recorded, the Compute part |
|
||||
| sdk/r3f | sdk/r3f/src/input/tsl-storage.ts | 90 | a storage attribute's key; a material reading it |
|
||||
| sdk/r3f | sdk/r3f/src/input/tsl-instances.ts | 90 | a node material on an InstancedMesh as one mesh of copies |
|
||||
# The plan (r3f-tsl, 11-15). A composition with a compute row already steps every frame from 0, with a fresh App
|
||||
# on a seek back (runtime/plugins steps(): a compute isn't frame-pure; engine catch_up), so the engine runs each
|
||||
# frame's dispatches once, in order, and a still at frame F runs all of them. What's missing is three's WGSL as a
|
||||
# compute, buffers a compute and a material share, and the dispatches as a list a frame.
|
||||
# R3F22a. Engine, compute: a storage buffer shared by key (raea-sys-shader shared.rs: Bevy's ShaderBuffer, made
|
||||
# with its size and first contents, kept from frame to frame, reset to them; a 16-byte one for an empty slot).
|
||||
# A <Compute kernels> (three.rs): each kernel three's own WGSL, its `@group(0)` storage buffers keys of the
|
||||
# shared ones and its uniforms packed by the struct three declares (raea-sys-shader uniform_slots). Its keyed
|
||||
# `runs` column each frame: {epoch, seq, fresh, runs: [[kernel, [x, y, z], {UNIFORM: {field: value}}]]}
|
||||
# (seq: the session's parts in turn), run once for each (epoch, seq) in the frame's compute pass, a fresh one
|
||||
# (a new three session's first) resetting the buffers first; a run whose pipeline or buffer isn't on the GPU
|
||||
# yet is held, never dropped. The computes there are (game_of_life, compute_mesh, bevy-ts compute, sdk/web's)
|
||||
# are unchanged.
|
||||
# R3F22b. Engine, three shader: ThreeShader binds two read-only storage buffers (bindings 11 and 12, the empty
|
||||
# one when unused); a node material's spec lists `storage: [{name, key, size}]` and each stage's
|
||||
# `var<storage, read> NAME` takes its binding (storage.rs). A BufferMesh with `copies` (count, per-copy
|
||||
# attributes, matrices when not all identity) is repeated by fit_mesh count times, the copy's number in its own
|
||||
# attribute `tsl_copy`; such a mesh, and one reading storage, isn't frustum culled (its vertices are placed on
|
||||
# the GPU).
|
||||
# R3F22c. sdk/r3f, compute: a ComputeNode compiled by three's WGSLNodeBuilder against the stand-in, cached per
|
||||
# node and version; renderer.ts's compute and computeAsync (a node or a list) record its kernel, the dispatch
|
||||
# size as three's WebGPU backend works it out and its uniforms' values then (three's node updates, as a
|
||||
# material's); the walk empties gl.__raea.computes into one Compute part a frame (kernels, buffers, runs; the
|
||||
# stand-in's epoch; fresh on its first). <Three program>'s renderer is the same stand-in, so a program's
|
||||
# dispatches are drawn the same way.
|
||||
# R3F22d. sdk/r3f, materials: a storage binding in a node material (`.element(i)`) and an attribute three made of
|
||||
# a storage attribute (`.toAttribute()`) read the shared buffer by its attribute's key (tsl-storage.ts). A node
|
||||
# material on an InstancedMesh (or a Sprite with count above 1) is compiled for copies: three built with no
|
||||
# uniform room, so the copies' matrices and colours are attributes; instance_index is `tsl_copy`, the matrices
|
||||
# identity (baked into the copies), instanceColor and any other per-copy attribute the copy's own.
|
||||
# tsl-instances.ts's nodeInstancedParts makes the one mesh (cached on the geometry, count, instanceMatrix.version
|
||||
# and instanceColor's), undefined for what it doesn't take (several materials, GLSL), from scene.ts's
|
||||
# instancedParts before copyParts (agreed with r3f-gpu, 11-15).
|
||||
# R3F22e. in-tsl-particles: 65,536 particles in a disc, placed by an init compute and orbited each frame by an
|
||||
# update compute at a speed by radius, drawn as one InstancedMesh of small quads (positionNode their storage
|
||||
# position, colorNode a second buffer: one of four arms by the first angle, so the arms wind into a spiral only
|
||||
# if every frame's update ran), additive; against three.js's WebGL 2 backend in headless Chrome (as in-tsl-lit),
|
||||
# frame 12, SSIM at least 0.92.
|
||||
Given TSL storage (`instancedArray`, `storage`, `attributeArray`), compute nodes (`Fn(...)().compute(n)`) run with
|
||||
`gl.compute` / `computeAsync` in useFrame, and a material reading the buffers (`.element(instanceIndex)`,
|
||||
`.toAttribute()`) on an InstancedMesh, Points or Sprite
|
||||
When raea renders it
|
||||
Then each compute's WGSL (three's WGSLNodeBuilder) runs as a raea <Compute> once each frame it was dispatched, in
|
||||
the order dispatched, its storage buffers kept from frame to frame and shared with the materials that read them
|
||||
And a render that starts past frame 0 steps every compute from frame 0, so a render equals its play
|
||||
And in-tsl-particles (65,536 particles orbited by a compute): SSIM at least 0.92 against three.js on WebGPU
|
||||
And the status, 2026-11-15: built as planned, on an InstancedMesh. in-tsl-particles SSIM 0.9510 against three.js
|
||||
(WebGPURenderer, its WebGL 2 backend) in Chrome at frame 12: the init and every frame's update ran on raea's GPU
|
||||
(the arms wind into the same spiral), drawn as one mesh of 65,536 copies reading both buffers; in-tsl-lit 0.9906
|
||||
and in-shader 0.9935 unchanged. Two engine fixes came with it: runtime-scene keys a compute row's `kernels`,
|
||||
`shared` and `runs` frame by frame (it keyed only entry, bind and uniforms, so 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: Bevy blends AlphaMode::Add as premultiplied alpha, so three's additive overlaps,
|
||||
GLSL ShaderMaterials' too, drew as one layer). Proof: sdk/r3f test/compute.test.tsx (kernels, shared keys, runs
|
||||
once a frame with their uniforms, workgroups as three's backend, the copies mesh and its WGSL, the parity swirl),
|
||||
raea-sys-compute three.rs and three-shader storage.rs tests (runs packed once by (epoch, seq), copies repeated
|
||||
with their number, matrix and values), tools/parity.sh in-tsl-particles. Not yet: Points and a Sprite with a
|
||||
count (drawn as before), per-vertex storage reads, indirect dispatch, a compute first dispatched after frame 0
|
||||
(runtime-scene makes compute rows from the first frame's items), and a texture bound in a compute. Later the
|
||||
same day: an unlit node material's colour is tone-mapped by Bevy's own tone_mapping after the camera's colour
|
||||
grading (tone.wesl), as a lit or standard material's is, where it had a curve of three-shader's own without
|
||||
the Grade exposure that stands for three's ACES 1/0.6 (R3F25), so it came out darker and redder:
|
||||
in-tsl-particles 0.9799 (it was 0.9510, the "saturation" was this), and in-tsl-fbo, a node material reading a
|
||||
target raea draws on its GPU (flipsY, onGpu), 0.9397 (0.9125 before); in-tsl-lit, in-lettra, in-tslpost and
|
||||
in-tslpost2 unchanged, in-lettrafx 0.9890 (0.9855 on main without it, its last glyph mid-wipe narrower)
|
||||
|
||||
@done
|
||||
Scenario: R3F23. Render targets are drawn on the GPU
|
||||
Given what an app draws into a render target itself (`gl.setRenderTarget(t); gl.render(scene, camera)`, drei's
|
||||
useFBO, <RenderTexture>, <MeshReflectorMaterial>, <MeshPortalMaterial>, three's GPUComputationRenderer, a
|
||||
ping-pong between two targets, a feedback or trail effect)
|
||||
When raea draws it
|
||||
Then that render is a camera of raea's engine drawing that scene into an image the frame's materials read the
|
||||
target's texture as, before the cameras that read it, in the order the app drew them
|
||||
And a fullscreen quad drawn into a target (a GPGPU pass, a blur) is that quad's shader run into the image
|
||||
And in-fbo, in-pingpong (a GPUComputationRenderer wave) and in-reflector: SSIM at least 0.92 against three.js
|
||||
# The plan (r3f-gpu, 11-15). The engine already draws more than one camera (the camera rows cam, cam1, ...: each
|
||||
# with its order, clear and layers, runtime/look camera.rs, raea-sys-frame camera_pass) and names images cameras
|
||||
# draw into ("render:NAME:WxH", runtime/plugins fields.rs, RenderImages), which a three shader's texture reads.
|
||||
# What's missing is a camera row drawing into one of them, and a standard material's map reading one.
|
||||
# R3F23a. Engine: a camera row's `target` ("render:NAME:WxH", or ":float" after it for an Rgba16Float image a
|
||||
# GPGPU pass needs) puts the camera on that image (RenderTarget::Image), cleared to its own `bg` (rgba) or not
|
||||
# (`clear` none), not tone-mapped (three writes a target linear), drawing only its `layers`; `order` puts it
|
||||
# before the cameras that read it. A mesh row's maps read "render:NAME" as that image (maps.rs through
|
||||
# RenderImages). raea/3d's cameras take `target` and `layers`.
|
||||
# R3F23b. sdk/r3f: session.ts's `render` while a target is set records a pass {target, scene, camera, clear}
|
||||
# in draw order (gl.__raea.passes, emptied as each frame steps; agreed with lane r3f, 11-15). targets.ts
|
||||
# keeps the CPU passes it does (<ContactShadows>' depth and blur); every other pass becomes its scene's parts
|
||||
# (scene.ts's walk) on a layer of its own, and its camera as a camera part with target
|
||||
# "render:<target uuid>:WxH" (":float" for a Float or HalfFloat target), order before the scene's camera by
|
||||
# draw order, clear the pass scene's background or the renderer's clear colour. A texture whose source is a
|
||||
# target (srcOf, a material's map, a ShaderMaterial's sampler uniform) is "render:<target uuid>".
|
||||
# R3F23c. Ping-pong and feedback: two targets swapped frame by frame are two cameras each drawn on its frames
|
||||
# (`active` false on the others) and a texture that names the frame's; the images last from frame to frame.
|
||||
# A render that starts past frame 0 (a still) steps the passes from frame 0 as R3F22 steps computes (shared
|
||||
# with lane r3f-tsl).
|
||||
# R3F23d. in-fbo (the audit's fbo probe: a torus knot drawn into a useFBO shown on a plane), in-pingpong
|
||||
# (GPUComputationRenderer's wave), in-reflector (<MeshReflectorMaterial>: its mirrored camera's pass, its
|
||||
# blur, and its material's projective read; the read is an onBeforeCompile patch, so it lands with R3F24).
|
||||
# Status (11-15): R3F23a and R3F23b written, unit-tested and in the tree. The engine's camera into an image is a
|
||||
# "rendercam" row (raea-runtime-look rendercam.rs: its image in `into`, since a live row's `target` names the row
|
||||
# a component is on; `on` keyed by step; the ambient light on its own layers, the screen camera's likewise), spawned
|
||||
# by raea-render's render_camera (raea-sys-frame camera.rs into_image: IntoImage, no MSAA or dither, Hdr for a
|
||||
# float image); every "render:" source resolves through raea-sys-frame's render_image.rs. sdk/r3f: a target is
|
||||
# named "render:<texture uuid>@WxH:WxH" (a resized target is a new image), counted as drawn on the GPU once a pass
|
||||
# drew into it (targets.ts onGpu: three's PMREM stand-in isn't), read with v turned over as a flipY picture is
|
||||
# (texture.ts flipsY: scene.ts, shader.ts; tsl.ts's node textures next); a pass is recorded on the renderer that
|
||||
# drew it (targets.ts renderInto, its __raea.passes, emptied by step() as session.ts and program.ts step a frame),
|
||||
# its parts taken when it's drawn (two passes of one quad with another uniform each keep their own), and cube or
|
||||
# 3D targets stay left out. in-fbo (test/parity/targets.tsx, R3F_CASES="in-fbo:12" until tools/parity.sh lists
|
||||
# it): SSIM 0.9557 against three.js at frame 12. What's left of the gap is the unlit plane showing the target, drawn
|
||||
# without three's ACES 1/0.6 (Bevy's Exposure scales lit shading only; a plain meshBasicMaterial is as far off): the
|
||||
# pass itself matches (a pass camera keeps ev100 9.7, as three's linear pass is lit).
|
||||
# Status (11-15, later): R3F23c built. A pass is keyed by its target, what it drew (its scene and the lone mesh's
|
||||
# material) and its count, so GPUComputationRenderer's start and step passes into each of its two targets keep their
|
||||
# own layer and camera frame to frame. A material's texture follows the target drawn this frame: a map naming render
|
||||
# images is keyed (maps, map_k; raea-sys-rendermap), a ShaderMaterial's (and a node material's) through its
|
||||
# three:uniforms rows (three-shader's patch, by texture name). A three shader drawn into a target writes its colour as
|
||||
# it is (output "target": three tone-maps and encodes only what it draws to the screen). A still with a camera into a
|
||||
# render image steps every frame before it (runtime-scene carries_state), so a start drawn at frame 0 is there at 12.
|
||||
# Two fixes on the way: the engine's load empties its render images before its rows spawn (runtime/plugins emptied
|
||||
# them after, so a three:uniforms row made a second, blank image under the same name and every ShaderMaterial read a
|
||||
# target as black), and a flipY=false DataTexture keeps its rows in order (texture.ts bytesOf turned it upside down,
|
||||
# on maps and in shaders). R3F23d: in-fbo 0.9941 and in-pingpong 0.9949 against three.js at frame 12, both in
|
||||
# tools/parity.sh; the full list of 38 passes. Left: in-reflector, whose material's projective read is an
|
||||
# onBeforeCompile patch (R3F24).
|
||||
# Status (11-15, done): in-reflector 0.9256 (test/parity/patched.tsx, in tools/parity.sh) with R3F24's patched
|
||||
# program. Its mirrored camera copies the screen camera's projection into a camera of its own (fov 50, aspect 1 as
|
||||
# made), so a pass camera's lens is now its projection matrix's (passes.ts lensOf: fov, and its aspect where that
|
||||
# isn't the target's shape), kept by the engine whatever the image's shape (a rendercam's `aspect`, matchmove's
|
||||
# OffAxis). What's left of the gap is the floor, which raea lights lighter than three wherever it is that dark: a
|
||||
# plain MeshStandardMaterial of the patch's colour reads (11, 12, 13) against three's (6, 7, 9), as the reflector does.
|
||||
|
||||
@done
|
||||
Scenario: R3F24. onBeforeCompile patches
|
||||
Given a material patched by onBeforeCompile (drei's MeshWobbleMaterial and MeshDistortMaterial, a patched
|
||||
MeshStandardMaterial's vertex displacement)
|
||||
When raea draws it
|
||||
Then the patched GLSL is what runs: three's program for that material with the patch applied, translated as R3F11's
|
||||
And in-patched: SSIM at least 0.92 against three.js
|
||||
Status (11-15): built. A MeshStandardMaterial or MeshPhysicalMaterial with an onBeforeCompile of its own is three's
|
||||
ShaderLib program handed to it as three hands it (src/input/patched.ts): the material's defines and cloned
|
||||
uniforms, patched once a program (again when its version or customProgramCacheKey changes, as three recompiles),
|
||||
so a uniform the patch shares (drei's time) or one an app keeps from the patch (userData.shader) is read each
|
||||
frame; the material's own values refreshed into it each frame as three's renderer does; the defines three's
|
||||
WebGLProgram puts in front for its maps (map, alpha, emissive, roughness, metalness, normal, bump and
|
||||
displacement), sides, vertex colours and alpha test, and its light counts at 0. Its lighting is Bevy's, as a lit
|
||||
TSL material's is (R3F21): the fragment is cut at <lights_physical_fragment> and writes base, normal and
|
||||
roughness, emission and metalness, and the point in world space to four outputs, which raea-sys-three-shader's
|
||||
lit GLSL stage returns as its surface (glsl.rs Source lit). A patch past the cut (the light, the output colour)
|
||||
is named once and left out; so are aoMap and lightMap, and a physical material's sheen, clearcoat and
|
||||
transmission. in-patched 0.9717 (drei's MeshWobbleMaterial and MeshDistortMaterial and an app's own waves kept
|
||||
through userData.shader, lit by ambient and a sun) and in-reflector 0.9256 (R3F23), both in tools/parity.sh, and
|
||||
the full list of 41 passes, every other case as it was. On
|
||||
the way: the white picture a ShaderMaterial gets for a texture with no picture (shader.ts WHITE) was a broken
|
||||
PNG (its data cut short, its CRC wrong), so every material given it was refused and drawn in its colour; now a
|
||||
decoding one, tested. Tests: test/patched.test.ts (the patched program, patched once, its uniforms each frame,
|
||||
maps, a patch past the lights named), glsl.rs a_lit_stage_returns_its_surface, test/shader.test.ts (both
|
||||
stand-in pictures decode).
|
||||
|
||||
Scenario: R3F25. Post-processing: three's TSL passes and postprocessing's other effects
|
||||
Given three/webgpu's PostProcessing (`pass(scene, camera)` with bloom, GTAO, SSR, TRAA, DOF, film, ... nodes) or
|
||||
any effect @react-three/postprocessing exports
|
||||
When raea renders it
|
||||
Then each becomes raea's effect that does the same (Bloom, AmbientOcclusion, DepthOfField, AntiAliasing, the
|
||||
ray-traced reflections) or a <FramePass> raea ships for it: Noise, Scanline, Sepia, DotScreen, ColorAverage,
|
||||
ColorDepth, Grid, Glitch, ShockWave, TiltShift, ASCII, LUT, GodRays, Outline
|
||||
And none is left out without a warning; in-post2 and in-tslpost: SSIM at least 0.92 against three.js
|
||||
Status (11-15, in progress): postprocessing's Noise, Scanline, Sepia, DotScreen, ColorAverage, ColorDepth, Grid,
|
||||
Glitch, ShockWave, LUT3D and @react-three/postprocessing's ASCII and TiltShift2 are FramePasses with their own
|
||||
shaders in WGSL (sdk/r3f src/input/effects.ts, effects-sampled.ts); TiltShift (one Gaussian for its Kawase blur)
|
||||
and GodRays (the sun's disc against the depth prepass, unblurred) are close and say so. A FramePass's uv now spans
|
||||
the camera's Viewport, not the Engine's w x (h + 1) target (systems/framepass: patterns drifted a row by the
|
||||
frame's foot). three's tone exposure (toneMappingExposure, ACES's 1/0.6) is a Grade `exposure`, Bevy's colour
|
||||
grading on every pixel before the curve (new: grade_exposure), not the camera's, which skipped unlit colours (0.74
|
||||
stops dark under ACES) and made effects before a composer's ToneMapping read lit and unlit pixels in two scales.
|
||||
in-post2 0.9879, in-post3 0.9767; the full parity list unchanged. three/webgpu's PostProcessing (RenderPipeline):
|
||||
its render() hands the stand-in renderer a QuadMesh whose fragmentNode is the chain, read for its pass(scene,
|
||||
camera), which raea draws as the frame, and its nodes in the order the frame goes through them
|
||||
(src/input/tsl-post.ts): bloom as a Bloom added on top (new: Bloom `additive`, bloom_additive, Bevy's additive
|
||||
composite; three's UnrealBloom brightens where Bevy's natural bloom trades light), GTAO, DOF, FXAA, SMAA (TRAA as
|
||||
SMAA), SSAA and pixelation passes as raea's, film, dotScreen, rgbShift, chromaticAberration, lut3D, sepia and
|
||||
bleach as FramePasses doing what their setup() builds (effects-tsl.ts), the output's tone mapping and exposure as
|
||||
raea's; the other display nodes and an Fn of the app's own are named once (kinds.ts TSL_POST covers every node
|
||||
three ships). A FramePass's frame() read past the edge now takes the edge pixel, not the tag row under the
|
||||
Viewport. in-tslpost 0.9737 (bloom), in-tslpost2 0.9233 (sepia, chromatic aberration). Left: Outline (selected
|
||||
meshes in a composition pass, once scene.ts is free), Texture, Depth, LUT1D, and the background under a
|
||||
composer's or a PostProcessing's tone mapping (three maps it, raea shows it as given)
|
||||
Later (11-15): a scene drawn through a composer is drawn into its float buffer by three, where a ShaderMaterial's
|
||||
colour is scene light and its tone mapping and colour space includes do nothing; it went as "display" (the
|
||||
canvas's value), drawn darker and more saturated than three's, the composer's tone mapping and encoding never
|
||||
reaching it. It now goes as "linear" under a composer (shader.ts composing): in-shaderbloom (a ShaderMaterial
|
||||
and a faint bloom, test/parity/post2.tsx) 0.9758 to 0.9848, the ball's mean colour 133,66,33 to 186,135,96
|
||||
against three's 194,145,110. And the composer's own passes into its targets, which R3F23 drew on raea's GPU,
|
||||
aren't drawn under a composer raea draws as its effects (targets.ts passesOf keeps the passes whose pictures
|
||||
the frame reads): 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 none; a target the frame shows is still drawn (test/composer.test.tsx).
|
||||
in-post's frame is the same to the pixel; the full list of 42 passes
|
||||
|
||||
@done
|
||||
Scenario: R3F26. <R3F> in a box smaller than the page (#130)
|
||||
Given an <R3F> in a box of its own inside a larger page
|
||||
When raea draws it
|
||||
Then its camera's aspect and projection are the box's, centred on the box, as R3F's <Canvas> is in a browser
|
||||
And #130's five cases each draw the plane at its expected size and place
|
||||
Status (11-15): done. The cause was the engine's, not <R3F>'s: a camera in a page element (docs/sdk.feature S3a)
|
||||
is drawn as the element's box's own view (a SubCameraView: the box's size as the full view, offset by its
|
||||
place), but raea-render's tag_row_view gave every camera on the Engine's target a w x h Viewport on the frames
|
||||
before the page had laid the box out, and skipped a camera with a Viewport after that, so the box's view never
|
||||
came and the page's was cropped to the box (raea's own camera in a box too). The Viewport it gives is now taken
|
||||
off when a box comes (the new crate raea-sys-viewbox, with its tests). #130's cases: 600 x 600 at fov 90, 80 px
|
||||
centred in the box (was 120 px centred on the page); fov 32, 278 px (three: 279); 1080 x 1920, 80 px (was
|
||||
nothing); 2160 x 3840 with the box at (800, 1600), 80 px in the box. <R3F width height> (the box's size)
|
||||
makes R3F's own size, its camera's aspect and an orthographic camera's frame the box's: an orthographic plane
|
||||
R3F frames at zoom 40 is 80 px in a 400 x 300 box with them, 40 px without (R3F sizes it from the frame)
|
||||
|
||||
@done
|
||||
Scenario: R3F27. R3F's pointer events and controls in a live play
|
||||
Given an <R3F> in a game played live: meshes with onClick, onPointerOver, onPointerMove; drei's <OrbitControls>
|
||||
When the player moves and clicks the pointer over the 3D
|
||||
Then R3F's events fire on the mesh the pointer is over (raycast from raea's pointer through the <R3F>'s camera), and
|
||||
controls move the camera, while a render (no pointer) is unchanged
|
||||
And a recorded input log replays to the same frames
|
||||
Status (11-15): done. raea's input, frame by frame, is sent to R3F's canvas as the DOM events a browser would send
|
||||
(sdk/r3f src/input/pointer.ts): the move, the presses, a release and its click, the right button's context
|
||||
menu, the wheel, 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 (the renderer's domElement too), whose
|
||||
document gets the events that bubble, so R3F raycasts each through its camera and calls the handlers on the
|
||||
mesh it hits, and drei's <OrbitControls> (three-stdlib's, listening on the canvas and its document) turn and
|
||||
zoom the camera. A step sends its frame's events before it renders, inside flushSync, so what a handler sets is
|
||||
drawn that step; 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, as events3d picks), scaled to its width and height.
|
||||
Live play ran every composition on raea's lite runtime, which can't run R3F's reconciler: its bundle failed
|
||||
("use" isn't exported by lite), so an <R3F> never played live. An edit whose own sources import raea/r3f or
|
||||
@react-three/ now plays on React, as RAEA_LIVE_REACT=1 does (raea-runtime-live needs_react; an exported game
|
||||
the same). Measured: test/pointer.test.tsx 7/7 (over, down, a click with its point, out, a missed click; a drag
|
||||
turning OrbitControls' camera and the wheel moving it back; the same input stepped twice ends the same); a
|
||||
render with an input log: the ball hovered, clicked, and the box's <R3F> (400 x 400 at 100,100 of 600 x 600)
|
||||
the same; bench/render-play's new row sdk/r3f/test/live/pointer.tsx (hover, click, a drag on the empty frame)
|
||||
plays and renders the same frames, 1.000000 at frames 6, 12, 18 and 27, and the whole bench 13 of 13 at
|
||||
1.000000. Not yet: a double click, touches as pointers, a timeline baked for the player (raea-runtime-bake
|
||||
bakes on the lite runtime)
|
||||
@@ -0,0 +1,294 @@
|
||||
@spec
|
||||
Feature: Scene: a feed item that is raea 3D looked at from inside
|
||||
Shane, 2026-11-13: "create one new feed 'scene' which allow you to look inside a raea 3d scene and a 'storyboard' of
|
||||
them or a grid of props, characters or anything you might want to inspect, comment on or anything. this is critical
|
||||
that this is a highly intentional but minimalist way to inspect a scene with a timeline unless its just static or a
|
||||
prop and be able to actually move around in the scene, make comments in 3d space, and possibly move, rotate and
|
||||
scale objects in the scene unless they are procedural to which we might need an item details panel that has
|
||||
components that are procedural show up with those props. A big part of this is being able to highlight a problem
|
||||
with the mesh, maybe how the shader looks or a clipping or artifact problem. being able to even stage the scene by
|
||||
drawing components in 3d space or adjust motion trajectories like i would a spline." Later the same day: "timeline
|
||||
should be same sdk and components we use for watch", and it is for v0.1.4.
|
||||
|
||||
What there was (read 11-13): a 3D scene reached the feed only as a render (watch), a still (look) or a game (play).
|
||||
The preview pages (docs/preview.feature) had the pieces under them: the stage picks 3D parts and answers where
|
||||
points of the scene are on the picture, a free camera, a part's JSX read and set where it is written. None of it was
|
||||
a thing an agent could post for the person to walk around in, and nothing moved a part, drew one or touched motion.
|
||||
|
||||
The item:
|
||||
- `scene` is a feed item type. Its entries are files the stage can open: a 3D composition's .tsx, a component's
|
||||
.tsx (a prop, a character), a model, a splat. One entry opens straight into the inspector; several are a board
|
||||
first.
|
||||
- The file is the document. Every change made in the inspector is written into the scene's own code, in the form
|
||||
it is already written in, with Undo. Nothing is kept beside it.
|
||||
- Only what matters now is on the picture: the scene, the one toolbar, and the timeline when time is part of it.
|
||||
A picked part brings its card; a tool brings its own marks. Cruft is clutter (Shane, 11-13): everything a
|
||||
person can do is a tool in the side toolbar, where they look for it, and what a thing is is said in its tooltip,
|
||||
not in words on the picture.
|
||||
|
||||
Background:
|
||||
Given the app's code is apps/app (raea-feed): src/scene, src/detail/views/Scene.tsx, host/scene, samples/scene
|
||||
And the inspector is built on stage.show, stage.pick, stage.view, stage.locate, stage.seek and stage.play as
|
||||
docs/preview.feature PV1 left them, and on three calls added for it (raea-sys-hold, raea-runtime-live
|
||||
pick3d.rs, raea-page-stage): stage.part (where a part stands), stage.hold (a part drawn where a drag has it)
|
||||
and stage.wire (wireframe). On a raea without them it still works: handles from the code's numbers, no live
|
||||
drag, and Wireframe says it can't yet
|
||||
And everything the inspector knows of the camera is where points of the scene are on the picture (stage.locate):
|
||||
a plane of the scene is mapped to the picture by a homography from four of its points (src/scene/math.ts), so a
|
||||
drag is read in true metres from the scene's own camera as from a free one, whatever lens the scene wrote
|
||||
|
||||
Rule: SF1. The item, its board and how it is posted
|
||||
# Status 11-13: built on raea-feed branch scene. feed_post { type: "scene", file, files?, names? } (host/acp/hub.ts
|
||||
# scenePost: each file stays where it is and is checked to be one the stage opens); `raea show` posts models, or
|
||||
# several 3D files, as a scene (host/show.ts typeOf); the built-in world has one (i-set: samples/scene room.tsx,
|
||||
# crate.tsx, lamp.tsx). Checked in Chrome (e2e/scene.spec.ts) and in raea's headless window: the card's stills, the
|
||||
# board, an entry opened, Esc back to the board and then the feed.
|
||||
|
||||
@done
|
||||
Scenario: SF1a. One scene, or a board of them
|
||||
Given a scene item with one entry
|
||||
Then it opens in the inspector
|
||||
Given one with several (a storyboard's shots, a grid of props or characters)
|
||||
Then it opens on a board: each entry's still, its name, what the poster called it, and its open comments' count;
|
||||
shots are numbered in order
|
||||
And a click opens an entry, B or Esc goes back to the board, Esc again to the feed
|
||||
And the feed's card is the first four stills
|
||||
|
||||
@done
|
||||
Scenario: SF1b. Posting one
|
||||
Then an agent posts it with feed_post type scene (file, and files for a board, names for what each is called)
|
||||
And `raea show` of a model, or of several 3D files, shows them as a scene
|
||||
And an item written into a project's .raea/feed with type scene and entries is drawn the same
|
||||
|
||||
Rule: SF2. Looking around, with a timeline only when there is time
|
||||
# Status 11-13: built (src/scene/Inspector.tsx; the camera is an orbit about a target, math.ts turned, slid,
|
||||
# dollied, walked, framed, between). Checked in the headless window on the sample room: a drag turned the view, the
|
||||
# wheel moved out, F came back, a timed scene played and a press on the strip went to 0:01.5 with the ball mid-arc;
|
||||
# a prop alone had no strip.
|
||||
|
||||
@done
|
||||
Scenario: SF2a. Moving through the scene
|
||||
When the pointer is at rest (no other tool on)
|
||||
Then a drag turns the view about what it looks at, Shift-drag slides it, the wheel moves in and out, the arrow
|
||||
keys walk along the ground the way the camera faces, Page Up and Page Down rise and sink
|
||||
And Alt-drag or the right button does the same from any tool
|
||||
And F frames the picked part, or with none goes back to the scene's own camera; a double click does too
|
||||
And the scene opens on its own camera, as its author framed it
|
||||
|
||||
@done
|
||||
Scenario: SF2d. The tools' bar
|
||||
Then the side toolbar holds every tool: Look, Comment, Draw, Path, Check, Wireframe, Quality, and Board on an
|
||||
item with several entries; Move, Rotate and Scale stand in it only while a part a hand can change is picked
|
||||
And each says what it does and its key in its tooltip, as do the handles, the keys, the card's rows and buttons
|
||||
and the kinds of problem a comment can mark
|
||||
|
||||
@done
|
||||
Scenario: SF2e. The view has a toolbar of its own
|
||||
# Shane, 11-13: "lets have separated toolbars for movement controls and maybe some kind of hint if movement
|
||||
# controls have a shortcut by putting it in the tooltip". src/scene/NavBar.tsx, on the stage's right edge.
|
||||
Then across from the tools is the view's bar: Orbit (1), Pan (2) and Zoom (3) set what a plain drag does, Frame
|
||||
(F) goes onto the picked part or the whole scene, and the scene's camera (0) goes back to the shot as written
|
||||
And each tooltip says its key and the gesture that does the same from any mode (Shift-drag slides, scrolling
|
||||
moves in and out, the arrows walk)
|
||||
|
||||
@done
|
||||
Scenario: SF2b. The timeline is the watch view's own
|
||||
Given a scene whose composition has a length
|
||||
Then under the picture is the feed's one timeline (detail/blocks/Filmstrip.tsx, as under a render): play and the
|
||||
time on its row, the playhead, the comments' marks at their moments, a press or a drag to seek
|
||||
And its lanes are the scene's own frames, cuts and sound, from a render of the scene as it is now (host/scene
|
||||
film: kept by the file's state, made in the background a moment after it is live and after each change, not
|
||||
while this Mac is short of memory); the strip keeps one height before and after it arrives
|
||||
Given a still scene, a prop or a model
|
||||
Then there is no timeline
|
||||
|
||||
@done
|
||||
Scenario: SF2c. A prop or a model alone
|
||||
Then a component opens alone under plain light from the front three-quarter (its own camera and lights when it
|
||||
brings them), framed by what is drawn; a model as its preview page shows it
|
||||
|
||||
Rule: SF3. Comments in the scene's space
|
||||
# Status 11-13: built (src/scene/Pins.tsx; model/types.ts Pin.space; model/pin.ts spaceLines). A pin is a place
|
||||
# pin with `space`: the point in the scene's space, the part's stamp, a radius, what it marks, the view it was
|
||||
# written from, a path. Checked in the headless window: a comment on the table top marked Shader posted as an
|
||||
# edit, its pin stayed on the surface through a turn and a move out, and its mark stood at 0:00 on the timeline. A
|
||||
# drag marked a region as Artifact (its ring drawn on the table); opened from its mark after a seek to 0:01.5 it
|
||||
# went back to 0:00 with its thread open, and Esc closed the thread and stayed in the entry. A path of three
|
||||
# points posted as a comment.
|
||||
|
||||
@done
|
||||
Scenario: SF3a. A note on a point of a surface
|
||||
When Comment is on and I click a part
|
||||
Then the feed's own composer opens beside the point, and the comment is pinned to that point of that part
|
||||
And its pin is drawn where the point is from any camera and at any frame; away from its moment it is fainter
|
||||
And the agent reads where it is in the scene's space, on which part and where that part is written
|
||||
|
||||
@done
|
||||
Scenario: SF3b. What it marks
|
||||
Then the composer offers Mesh, Shader, Clipping and Artifact, and the comment carries the one chosen: the agent
|
||||
is told which kind of problem it is
|
||||
And a drag instead of a click marks a region: a ring about the point, its radius in metres
|
||||
|
||||
@done
|
||||
Scenario: SF3c. A comment opened
|
||||
When a comment is opened from its pin, the notes or the timeline
|
||||
Then the scene goes to its entry and its moment, and the view moves to the one it was written from (the scene's
|
||||
own camera when it was written from that)
|
||||
And Esc closes the comment first, then the entry
|
||||
|
||||
@done
|
||||
Scenario: SF3d. What raea itself measures
|
||||
When Check is pressed
|
||||
Then raea's scene lint (docs/scene.feature) runs on the frame shown and says what floats, sinks or clips
|
||||
|
||||
@done
|
||||
Scenario: SF3e. Seeing what a mesh is made of
|
||||
When Wireframe is on
|
||||
Then every mesh is drawn as its edges over its shading (Bevy's wireframe pass, on the stage's scenes only: a
|
||||
render's graph never has it), through play, a seek and a change to the code
|
||||
|
||||
Rule: SF4. Moving, turning and scaling a part by hand
|
||||
# Status 11-13: built (src/scene/Gizmo.tsx; host/scene/place.ts). Both forms raea scenes are written in are read
|
||||
# and written: Bevy's Transform chain (fromXyz, withRotation(Quat.fromEuler("XYZ", ...)), withScale; a lookingAt
|
||||
# kept last) and position/rotation/scale props; a part with none gets its tag's form and the imports it needs.
|
||||
# Checked in the headless window (blitz/scene.mjs): the crate's x handle dragged 66 px wrote fromXyz(2.3878, 0.35,
|
||||
# -1.2) with its rotation untouched, the stage drew it there, and Undo put the file back to the byte. By hand
|
||||
# after: the y ring turned it to Quat.fromEuler("XYZ", 0, 0.106, 0), the y handle scaled it to withScale([1,
|
||||
# 1.4656, 1]), and two Undos put the line back. The handles are elements over the picture and a drag is followed
|
||||
# on the window: raea's window draws an inline SVG as a picture, so its shapes take no pointer. host/scene: 15 tests.
|
||||
|
||||
@done
|
||||
Scenario: SF4a. Handles on a part placed by numbers
|
||||
When I click a part whose position is written as numbers
|
||||
Then Move (G), Turn (R) and Scale (S) are in the toolbar, and three axes stand from where it stands: a drag
|
||||
along one moves it along that axis, the middle slides it over the ground; Turn's rings turn it about an axis,
|
||||
Scale's handles size it; Shift snaps (10 cm, 15 degrees, a tenth)
|
||||
And while it is dragged its outline and the amount show; on release the new placement is written into its JSX
|
||||
in the form it is in, and the stage shows it
|
||||
And its card has the same numbers to type over, and Undo
|
||||
|
||||
@done
|
||||
Scenario: SF4c. The part follows the drag
|
||||
# checked in the built app's headless window: mid-drag the jar stood 43.2 cm along x with its card still
|
||||
# reading its old numbers, and the release wrote them
|
||||
Then while a handle is dragged the part itself is drawn where the drag has it (the stage holds it there;
|
||||
nothing is written), its outline and handles with it, and the amount beside it
|
||||
And the release writes it; a drag let go where it began writes nothing and the part goes back
|
||||
|
||||
@done
|
||||
Scenario: SF4d. A part inside a group that moves or turns it
|
||||
# the sample's jar on a trolley turned 0.7 rad: a 43.25 cm drag along the world's x wrote (-0.1308, 0.65,
|
||||
# -0.2786) from (0.2, 0.65, 0), that step turned back by the trolley's turn
|
||||
Then its handles stand on it where it is drawn (the stage says where a part stands)
|
||||
And a step in the world is written as the step in the space its code counts in: raea's groups are worked into
|
||||
each part's own place before the engine sees them, so that space is read from the part's turn and size in the
|
||||
world against those its code writes
|
||||
|
||||
@done
|
||||
Scenario: SF4b. A part placed by code has no handles
|
||||
Given a part whose position is computed (a frame's arithmetic, a spring, a prop, a loop's index)
|
||||
Then its card shows that code, Move is off and says why, and it is changed through its props (SF5)
|
||||
And a channel that is still numbers (a computed position with a plain scale) keeps its handle
|
||||
|
||||
Rule: SF5. The details of what is picked: a procedural part's props
|
||||
# Status 11-13: built (src/scene/Details.tsx; host/scene/routes.ts read, prop, default). A pick's stamp names the
|
||||
# components it was drawn in (its uses); each use's own element is read where it is written. Checked in the
|
||||
# headless window: a cone of the sample's row showed "Drawn by Cones" with count, gap and z; count typed to 6
|
||||
# wrote <Cones count={6}> and six cones stood; the crate prop alone showed size and color.
|
||||
|
||||
@done
|
||||
Scenario: SF5a. The card
|
||||
When a part is picked
|
||||
Then one card over the picture says its name, where it is written, where it stands, and its own props
|
||||
And nothing else is there until something is picked
|
||||
|
||||
@done
|
||||
Scenario: SF5b. Drawn by a component
|
||||
Given a part a component draws (a row, a scattering, a rig)
|
||||
Then the card lists each component it was drawn in, nearest first, with the props it was given where it is
|
||||
used, as controls; a change is written there and the stage shows it
|
||||
And a prop looked at alone lists its own props, a change writing its default
|
||||
|
||||
Rule: SF6. Staging: drawing parts into the scene
|
||||
# Status 11-13: built (host/scene/draw.ts; Inspector.tsx Draw). Checked in the headless window: a footprint
|
||||
# dragged on the floor wrote a <Mesh3d name="box"> with its Cuboid and material after the floor's element, the
|
||||
# imports added, standing on the floor; it was picked with its handles, and Remove took it out whole.
|
||||
|
||||
@done
|
||||
Scenario: SF6a. A primitive laid out on a surface
|
||||
When Draw is on and I drag on a surface
|
||||
Then a box, sphere, cylinder, cone or plane is laid out on the level through that point, its size shown as it
|
||||
is dragged
|
||||
And on release it is an element in the scene's file, among the scene's own top-level parts, written as raea 3D
|
||||
is written by hand; it is picked, to be moved, sized or removed
|
||||
|
||||
Rule: SF7. Motion as a path of keys
|
||||
# Status 11-13: built (src/scene/MotionPath.tsx; host/scene/motion.ts). A part's declared motion is its animate
|
||||
# tracks on x, y and z (raea/animation track, or plain keys). Checked in the headless window: the sample's ball
|
||||
# showed its path through keys 0, 45 and 90; the key at 45 dragged over the ground wrote 45: 0.8614 on x and
|
||||
# 45: 2.4329 on z and left y.
|
||||
|
||||
@done
|
||||
Scenario: SF7a. Keys moved as a spline's points
|
||||
Given a picked part whose animate declares x, y or z tracks with numbers
|
||||
Then its path is drawn through the scene as the tracks travel it, with a key at each keyed frame
|
||||
And a drag slides a key over the ground under it, with Shift straight up and down; the release writes that
|
||||
frame's values; a click on a key goes to its frame; the card adds a key at the frame shown
|
||||
|
||||
@done
|
||||
Scenario: SF7b. Motion that isn't keys is drawn on
|
||||
Given motion worked out in code
|
||||
Then Path draws a line through the scene (points on its surfaces), posted as a comment the agent reads as the
|
||||
points to move along
|
||||
|
||||
Rule: SF9. Light on the machine, and lighter when it must be
|
||||
# Status 11-13: built (src/scene/quality.ts, useLocated.ts stir; host/scene/routes.ts pressure). Shane, 11-13:
|
||||
# "make sure its highly performant and has ways to help kick back down preview rendering if swapping or
|
||||
# something". Measured in the headless window on the sample room (the window's whole process group): 3.2 GB at
|
||||
# the feed, 3.6 GB after blitz/scene.mjs (five reopenings), 3.7 GB after eight size changes and eight seconds of
|
||||
# play. At half size a part was picked and its handles stood on it. The rules for stepping down are tested
|
||||
# (quality.test.ts); a step down from real memory pressure was not seen live. Found and fixed on the way: a status
|
||||
# read while the stage was reopening a file said "playing", and the reopening after it played on by itself
|
||||
# (src/preview/stage.ts).
|
||||
|
||||
@done
|
||||
Scenario: SF9a. Quality
|
||||
Then Quality in the toolbar draws the scene at its own size, a half or a quarter: the same scene from the same
|
||||
camera, every pick, pin and handle working on it
|
||||
And on Auto it steps down by itself when this Mac is short of memory (the system's memory pressure, read by the
|
||||
host) or when the scene plays under half its frame rate for two seconds, and says why once, in a line over
|
||||
the toolbar and in the tool's tooltip
|
||||
|
||||
@done
|
||||
Scenario: SF9b. Nothing runs that nothing needs
|
||||
Then what is drawn over the picture follows it closely only while something changes (the camera, the clock, a
|
||||
drag, a write being drawn) and looks in now and then while it stands still
|
||||
And nothing is outlined under the pointer while the scene plays
|
||||
And while a scene is opening the host draws no stills beside it
|
||||
And a write keeps the picture, the handles and the pins where they are while the stage opens the file again,
|
||||
on the frame it stood on
|
||||
|
||||
Rule: SF10. What goes to the agent
|
||||
# Status 11-13: built (model/types.ts SceneItem.byHand; model/pin.ts byHandLines, spaceLines; store.tsx
|
||||
# sendComments). Shane, 11-13: "are we really going to count every single edit that was made? are we counting the
|
||||
# diffs?" No. model/pin.test.ts: 3 tests. The feed's send keycap (every item) reads "Send" with the count as a
|
||||
# badge: "Send 1 edit" ran together as "Send 1edit" in raea's window.
|
||||
|
||||
@done
|
||||
Scenario: SF10a. Comments are the edits; changes by hand are already made
|
||||
Then the count on Send is the comments marked as edits for the agent, as on every item
|
||||
And a part moved, turned, scaled, drawn or removed, a key dragged and a prop set are written when they are made:
|
||||
never counted, never waiting
|
||||
And the next round sent carries one line a thing changed by hand, for the agent to keep, and then forgets them
|
||||
And each comment in a scene tells the agent its point in the scene's space, the part and where it is written
|
||||
|
||||
Rule: SF8. Open
|
||||
# Status 11-13: SF8e done for 0.1.3 (Shane: the scene feed ships in 0.1.3, not 0.1.4). raea-feed #10 merged
|
||||
# (24b2eb5) with raea-skills #58 (faa9938: collaborate.md's row, reference/feed.md regenerated), and raea pins it
|
||||
# (#133, 2cb213634); SKILLS_STRICT=1 tools/skills.sh check passes against the app at raea-feed main.
|
||||
@done
|
||||
Scenario: SF8e. Taught to agents
|
||||
# feed_post's type list is in the generated skills reference. Teaching `scene` is a change to raea-skills
|
||||
# (skills/raea/collaborate.md's "When you need to..." table, and reference/feed.md regenerated), which is public
|
||||
# and merges by PR, with the merge of raea-feed's branch scene
|
||||
Then the raea skill says when to post a scene and what the person can do with it
|
||||
@@ -0,0 +1,100 @@
|
||||
@spec
|
||||
Feature: Sound for picture: the local models on any Mac, open libraries and packs one command away, music composed
|
||||
Asked for on 2026-11-16: rewrite the music and sound notes so that SAO and TokenSynth can be downloaded, every open
|
||||
instrument library and sound-effect pack raea knows is easy to reach, and music is never a default: "it tends to
|
||||
result in drones and pads and not actually design real complex music, scoring, sound effects, diegetic and
|
||||
non-diegetic."
|
||||
|
||||
Where it stands (2026-11-16): `raea setup-audio` installs both models through tools/sao/setup.sh and
|
||||
tools/tokensynth/setup.sh, and `raea sounds` reaches four libraries (sdk/raea/library/sounds/catalog.json:
|
||||
salamander, fluid, tonejs-instruments, vcsl). The guides teach deciding what each scene is heard as, spotting the
|
||||
cut and composing for it (sdk/guides/craft/motion/music.md, sound.md), and list every vetted source with its licence
|
||||
and how to fetch it (motion/sources.md). What those guides had to write down as a gap is below.
|
||||
|
||||
Rule: The local models install on any Mac, and say what they are
|
||||
|
||||
Scenario: SN1. setup-audio works on a clean Mac
|
||||
Given a Mac with no uv, no git and no Python of its own
|
||||
When `raea setup-audio` runs
|
||||
Then each setup gets uv and git through tools/ensure.sh, which every release ships, instead of the PATH
|
||||
And TokenSynth's code is cloned at a pinned commit and its weights fetched at a pinned revision, each file
|
||||
checked against its SHA-256, as SAO's already are
|
||||
And a missing tool, a full disk or a failed download is named in the error with the one command that fixes it
|
||||
And it is proven from a release build on a fresh macOS user account, with the sizes it reports
|
||||
|
||||
Scenario: SN2. raea meets SAO's licence, and says what is left for the person
|
||||
Given Stable Audio Open Small is under Stability AI's Community License (stability.ai/community-license-agreement),
|
||||
which isn't an open licence, and raea hands the model on to everyone who uses raea, so the licence's duties for
|
||||
whoever distributes it, or a product that uses it, are raea's
|
||||
When setup-audio installs it
|
||||
Then it writes a copy of the agreement and a NOTICE file beside the model (~/.cache/raea-sao), the notice
|
||||
holding the attribution the licence gives word for word ("This Stability AI Model is licensed under the
|
||||
Stability AI Community License, Copyright © Stability AI Ltd. All Rights Reserved"), and saying that the
|
||||
model raea installs is a changed one and how (a Core ML conversion from a Hugging Face mirror)
|
||||
And raea shows "Powered by Stability AI" where it documents SAO (the manual's setup-audio page, the app's about
|
||||
page)
|
||||
And raea's maker has registered its commercial use with Stability, and knows the licence ends for raea when
|
||||
raea and its affiliates make more than USD 1 million a year, from anything, unless Stability grants it an
|
||||
enterprise licence
|
||||
And `raea setup-audio --check` names each model's licence and where its copy is
|
||||
And what applies to the person is decided and written in motion/sources.md: whether the licence's clause for
|
||||
someone who gets the model "as part of an integrated end user product" takes them out of its commercial
|
||||
section, and what remains (the outputs are theirs as far as the law allows; no training another generative
|
||||
model on them; Stability's acceptable use policy)
|
||||
And until then the guides tell the agent to name the licence and link it before an SAO sound goes into a
|
||||
commercial piece, and to say nothing about what it requires of the person
|
||||
|
||||
Scenario: SN3. The app offers the local models before a piece needs them
|
||||
Given the raea app on a Mac without the models
|
||||
When a piece first needs SAO or TokenSynth
|
||||
Then the app says what will be downloaded (its size, licence and folder) and installs it on a yes, with progress
|
||||
And a render never blocks on a download of gigabytes it didn't say it would make
|
||||
|
||||
Rule: Open libraries and packs are one command away
|
||||
|
||||
Scenario: SN4. raea sounds reaches the vetted packs
|
||||
Given the packs motion/sources.md lists as fetched by hand
|
||||
When `raea sounds get` names one, an instrument of it or a sound in it (VSCO 2 CE's celli, Kenney's impacts,
|
||||
Groove MIDI's funk grooves)
|
||||
Then it downloads only that, once, into ~/.cache/raea-sounds, checked against a pinned SHA-256
|
||||
And it copies what the piece uses into media/ with its LICENCE.txt and the credit line it needs
|
||||
And it converts what raea can't read (Ogg, Opus) to WAV on the way in
|
||||
And a pack whose licence forbids passing it on (Sonniss's bundles, Pixabay's and Mixkit's sounds) is never
|
||||
mirrored: raea links to it and indexes the person's own download
|
||||
And nothing non-commercial, no-derivatives, Sampling+, share-alike or GPL is in the catalogue
|
||||
And until it does, motion/sources.md gives a one-line fetch for every pack with a stable address, into
|
||||
~/Music/raea-sounds/PACK/ with its licence beside it
|
||||
And Freesound is searched from raea only under a commercial licence for its API from Freesound's owners
|
||||
|
||||
Scenario: SN5. A sampled instrument keeps its dynamics and round robins
|
||||
Given a library with several velocity layers and round robins a note (VCSL, VSCO 2 CE, Salamander V3)
|
||||
When `raea sounds get` fetches it, or a composition loads its SFZ map
|
||||
Then every layer comes, and one Sampler plays the layer each note's velocity asks for and turns through the
|
||||
round robins
|
||||
And `humanize` on a Part, a Sequence or a Loop moves each note by a seeded few milliseconds, the same every render
|
||||
|
||||
Scenario: SN6. A MIDI file plays on sampled instruments
|
||||
Given a MIDI file: a Groove MIDI drum performance, or a public-domain score exported from MuseScore
|
||||
When a composition imports it (`import groove from "./media/grooves/funk-92.mid"`)
|
||||
Then it gets the file's tracks and notes in raea/music's MidiFile shape (parseMidi's), to play on Samplers and
|
||||
Players, the same shape motion/sources.md's converter writes as JSON today
|
||||
And a drum track maps onto a kit by note number, in General MIDI's map or a named kit's (Roland's, which
|
||||
Groove MIDI was recorded on, adds hi-hat edges at 22 and 26)
|
||||
And a note-on with no note-off ends where the file does, as the converter has it, instead of being dropped
|
||||
And a SoundFont bank (.sf2, .sf3) can play it in raea, without a render outside it
|
||||
|
||||
Rule: Music is composed for the cut, and a drone is caught
|
||||
|
||||
Scenario: SN7. raea check says when a cue is a drone
|
||||
Given a render whose music bus holds a cue longer than 15 s
|
||||
When `raea check` measures it from the render's note events
|
||||
Then it reports, by timecode, a cue that holds still, by these measures: the distinct pitches its lead plays in
|
||||
8 bars, the longest any one chord holds, its note onsets a beat over 4 bars across all its parts (the notes of
|
||||
a chord struck together count as one onset, and a bar with no onset counts as a held one), the spread of its
|
||||
velocities, how many timbres it uses, and whether it ends on a cut or fades out
|
||||
And its first fixtures are the cues in the guides' own examples (motion/music's cue and game loop, motion/sound's
|
||||
cue, the game bench's loop), which must all pass whatever their length, and a held pad and a sine sub under
|
||||
a long reverb, which must fail
|
||||
And its thresholds are set from those fixtures, approved scores and known drones before it ranks anything above
|
||||
P3 (a first guess, not measured: under 5 lead pitches in 8 bars, a chord held past 2 bars, under 1 onset a
|
||||
beat, a velocity spread under 8 of 127)
|
||||
@@ -0,0 +1,875 @@
|
||||
@spec
|
||||
Feature: The timeline SDK (0.1.5): CapCut's timeline, on the composition, in the feed, open to extension
|
||||
Shane, 2026-11-13 (goal, launching alongside the character SDK): "the goal with the timeline sdk is to provide
|
||||
agents pushing feed items or controllers / things we might want to be able to edit directly with timeline based
|
||||
adjustment which includes full on video editing in the feed watch/scene items if any components or compositions are
|
||||
in the sequence, text, effects, transitions etc. the goal should be to actually open and explore every inch and
|
||||
aspect of how capcut timeline works and basically do the exact same thing. we want full editing ability and to
|
||||
remove the timeline 'comments' as we can just do that in the viewer at whatever timecode im at ... the switcher on
|
||||
the left for video/audio and we should basically allow those to expand; we also can add some way of allowing for
|
||||
keyframes, changing the way you make bezier curves and things. the idea is that we provide the framework and parity
|
||||
functionality and feel to capcut while allowing it to be extended. This also means live editing buffering and
|
||||
playback of whole sequences, 3d scenes, etc need to be done to include buffering, caching, smart cache clearing,
|
||||
etc. these changes in the timeline are not suggestions they are actual edits sent to the agent. these should be
|
||||
deeply connected to the watch, listen, and scene feed experiences."
|
||||
|
||||
What there is to build on (read 11-13):
|
||||
- docs/editing.feature E1 to E5: the composition's file is the document, a change is a change to its code made at
|
||||
once, the working version (NAME-vN.tsx), a <Sequence>'s span edited on a strip (host/sequences.ts), the engine's
|
||||
stage playing the working file live (E4a), an agent editing through the same operations (editor_edit, E5a).
|
||||
- raea-feed src/detail: the viewer's strip (blocks/Filmstrip.tsx: two tracks, a kind picker in each track's
|
||||
gutter, plugins' lanes, the comments' pins and a comment card on the strip), the hand editor (timeline/Editor.tsx,
|
||||
Strip.tsx: cuts over the render, parts retimed, undo and redo), the composition editor (src/compositions).
|
||||
- raea-feed PR #18 (11-13): a scrubber that only seeks, the strip collapsed to it, a resize handle on its top edge.
|
||||
- The proxy store (host/preview/proxies.ts: light copies, thumbnails, peaks, a size limit and a sweep), the export
|
||||
and bundle caches (runtime/bundle cache.rs), rr3's shot segments (docs/rerender.feature, behind RAEA_SEGMENTS=1).
|
||||
|
||||
CapCut's desktop timeline, as its own help pages and guides describe it (read 11-13; no CapCut code is read or
|
||||
copied, and no other editor's under a licence that forbids it: docs/editing.feature's note on react-video-editor-pro):
|
||||
- Above the timeline, left: the pointer's mode (Select A, Split B, select everything left [ or right ]), undo and
|
||||
redo, Split (Cmd+B; Cmd+Shift+B every track), Delete left Q and Delete right W (of the playhead, on the picked
|
||||
clip, the gap closed), a marker M, Delete, and for a picked clip Freeze, Reverse, Mirror, Rotate, Crop.
|
||||
Right: record a voice, the main track magnet P, auto snapping N, linkage ~, the preview axis S (the frame under
|
||||
the pointer), fit Shift+Z, and zoom (Cmd +/-, Cmd+scroll; Option+scroll scrolls sideways).
|
||||
- Tracks: one main track that never holds a gap while its magnet is on (a clip dropped between two moves the rest;
|
||||
off, a clip dragged over others becomes an overlay on a track above); overlay picture tracks above it; text,
|
||||
sticker, effect, filter and adjustment tracks above those; sound tracks below. Each track's head locks it, hides
|
||||
it (eye) or mutes it (speaker).
|
||||
- A clip: picked by a click, several by Cmd+click or a box; moved by a drag, trimmed by its edges (back out again
|
||||
to the source's end), split, deleted, duplicated, copied and pasted, its attributes pasted onto another
|
||||
(Cmd+Shift+C/V), disabled (V), grouped (Cmd+G), made a compound clip (Option+G), its sound extracted
|
||||
(Cmd+Shift+S). I and O mark a range.
|
||||
- Moving in time: Space, Left/Right a frame, Shift+Left/Right several, Up/Down the cut before or after, Home/End.
|
||||
- Keyframes: a diamond beside each property in the inspector stores its value at the playhead; a second, later
|
||||
one with another value animates between them; the diamonds show on the clip; a graph shapes the change (linear,
|
||||
ease in, out, both, or a curve dragged by hand). Position, scale, rotation, opacity, colour, volume.
|
||||
- Speed: constant, or a curve of points from 0.1x to 10x with presets (Montage, Hero, Bullet, Jump cut, Flash in,
|
||||
Flash out) and a custom one; the clip's length follows.
|
||||
- A transition sits on the cut between two clips that touch; its length is dragged. Effects, filters and
|
||||
adjustments are clips on their own tracks, over the span they cover.
|
||||
- Sound: the waveform on the clip, a volume line, fade in and fade out as lengths at the clip's ends, beat markers
|
||||
on the waveform that edges snap to.
|
||||
- Playing while editing: lighter copies of heavy media (Proxy, 540 or 720 lines), a lower preview quality, parts
|
||||
that were worked out kept (the cache: its size shown, cleared by hand or on a schedule), all remade when needed;
|
||||
an export always reads the originals.
|
||||
- The inspector beside the player (read 11-14), its tabs by the picked clip's kind. Video: Basic (position, scale,
|
||||
rotation, opacity, blend mode, stabilise), Mask (line, mirror, circle, rectangle, heart, star; position, size,
|
||||
rotation, feather, round corners, invert), Cutout (auto cutout of a person, a custom cutout brushed, chroma key
|
||||
with its colour picked from the picture, strength and shadow), Retouch. Animation: In, Out, Combo. Speed:
|
||||
constant and curve. Adjust: brightness, contrast, saturation, exposure, sharpen, highlights, shadows,
|
||||
temperature, tint, fade, vignette, grain. Audio: volume, fades, noise reduction, voice changer. Text: font,
|
||||
style, effects, bubbles, animation, and its words read aloud.
|
||||
Here 11-14: Basic (TL3h, TL5) with stabilise (TL7k, a film's footage and a composition's <Video>), auto cutout
|
||||
of a person or the subject (TL7l, a film's footage or a composition's <Video>, on a Mac) and a custom one brushed on the picture (TL7m), Retouch (TL7n: smooth, brighten, slim face and bigger eyes, a film's footage, a file from Media or a composition's <Video>, on a Mac), Mask, chroma key and Blend (TL7f) with the key's colour picked from
|
||||
the picture (TL7h) and the mask's handles dragged there (TL7i), Animation (TL7d, TL7e), Speed (TL6), Audio's
|
||||
volume and fades (TL8a) and its noise reduction and voice changer (TL8d, a film's sounds and a composition's
|
||||
<Audio>), Text's words, styles and captions (TL7c) and its words read aloud (TL7j), Adjust as effect clips
|
||||
over a span (TL7b, raea's ten) and as the clip's own twelve sliders (TL7g, on the film and on a file from Media
|
||||
over it), every number of these keyed (TL5a).
|
||||
|
||||
The model this file sets:
|
||||
1. One timeline model, in an SDK (sdk/timeline, TypeScript, no React, no DOM): tracks, clips, keys, markers, and
|
||||
the operations on them, each a pure function from a timeline to the next. The app's strip draws it and the
|
||||
host writes it; an agent reads and writes the same model. It replaces the strip's own cut and parts.
|
||||
2. The composition's file is still the document (docs/editing.feature): a timeline is read from a composition's
|
||||
tree, and each operation is also a code edit to the working version. What the code can't express as written
|
||||
(a span set by an expression) is shown locked, with why.
|
||||
3. An operation made by the person is an edit, applied at once, and sent to the item's agent as the edit that
|
||||
was made, never as a note asking for it.
|
||||
4. Parity first, in function and feel: CapCut's tools, keys, magnet, snapping and gestures, at 60 frames a second
|
||||
under the pointer. Then the points where it is extended: a kind of track, a kind of clip, a property and its
|
||||
editor, an easing, a transition, an effect, a lane, a tool, each a plugin's contribution.
|
||||
5. Comments are the viewer's. The timeline takes no comment and opens no comment card; a comment made on the
|
||||
picture at a moment shows as a marker on the timeline, which opens it.
|
||||
6. The picture under an edit is the engine playing the working file (E4a) where there is a stage, with what was
|
||||
drawn kept: a range's frames are kept by what draws them, an edit drops only the ranges it changed, and the
|
||||
store keeps itself under a size the person sets.
|
||||
|
||||
Status, 11-13 (the first day). On raea main: sdk/timeline (model, ops with inverses, compound clips, keys and
|
||||
bezier easing, speed curves, freeze frames and reversed footage, snapping, the frame store's decisions, live
|
||||
playback's mapping, readers and writers for a composition's sequences (its footage and sound, its text, its
|
||||
effects, a recording, a project's file), a film's scenes and a sound's tracks, the palette a plugin adds to, a clip's cutout and Adjust; 106
|
||||
tests), and in
|
||||
sdk/video <Nudge keys mask blend chroma adjust> (keys for the placement and, by a dotted name, a mask's, a key's, a
|
||||
crop's and an adjustment's numbers; cutout.ts: a mask's six shapes, CSS's blend modes, a chroma key; adjust.ts:
|
||||
CapCut's twelve adjustments as one SVG filter and a vignette layer), <Transition in out combo> (fade, slide, wipe, zoom; a Combo's seven waves), <Effect kind amount in out> (blur, mono,
|
||||
sepia, vivid, faded, contrast, bright, dark, invert, hue: a filter on the picture under it) and a <Video>'s or
|
||||
an <Audio>'s speedCurve (the mixer carries its sound through the changing rate as one voice). In raea-feed, draft
|
||||
PR #19: the new timeline is the timeline (localStorage raea.timeline-sdk = 0 brings the old strip back); 49 browser
|
||||
tests in Chrome, all passing; in a headless raea window 47 of the 49 pass and two skip themselves there with their
|
||||
reason (the voice test, which would ask for this Mac's microphone, and TL10d, whose film the window decodes itself,
|
||||
so no route can hold its data), among them TL9c, an agent's edits, a composition's every edit, freeze and reverse, mirror and
|
||||
crop, effects, groups and compounds, the posted item's, a plugin's effect, text style, tool and snap grid, saved
|
||||
curves, Settings' kept frames, both kinds of sound taken out, the switcher, the export range, media added, the
|
||||
Option keys, captions made from what is said, a clip's In, Out and Combo, and its mask, blend and chroma key (whose
|
||||
sliders are a track of their own, as the volume's is: the window doesn't move a range input), their numbers and the
|
||||
crop's sides keyed (TL5a), its own Adjust (TL7g), its key's colour picked from the picture (TL7h: read from the
|
||||
clip's file by the host, since the window has no canvas to read), its mask's handles dragged there (TL7i), and a file
|
||||
from Media over the film with its own vignette and its key's colour picked from its own file, a text's words
|
||||
read aloud onto a sound track (TL7j), and a sound's noise reduced and its voice changed (TL8d: its menu is made
|
||||
again after each try, since the window keeps a picked option shown when the clip's didn't change), footage held
|
||||
steady (TL7k), footage cut out (TL7l; its pixels are compared in Chrome only, which can screenshot an
|
||||
element) and cut out by what is brushed over it (TL7m: the strokes painted with the window's own pointer), and footage retouched (TL7n: the copy put in the clip's place at the playhead's second and wearing its mask; that it has the frame and the film's picture goes are checked in Chrome only, which plays the copy). The window runner (blitz/pw.mjs) answers routes one at a time in the order asked, keeps a reload's
|
||||
address and each test's storage, and has keyboard down and up, toBeFocused and waitForResponse. The timeline's keys
|
||||
follow the pointer over it, not :hover, which raea's window doesn't match for a script, so there they only worked
|
||||
after a click in the timeline:
|
||||
built TL0a-d, TL1a-b, TL1c (the switcher on the left of each track, picking what its clips show: the
|
||||
frames, the energy, the waveform, the spectrogram, the words said, with Transcribe offered until
|
||||
there are words; only what the film has is offered, each clip draws its own stretch of the film,
|
||||
and the choice is kept by the track's kind for the next film; a sound in Listen the same; a clip
|
||||
of one of the project's files, a sound track's or one added from Media, draws its own file's
|
||||
loudness, read once on the host (/host/asset-peaks); a plugin's lane as a row under the tracks;
|
||||
collapse and the top edge's resize),
|
||||
TL1d (the poster on the main track's head: a click makes the playhead's frame the poster),
|
||||
TL2a-e, TL2f (I and O in either order, Shift+X around the picked clips, its ends dragged on the
|
||||
ruler, Option+X or the × beside Export clearing it; kept with the item; Export says the span and
|
||||
the host cuts only it with raea media trim, raea's encoder signing it as every export: a real
|
||||
render's 1 s to 2.5 s came out 1.5 s, 90 frames and its sound), TL3a-g (and TL3b's Option-drag,
|
||||
leaving the clip and putting a copy down), TL3h (freeze and reverse played live from the film's own
|
||||
frames; mirror,
|
||||
rotate and crop shown on the player at once, as are a clip's keyed scale, place, turn and opacity),
|
||||
TL3i, TL3j (Media in the bar, Cmd+I: the project's footage, stills and sounds, each added at the
|
||||
playhead as long as its file, a still 3 s; on a film cut here footage and stills go over the
|
||||
picture, drawn on the player where they are on, a sound on a sound track), TL4a-b, TL4c (and a clip's own sound taken out with Cmd+Shift+S: the SDK's extract
|
||||
operation, a sound clip over the same span from the same place in the file, the footage marked
|
||||
muted; in a composition the host mutes the <Video> and writes an <Audio> of its file beside it, read
|
||||
back as clips; in a film cut here the player is silent over that footage and the sound plays from
|
||||
its place in the film wherever it is moved), TL5a-b, TL5c (and a curve shaped by hand saved by name for the workspace: kept as
|
||||
timeline/curves.json in its folder, a preset in every timeline there, forgotten by its ×), TL6a-b
|
||||
(and Option on a clip's edge changing its speed, Cmd+R to the speed, Shift+B to its curve),
|
||||
TL7a, TL7b for raea's ten effects (an effect is a clip of its own,
|
||||
shown on the player where it is on), TL7c (text added with T or in a style from the bar, drawn over a
|
||||
film where it is on, renamed by a double-click, a caption split at the caret with Enter; raea's
|
||||
four text styles and a plugin's, as data; and captions made from what is said, CapCut's auto
|
||||
captions: Captions in the bar transcribes the film first when it has no words yet, then puts the
|
||||
words, where the edited cut now says them (sdk/timeline captions.ts heard: a scene taken out takes
|
||||
its words, a duplicated one says them twice, a curved, reversed or frozen clip none), in lines (a
|
||||
sentence's end, a pause of 0.6 s, seven words or 42 characters end one) as text clips in the
|
||||
caption style on a Captions track of their own: one edit (the `captions` operation), undone
|
||||
whole, drawn over the film, told to the agent as one line with every caption's words and
|
||||
timecodes, and in a composition each line a sequence of words), TL7d's In and Out (a picked
|
||||
clip's own animation at each end, CapCut's Animation tab: fade, slide, wipe, zoom or a plugin's,
|
||||
and its frames, in the clip's row; a ramp on the clip; the film's picture and words over it show it
|
||||
at once, drawn by sdk/video edges.ts, the table <Transition> now draws from too; split, each half
|
||||
keeps its own end's; never longer than the clip; in a composition the sequence's <Transition>
|
||||
edge, taken off with no frames, read back as the clip's own where no cut's transition takes it;
|
||||
Send says how it comes in or goes out), TL7e (a Combo: seven of raea's, as waves in sdk/video
|
||||
edges.ts, and a plugin's as data; its cycle starts at the clip's length, playing once, and loops
|
||||
when shorter; with the In and Out at once on the film's picture and words; a line with a tick a
|
||||
cycle on the clip; <Transition combo> in a composition, written and read back), TL7f (a mask, a
|
||||
blend and a chroma key: the row's blend menu, and a mask and a key panel; a mask an SVG mask image
|
||||
laid over the frame, feathered by a blur, inverted by mask-composite; a blend CSS's mix-blend-mode;
|
||||
a key an SVG colour-matrix filter whose alpha falls as a colour's share of the key's hue rises; drawn
|
||||
by sdk/video cutout.ts in the preview and in <Nudge>, and by raea's renderer as Chrome draws them,
|
||||
seen on a render of a keyed green panel, a feathered heart, an inverted turned star and a screen
|
||||
blend; an SVG <mask> to invert overran Vello's buffers, so it isn't used; a clip's cutout is its
|
||||
props, a preset's to set later; Send says all three as they stand), TL7g (the clip's own twelve
|
||||
Adjust sliders, one SVG filter after its key and a vignette layer, by sdk/video adjust.ts in the
|
||||
preview and in <Nudge adjust>; raea's renderer within 0.4% RMSE of Chrome on a probe), TL7h (the
|
||||
key's colour picked from the picture: a press on the film or a file over it, undone through its
|
||||
placement, read by the host from the clip's file where the player is, a small patch's mean), TL7i
|
||||
(the mask's outline and CapCut's handles on the picture through the clip's placement: move, width,
|
||||
height, corner, turn, feather, round; a drag shown as it moves and one edit when let go, keyed
|
||||
numbers keyed), TL7j (a text's words read aloud: raea gen speech on the host, kept under
|
||||
media/speech by the words' hash, a sound clip from the text's start; a real line 8.4 s to make,
|
||||
43 ms read again), a plugin's effects as data (timeline.effects in its manifest: parts
|
||||
of CSS filter functions, drawn by <Effect parts> and by the preview alike), TL8a
|
||||
(waveform, level line, fades; Cmd+. and Cmd+, step the level by 0.1 dB, or key it at the
|
||||
playhead when it is keyed), TL8b's beats as ticks that edges snap to, each turned off by a
|
||||
click, TL8c (Record from the playhead, the picture playing; the recording a clip named by what was
|
||||
said, its file in the project's attachments), TL8d (a sound's noise reduced and its voice
|
||||
changed: host/dsp.ts in TypeScript, an FFT and Hann overlap-add, the noise's floor from the quietest
|
||||
tenth, a phase vocoder for pitch, biquads for the bands, a delay line for the echo; on made sounds hiss
|
||||
down 16 dB with the tone within 0.04 dB, 3 minutes in 2.3 s; on a real voice the chipmunk moves its
|
||||
spectral centroid x1.46 and deep x0.77, each setting 25-73 ms for 1.2 s, kept under media/voice and
|
||||
read again in under 1 ms; each voice's copy as loud as its source short of clipping, where on a line
|
||||
with pauses they had moved it -12.5 dB (robot) to +8.6 dB (megaphone); in a composition, an <Audio>'s
|
||||
copy made from its own file and kept in its media folder's voice/, the <Audio> playing it and saying
|
||||
what it was made from and how (data-voice-of, data-denoise, data-voice), both off its src as it was;
|
||||
raea renders it, a scratch composition's line at 105 Hz voiced, 140 its own), TL7k (footage held steady: host/shake.ts in TypeScript on 320 px
|
||||
grey frames from `raea media still`, eight at a time; the window over a block read again where
|
||||
the first reading put the move, since a fixed window reads big moves short; the path smoothed by
|
||||
a Gaussian-weighted line, so a pan stays a pan to the clip's ends; on a shaky clip made from a real
|
||||
frame along a known path, the shake 21 px down to 0.23 and its turn 0.54 deg to 0.03, a 1 Hz sway
|
||||
12 px kept to 5.4 at Minimal cut and held to 2.9 at Most stable, zoom 1.05 to 1.06, 34 ms a frame
|
||||
read and the kept file read again in 28 ms; in a composition, its <Video>'s whole file read, the moves kept in its
|
||||
media folder's steady/ and a steadied copy rendered by raea beside them (a composition playing the file
|
||||
with each frame's move as the player wears it), which the <Video> plays, saying what it was made from
|
||||
(data-steady-of, data-steady), off its src as it was; a 2 s clip shaken along a known path steadied in
|
||||
3.4 s, its frame-to-frame shake 7.49 px to 2.12 at 320 px, a copy with no moves its file's every frame), TL7l (footage cut out, CapCut's Auto cutout: Apple's
|
||||
Vision on the host through osascript's JavaScript, its person segmentation (macOS 12) or its
|
||||
subject mask (macOS 14), each frame of the part the clip shows as a 512 px matte PNG under
|
||||
media/matte, 120 frames a run, its index written last; the player wears the frame's matte as the
|
||||
top layer of its mask, intersected with the clip's own shape, and fetches the next 12 ahead; on a
|
||||
real clip a person 97 ms a frame and 73 KB, the subject 79 ms and 33 KB, hair kept; in Chrome a
|
||||
matte clear on its left leaves that quarter of the picture flat and the right as it was), TL7m
|
||||
(footage cut out by what is brushed over it, CapCut's Custom cutout: Brushed… in the cutout menu
|
||||
opens a brush on the picture, keep and erase, its width a share of the frame's, a stroke undone or
|
||||
all cleared; a stroke's points undone through the clip's placement and thinned by Ramer-Douglas-Peucker
|
||||
to what it needs; Cut out sends them with the second under the playhead, and the host matted from
|
||||
that frame to the clip's end and back to its start: Vision's subject mask tells the picture's things
|
||||
apart, those under more keep than erase strokes are kept, and on each frame after, those lying 30% or
|
||||
more in the matte before it, or holding 30% of it, a frame Vision sees nothing in holding the matte
|
||||
before for up to 3 frames; overlaps read as CIAreaAverage means undone from sRGB, a 25% square read
|
||||
0.2502; on two subjects side by side a stroke on either kept only it, both kept both, an erase took
|
||||
one out, a stroke on the sky said nothing is under it; a real clip 90 frames in 11.9 s, the cat
|
||||
followed through all of them; the strokes kept in the clip's props as JSON, there to brush again; in a
|
||||
composition, the whole of what its <Video> plays (its file, or its retouched or steadied copy) matted
|
||||
into its media folder's matte/, and the <Video> wears them by raea's new Video matte prop (matte={{ src:
|
||||
staticFile(folder), fps, every, count }}: the matte its source time is on, as its mask-image, sized as
|
||||
its objectFit sizes the picture), saying what they are of (data-matte; brushed, data-brush-at and
|
||||
data-brush-strokes), off its props as they were; while it wears them, Stabilise and Retouch are refused,
|
||||
since what it plays would change under them. A composition's strokes are on its frame, which is the
|
||||
<Video>'s picture only when the <Video> fills it. A real 3 s face clip's person matted in 9.1 s, and
|
||||
raea's render of the edited composition keeps on each frame what that frame's matte keeps (overlap 0.92
|
||||
at least, 0.972 on average; its own matte over the one 15 frames away on 88 of 90 frames), where the
|
||||
uncut composition's overlap is 0.53),
|
||||
TL7n (footage retouched, CapCut's Retouch: four sliders, smooth, brighten, slim face and bigger eyes, set
|
||||
then applied; the host reads each frame of the part the clip shows (`raea media still`, as wide as the
|
||||
picture up to 1280 px), finds its faces and their landmarks with Vision's face landmarks (up to 4 a
|
||||
frame) and retouches them with Core Image through osascript's JavaScript: the skin a mask of the jaw's
|
||||
line closed by an arc over the forehead, less the eyes, brows and lips, feathered; smooth a blur
|
||||
blended in only where the picture differs little from it, so a lash line or a nostril stays sharp;
|
||||
brighten an exposure lift through the mask; bigger eyes a bump at each eye; slim a warp kernel drawing
|
||||
the cheeks and jaw toward the face's middle. Two Core Image traps found on the way: an image read
|
||||
straight from a bitmap comes out blank from a render with a warp kernel in it (the mask is made from
|
||||
its TIFF data), and a blur under a warp whose region callback is JavaScript renders without the
|
||||
blur's branch (what is under the warp is made pixels first). Frames go to `raea media encode` with
|
||||
the part's own sound (`raea media audio`) under them, signed, as media/retouch/<file>-<key>.mp4, in
|
||||
runs of 48 split over two Vision processes; no face in the clip is said and nothing kept. The player
|
||||
shows the copy over a film's picture in its box, wearing the look copied off it as it changes, and
|
||||
hides the film's picture only once the copy has the frame under the playhead (a copy loading shows
|
||||
the film as shot); a clip coming on within a second has its copy loaded ahead; a file from Media plays
|
||||
the copy, which carries its sound, instead of its file. On a 720 x 1280 talking-head clip 90 frames
|
||||
in 10.9 s, a face found on every one; asked again, the kept copy in 24 ms; in a composition, its
|
||||
<Video>'s whole file retouched into its media folder's retouch/ (its steadied copy when it is held
|
||||
steady: the retouch over the steadying, and Stabilise refused while Retouch is on, since what is under
|
||||
it would change), which the <Video> plays, saying what it was made from and by how much
|
||||
(data-retouch-of, data-retouch-smooth, -brighten, -slim and -eyes), off its src as it was; a real 3 s
|
||||
face clip 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, where the file's is 1.4 (4.9 over the face). Copies, moves and mattes are read and
|
||||
made at the rate the frames' times sit on (the probe's frame_rate) where it is within 1% of the
|
||||
average: that clip's 30/1 probed 29.97 on average, and a copy made at that drew its frame 44 at the
|
||||
composition's 45; each is named by that rate too, so a copy made at the old one isn't read again),
|
||||
TL11a for easings, speed curves, transitions, effects, text styles, tools (presets put
|
||||
on the picked clips) and snap grids as data (a clip let go 6 px past a plugin grid's mark lands on
|
||||
it, under a browser test with the plugin installed; each e2e run now starts with no plugins
|
||||
installed, since an earlier run's grids had stayed approved and snapped a run whose plugin had none),
|
||||
TL9c (an agent's editor_edit made as raea/editor operations on the open timeline, which
|
||||
editor_selection gives by clip id: one step in the person's history, undo taking it back, Send
|
||||
telling it as the agent's own, the clips it touched ringing and the bar saying what it did), TL9d
|
||||
(an item's own timeline: an edit kept in the item's data, Send telling its agent), TL10d (below),
|
||||
TL10e (a composition's drafts and a scene's ranges kept in the proxy store, <store>/drafts and
|
||||
<store>/scene-frames, under its one limit with the copies: one line by last play across all of
|
||||
them, so a draft played an hour ago goes before a still looked at a minute ago; Settings › Light
|
||||
copies lists drafts of edits and scene ranges with their sizes and Clear takes them; finishing or
|
||||
discarding a sitting forgets its drafts at once, and any ranges of the discarded version; kept
|
||||
frames whose file is gone go at the next sweep, as a copy whose source is gone does. Seen on a real
|
||||
host on its own port: 1 draft and 2 ranges listed as 15,000 bytes, Clear freeing all three), TL11b (the model as raea/editor, with its reference page and an example), TL12a-b, TL14a-c (a
|
||||
scene's timeline as long as the scene, past its last sequence)
|
||||
in code a composition's sequences: move, trim, split, delete (E3), keys on x, y, scale, rotate and opacity
|
||||
(TL5d), its still placement as its <Nudge>'s props, mirror and crop among them (TL3h), and its mask,
|
||||
blend and chroma key (TL7f: mask={{ kind, x, y, w, h, rotate, feather, round, invert }},
|
||||
blend="screen", chroma={{ color, strength, shadow }}, plain values only, any other the code's), a speed or a
|
||||
speed curve for a sequence that holds footage, split in two with it (TL6a-b), a transition on a cut
|
||||
(TL7a), an effect as a sequence holding an <Effect>, its kind and amount (TL7b), a sequence of
|
||||
words as a text clip, its words rewritten, words added as a new sequence (TL7c), a <Video>'s or an
|
||||
<Audio>'s level (TL8a), a recording as a sequence holding an <Audio> of its file (TL8c), a
|
||||
project's file as a sequence holding a <Video>, <Img> or <Audio> of it, named by its path in
|
||||
the composition's media folder (cloned into media/added/ first when it is elsewhere in the
|
||||
project), in at the nearest cut with the main track moving on and the composition growing (TL3j); each
|
||||
written into the working version the moment it is made, its draft played over the picture (TL9a,
|
||||
TL10d), finished and posted on Send with the agent told (TL9b: followed to the wire, a cutout's
|
||||
Send finishes the version on the host and then posts the item's own session, Cutter on Kimi in
|
||||
p-tutorial, a prompt holding the cutout's words, and nothing before Send; with the composition's
|
||||
tell skipped no prompt goes out. Live on Claude over ACP, nothing mocked between page and agent,
|
||||
the agent's first act was a search for "the v2 composition and matte"). A scene's sequences: move, trim,
|
||||
split, delete written into the scene's own file, which the stage opens again (TL14c). A sound's
|
||||
clips: span, place in the file, level (TL14b). An <Audio>'s sound from its copy with its noise
|
||||
reduced or its voice changed: its src the copy, and data-voice-of, data-denoise and data-voice (TL8d).
|
||||
A <Video>'s footage from its steadied copy: its src the copy, and data-steady-of and data-steady (TL7k);
|
||||
from its retouched copy, over the steadied one when both: data-retouch-of and the amounts (TL7n). A
|
||||
<Video> cut out: its matte prop and data-matte, brushed with data-brush-at and data-brush-strokes (TL7l,
|
||||
TL7m)
|
||||
plays TL10a for a film's own frames: cuts, moves, trims, speeds, freezes and reversed footage at once, the
|
||||
player's buffer on the ruler. TL10f: a timed 3D scene's frames are drawn ahead by the host a few
|
||||
seconds at a time at draft quality and kept by range, each range under what it is drawn from (the
|
||||
code outside the scene's sequences and the sequences on in it), so an edit to one sequence draws
|
||||
again only the ranges it is on and an undo plays what it had; the store stays under its one
|
||||
limit (TL10e), the least recently played going first, and beside the switch the
|
||||
scene's kept frames say what they take and are cleared by a click; the scene's timeline
|
||||
shows what is kept, and Play runs it over the stage from the scene's own camera. TL10d: where play
|
||||
reaches a range not kept yet while the frames are being drawn, the picture holds on it saying
|
||||
Buffering until a second from it is kept (with nothing being drawn, the live stage plays on), and
|
||||
a film that runs out of data says Buffering… over the picture. Seen in a headless raea window on
|
||||
the real host: the sample room drawn, kept, and played at its own rate; a 9 s copy of it opened
|
||||
again with every range kept at once (0.5 s); a sequence dragged across two of its three ranges
|
||||
drew those two again (9.4 s) and left every kept file as it was; and with nothing kept and Play
|
||||
pressed at once, Buffering to 7.7 s, the first range played, Buffering again at its end (11.0 s)
|
||||
until the next was kept (13.5 s)
|
||||
decided TL10b, c and e in the SDK (which ranges an edit changes, a range's key, what goes first); a
|
||||
composition's drafts are kept by their source, so an undo plays its draft again at once (and under
|
||||
the store's one limit since TL10e); beside a composition's timeline the
|
||||
kept drafts say what they take and are cleared by a click. Drafts and a scene's kept frames are
|
||||
drawn smaller than they ship and laid out as they ship (raea's <Composition edit={{ scale }}>, the
|
||||
long side at 960 px; docs/lightspeed.feature PF4): a ray-traced 1080p shot's draft 2.75 s at full
|
||||
size, 1.7 s scaled
|
||||
not built TL13a's drag at the window's rate with 400 clips, though close (measured below: Chrome keeps it;
|
||||
raea's window drew 35 frames a second, bound by the page host's frame after a step: Stylo's restyle,
|
||||
which Blitz widened to the changed element's parent's whole subtree, paint, and every element's rect
|
||||
taken each frame). raea-page-host now restyles finely by default (vendor/blitz-dom mutator.rs: what
|
||||
the snapshot's invalidation finds, the changed attribute named in the snapshot even when it was
|
||||
added, and each ancestor itself for `:has()`; RAEA_FINE_RESTYLE=0 for Blitz's own way), and a rect
|
||||
with no transform above it is answered without matrix math. ui-parity with it: 269/271, the same
|
||||
two cases failing as without (p15-media canvas-text, img-downscale); before the snapshot and :has()
|
||||
fixes it was 266. The app's timeline suite in a headless window with it: 53 of 54 pass, TL10d
|
||||
skipping itself there. Measured 11-14 in a headless window, three rounds alternating: the drag 38-41
|
||||
fps without, 48-50 with, against the window's still rate of 52-55, so about 90% of it; a pick
|
||||
42-62 ms and a split 46-63 ms. A sync of the twins that keeps their boxes on each pointer move
|
||||
(RAEA_TWIN_SYNC_LIGHT=1, a trial, off) gained nothing, again in four interleaved rounds with the fine
|
||||
restyle (drag over still 0.62-0.67 with it, 0.65-0.67 without). Under another session's load the
|
||||
drag held the same share of the still rate with the :has() fix as without (0.66-0.72 each, four
|
||||
rounds). Where a drag's frame goes now (a macOS sample of the page host's main thread with the fine
|
||||
restyle, 365 samples): the page's JavaScript for the pointer event 18%, paint 18%, the snapshot of
|
||||
every element's box for the page's JS 11%, the twins' boxes taken again before each event 7% and
|
||||
each frame 5%, Stylo's restyle 2.5% (28% before). The drag adds about 2 ms to a still frame of 18-19
|
||||
ms, so what is left is mostly the still frame: every element's box taken twice a frame and the page
|
||||
painted whole, with nothing changed; an incremental snapshot and paint would be the next step.
|
||||
Drawing only the clips in view would draw none fewer: at its opening fit all 12 tracks and all 400
|
||||
clips are on screen at once.
|
||||
TL13a's stage clause is met (an edit on the scene's stage by 88 ms, median, TL13b). The
|
||||
skills guide's note on an item's `timeline` field waits for PR #19 to merge
|
||||
|
||||
Background:
|
||||
Given the SDK is sdk/timeline in raea, the app's side is raea-feed src/detail (timeline, strip, blocks), the
|
||||
host's is raea-feed host (sequences.ts, edit.ts, preview/proxies.ts) and the engine's stage is engine/page/stage
|
||||
And every scenario below is a task (docs/agents.md "Tasks: rask"); a status line under a rule says what is built
|
||||
|
||||
Rule: TL0. One model: tracks, clips, keys, markers
|
||||
# Plan (crate or package | file | lines | job)
|
||||
# sdk/timeline | src/model.ts | 150 | Timeline, Track, Clip, Key, Marker, Ease; ids; frames as integers
|
||||
# sdk/timeline | src/ops.ts | 300 | every operation as (timeline, op) -> timeline; inverse for undo
|
||||
# sdk/timeline | src/snap.ts | 120 | what an edge snaps to, and the magnet's closing of gaps
|
||||
# sdk/timeline | src/keys.ts | 160 | a property's value at a frame; cubic bezier easing; presets
|
||||
# sdk/timeline | src/speed.ts | 120 | a speed curve's source time at an output time, and its length
|
||||
# sdk/timeline | src/read.ts | 200 | a timeline from a composition's read tree (host/sequences.ts' rows)
|
||||
# sdk/timeline | src/edits.ts | 200 | an operation as code edits to the working version
|
||||
|
||||
Scenario: TL0a. Time is whole frames
|
||||
Given a timeline at 30 frames a second
|
||||
Then every clip's start, length and trim, every key and every marker is a whole number of frames
|
||||
And a timecode is drawn from frames (mm:ss:ff), never the other way
|
||||
|
||||
Scenario: TL0b. An operation is a pure function with an inverse
|
||||
Given any timeline and any operation that applies to it
|
||||
Then applying the operation and then its inverse gives the timeline back, to the frame
|
||||
And an operation that can't apply (a locked track, a clip trimmed past its source) is refused with its reason
|
||||
|
||||
Scenario: TL0c. A timeline is read from a composition
|
||||
Given a composition with sequences, a <Video>, an <Audio>, a component and a <Series>
|
||||
Then each is a clip with its span, on a track by its kind and its depth in the tree, and names its element
|
||||
(file:line:col, docs/editing.feature E2)
|
||||
And a span written as an expression is a clip marked locked, with "set in code"
|
||||
|
||||
Scenario: TL0d. A feed item or a controller declares a timeline
|
||||
Given an agent posts a feed item, or a controller has a field, that carries a timeline (tracks of clips over
|
||||
anything with a time: a film, a song, a scene's animation, a schedule)
|
||||
Then the app draws it with the same strip and tools, and its operations go back to the agent as TL9 says
|
||||
|
||||
Rule: TL1. Tracks: a main track, overlays above, sound below, each with a head
|
||||
Scenario: TL1a. Tracks by kind, in CapCut's order
|
||||
Then from the top: effect and adjustment tracks, text tracks, overlay picture tracks, the main track, sound tracks
|
||||
And a new clip of a kind with no free track makes one in its place in that order
|
||||
|
||||
Scenario: TL1b. A track's head
|
||||
Then each track's head has its kind's icon and name, a lock, an eye (picture) or a speaker (sound)
|
||||
And a locked track's clips can't be picked or changed, a hidden one isn't drawn in the picture, a muted one isn't heard
|
||||
And these are edits like any other (TL9): the composition is drawn that way until they are turned back
|
||||
|
||||
Scenario: TL1c. Tracks expand
|
||||
Given the switcher on the left of a track (what it shows: frames, waveform, spectrogram, words, a plugin's lane)
|
||||
When I drag a track's lower edge, or double-click its head
|
||||
Then that track alone grows or shrinks, from a line to tall, and what it shows gains detail with its height
|
||||
And the whole timeline still resizes from its top edge and collapses to its scrubber (raea-feed PR #18)
|
||||
|
||||
Scenario: TL1d. The main track's cover and the first frame
|
||||
Then the main track's head shows the film's poster, and picking it sets the frame used as the item's poster
|
||||
|
||||
Rule: TL2. Moving through time
|
||||
Scenario: TL2a. The ruler and the playhead
|
||||
Then a ruler over the tracks marks time at the zoom's scale (frames, seconds, tens of seconds)
|
||||
And a press or a drag on the ruler or the scrubber moves the playhead and nothing else
|
||||
|
||||
Scenario: TL2b. Keys, as CapCut's
|
||||
Then Space plays and pauses; Left and Right step a frame; Shift+Left and Shift+Right step ten
|
||||
And Up and Down go to the cut before and after; Home and End to the first and last frame
|
||||
And every key is listed in one place (the app's shortcuts), can be changed there, and shows in its button's tooltip
|
||||
|
||||
Scenario: TL2c. Zoom and scroll
|
||||
Then Cmd+= and Cmd+- zoom about the playhead, Cmd+scroll about the pointer, Shift+Z fits the whole timeline
|
||||
And scroll moves through the tracks, Option+scroll (and a sideways scroll) through time
|
||||
And the zoom goes from the whole film in the strip's width to one frame at 12 px or more
|
||||
|
||||
Scenario: TL2d. The preview axis
|
||||
Given the preview axis is on (S)
|
||||
When the pointer moves over the tracks
|
||||
Then the picture shows the frame under the pointer without moving the playhead, and goes back when it leaves
|
||||
|
||||
Scenario: TL2e. Markers
|
||||
When I press M
|
||||
Then a marker is at the playhead (on the picked clip if one is picked, else on the timeline), which I can name,
|
||||
colour, drag and delete, and which edges snap to
|
||||
|
||||
Scenario: TL2f. A range marked for export
|
||||
When I press I at one place and O at another (in either order), or Shift+X with a clip picked (CapCut's
|
||||
"select an area by clip"; capcut.com/help/export-clip-of-video)
|
||||
Then the span between them is marked on the ruler, its ends dragged, and Option+X clears it
|
||||
And an export of the item renders only that span, all its tracks; with none marked it is the whole timeline
|
||||
And the range is how the timeline is seen, not an edit: it isn't sent, and it is kept with the item's timeline
|
||||
until it is cleared, so a later export isn't cut short without it showing
|
||||
|
||||
Rule: TL3. Clips: pick, move, trim, split, delete
|
||||
Scenario: TL3a. Picking
|
||||
Then a click picks a clip, Cmd+click adds or removes one, a box dragged from empty track picks what it touches
|
||||
And [ and ] pick every clip left or right of the playhead; Cmd+A all; Escape none
|
||||
And what is picked is what the viewer's inspector shows and what editor_selection tells the agent
|
||||
|
||||
Scenario: TL3b. Moving
|
||||
When I drag a clip (or the picked clips together)
|
||||
Then it moves in time on its track, or to another track that takes its kind, snapping as TL4 says
|
||||
And Option held while dragging leaves a copy behind
|
||||
|
||||
Scenario: TL3c. Trimming
|
||||
When I drag a clip's edge
|
||||
Then its start or end moves and, for media, its place in the source with it, never past the source's own ends
|
||||
And a trimmed edge can be dragged back out to what was there
|
||||
|
||||
Scenario: TL3d. Splitting
|
||||
Then Cmd+B splits the picked clips at the playhead (every clip under it when none is picked)
|
||||
And Cmd+Shift+B splits every track; B makes each click a split until A; a split clip's keys stay at their frames
|
||||
|
||||
Scenario: TL3e. Delete, delete left, delete right
|
||||
Then Delete removes the picked clips; on the main track with the magnet on, the gap closes
|
||||
And Q removes what is left of the playhead on the picked clip, W what is right of it, the gap closed
|
||||
And Shift+Delete closes the gap on any track
|
||||
|
||||
Scenario: TL3f. Copy, paste, duplicate, attributes
|
||||
Then Cmd+C, Cmd+X and Cmd+V copy, cut and paste clips at the playhead on their tracks; Cmd+D duplicates after
|
||||
And Cmd+Shift+C and Cmd+Shift+V copy a clip's properties, keys and effects onto the picked ones
|
||||
|
||||
Scenario: TL3g. Disable, group, compound
|
||||
Then V turns the picked clips off and on (drawn dimmed, left out of the picture and the sound)
|
||||
And Cmd+G groups clips so they pick and move as one; Cmd+Shift+G lets them go
|
||||
And Option+G makes the picked clips one compound clip (in code, one component holding them), opened by a
|
||||
double-click to edit inside; Option+Shift+G puts them back
|
||||
|
||||
Scenario: TL3h. Freeze, reverse, mirror, rotate, crop
|
||||
Then with a picture clip picked the bar offers Freeze (a still of the playhead's frame, 3 s, inserted there),
|
||||
Reverse, Mirror, Rotate (90 degrees) and Crop, each an edit to that clip's element
|
||||
|
||||
Scenario: TL3i. Undo and redo
|
||||
Then Cmd+Z and Cmd+Shift+Z step through every operation, the person's and the agent's (E5a), one history
|
||||
And a drag is one step however many frames it crossed
|
||||
|
||||
Scenario: TL3j. The project's media, added at the playhead
|
||||
Given the project's footage, stills and sounds (the files its Source page's Assets tab lists)
|
||||
When I open Media in the bar and press a file's +, as CapCut's media panel adds one
|
||||
Then it is a clip at the playhead as long as its file (a still 3 s, CapCut's default): footage and stills on
|
||||
the main track, a sound on a sound track
|
||||
And in a composition it is a sequence holding a <Video>, an <Img> or an <Audio> of the file, named by its path
|
||||
in the composition's media folder (a file elsewhere in the project copied into media/added/ first, since a
|
||||
render reads that folder alone); on the main track with the magnet on, the clips after it move on by its
|
||||
length and it is drawn under what was over them
|
||||
And in a film cut here it goes over the picture on an overlay track (the film's own cut is its scenes) and
|
||||
plays there, a sound plays where it is placed, and Send tells the agent which file went where
|
||||
|
||||
Rule: TL4. The magnet, snapping and linkage
|
||||
Scenario: TL4a. The main track's magnet (P)
|
||||
Given the magnet is on
|
||||
Then the main track has no gap: a clip removed closes it, a clip dropped between two moves the later ones on
|
||||
And a clip dragged past its neighbour's middle swaps places with it
|
||||
Given it is off
|
||||
Then clips stay where they are, a gap is allowed, and a clip dropped over another goes to a track above
|
||||
|
||||
Scenario: TL4b. Snapping (N)
|
||||
Then a dragged clip's edges, a trimmed edge and the playhead snap within 8 px to clip edges on every track,
|
||||
the playhead, markers, beats and the film's ends, with a line drawn where it snapped
|
||||
And Cmd held while dragging turns snapping off for that drag
|
||||
|
||||
Scenario: TL4c. Linkage (~)
|
||||
Given linkage is on
|
||||
Then what sits over a main-track clip (text, effects, overlays that start inside its span) moves, is split's
|
||||
left or right part, and is deleted with it
|
||||
And a video clip's own sound moves with it until Cmd+Shift+S extracts it to a sound track
|
||||
|
||||
Rule: TL5. Keyframes and curves
|
||||
Scenario: TL5a. A key is a property's value at a frame
|
||||
Given a clip is picked and the playhead is inside it
|
||||
When I press the diamond beside a property (position, scale, rotation, opacity, volume, any prop its element
|
||||
declares as a number, a colour or a point)
|
||||
Then that property has a key there; changing the value at another frame adds a key there
|
||||
And between two keys the value follows the first key's ease; before the first and after the last it holds
|
||||
And the numbers inside a mask (its centre, size, turn, feather, corners), a chroma key (strength, shadow) and a
|
||||
crop (each side) have their keys beside them in their panels, as the placement's are in the row, and the
|
||||
picture follows them as it plays; in a composition they are the <Nudge keys> of a dotted name ("mask.feather",
|
||||
"chroma.strength", "crop.left"), a curve that overshoots held inside what the value can be
|
||||
|
||||
Scenario: TL5b. Keys on the clip
|
||||
Then a clip with keys shows them as diamonds along it (Option+K shows or hides a row a property)
|
||||
And a diamond is dragged in time, copied, deleted; a click on one moves the playhead to it
|
||||
And the diamond beside the property steps to the key before and after
|
||||
|
||||
Scenario: TL5c. Easing is a cubic bezier, edited by hand
|
||||
When I open a span between two keys
|
||||
Then a graph shows its curve with two handles; dragging them changes it; the picture plays it as I drag
|
||||
And presets fill it (linear, ease in, ease out, ease in-out, hold, and those a plugin adds), and a curve I made
|
||||
can be saved by name for the workspace
|
||||
And in code a key's ease is its four numbers ([x1, y1, x2, y2]), "linear" or "hold"
|
||||
|
||||
Scenario: TL5d. Keys in code
|
||||
Then a property with keys is written on its element as one readable prop (keys={{ scale: [[0, 1], [45, 1.15,
|
||||
[0.2, 0, 0, 1]]] }} through one wrapper, as <Nudge> is for a still value), re-written in place on each change
|
||||
And a property animated by the composition's own code (interpolate, spring) is shown as a curve that can be
|
||||
read but not dragged, with "set in code"
|
||||
|
||||
Rule: TL6. Speed
|
||||
Scenario: TL6a. A constant speed
|
||||
When I set a picked clip's speed (Cmd+R) from 0.1x to 100x, or drag its edge with Option held
|
||||
Then its length follows, its sound keeps its pitch unless I say otherwise, and the magnet closes or opens the gap
|
||||
|
||||
Scenario: TL6b. A speed curve
|
||||
When I choose Curve (Shift+B)
|
||||
Then the clip has points from 0.1x to 10x over its source, with the presets Montage, Hero, Bullet, Jump cut,
|
||||
Flash in and Flash out, and a custom one whose points I drag, add and remove
|
||||
And the clip's length is the curve's, and a line over the clip shows where it is fast and slow
|
||||
|
||||
Rule: TL7. Transitions, effects, text
|
||||
Scenario: TL7a. A transition sits on a cut
|
||||
Given two clips that touch on one track
|
||||
When I drop a transition on their cut (or pick one from the cut's own button)
|
||||
Then it is drawn across the cut, its length dragged from either end, within what both clips have beyond the cut
|
||||
And it is a component both clips' elements are wrapped by in code, one a plugin can add
|
||||
|
||||
Scenario: TL7b. Effects, filters and adjustments are clips
|
||||
Then each is a clip on a track above the picture, covering the span it applies to, trimmed and keyed like any other
|
||||
And with linkage on it follows the main-track clip under its start
|
||||
|
||||
Scenario: TL7c. Text and captions
|
||||
Then a text is a clip on a text track; double-click edits its words in the picture; Enter splits a caption in two
|
||||
And captions made from the words (the transcript) are clips on a caption track, each moved, trimmed and edited
|
||||
|
||||
Scenario: TL7d. A clip's own In and Out animations
|
||||
Given a clip of footage, a still or text picked
|
||||
When I give it an In animation or an Out animation (CapCut's Animation tab: fade, slide, wipe, zoom, or a
|
||||
plugin's transition) and how many frames it takes
|
||||
Then it plays over the clip's own first or last frames, drawn as a ramp at that end of the clip, and the picture
|
||||
shows it at once
|
||||
And split, the first part keeps the In and the second the Out; it is never longer than the clip
|
||||
And in a composition it is the sequence's own <Transition in out>, the same component a cut's transition writes,
|
||||
and read back from it as the clip's own wherever no cut's transition takes it
|
||||
|
||||
Scenario: TL7e. A clip's Combo animation
|
||||
Given a clip of footage, a still or text picked
|
||||
When I give it a Combo (CapCut's third kind: pulse, sway, float, shake, swing, spin, flicker, or a plugin's)
|
||||
Then it moves over the clip's whole length, a cycle every so many frames: the clip's own length (what it starts
|
||||
at) plays it once, as CapCut's Combo does, and fewer loop it, as CapCut's text Loop does
|
||||
And it plays with the clip's In and Out at once, drawn as a line along the clip with a tick at each cycle
|
||||
And a Combo is data, a wave of the clip's x, y, scale, rotate and opacity over one cycle, so a plugin adds one in
|
||||
its manifest and the preview draws it
|
||||
And in a composition it is the sequence's <Transition combo>, written and read back
|
||||
|
||||
Scenario: TL7f. A clip's mask, blend and chroma key
|
||||
Given a clip of footage or a still picked
|
||||
When I give it a mask (CapCut's Mask tab: a line, a mirror band, a circle, a rectangle, a heart or a star)
|
||||
Then the picture is seen through it at once: a shape that starts round in the middle of the film, moved and
|
||||
sized in shares of the frame, turned, its edge feathered, a rectangle's corners rounded, or inverted to keep
|
||||
what is outside it
|
||||
When I give it a blend (Basic's Blend: darken, screen, overlay, multiply, lighten, hard and soft light, colour
|
||||
burn and dodge, add, difference, exclusion)
|
||||
Then it is drawn onto what is under it by that mode
|
||||
When I key a colour out of it (Cutout's Chroma key: a green or blue screen, or a colour typed, its strength and
|
||||
its shadow)
|
||||
Then that colour's hue goes from the picture, the screen's shadows let through half seen as far as the shadow
|
||||
says; a grey, which has no hue to key by, is refused in words
|
||||
And in a composition each is a prop of the sequence's <Nudge> (mask, blend, chroma), written and read back,
|
||||
and raea's renderer draws them as the preview does
|
||||
|
||||
Scenario: TL7g. A clip's own Adjust
|
||||
Given a clip of footage or a still picked
|
||||
When I adjust it (CapCut's Adjust tab: brightness, contrast, saturation, exposure, sharpen, highlights, shadows,
|
||||
temperature, tint, fade, vignette, grain), each a slider from as shot, keyed as any number is (TL5a)
|
||||
Then the picture shows it at once, under the effects over it, after its chroma key; a file from Media over the
|
||||
film shows its own, its vignette over its own picture where that sits in the frame
|
||||
And in a composition it is the sequence's <Nudge adjust>, written and read back: its tone one curve read through
|
||||
a table, its colour two colour matrices, sharpen a convolution, grain a noise whose seed is the frame, and a
|
||||
vignette a darkening laid over the part's frame; raea's renderer draws them as Chrome does (11-14 probe: tone,
|
||||
colour, sharpen and vignette within 0.4% RMSE of Chrome, grain the same strength, its noise its own)
|
||||
And Send tells the agent the adjustments as they now stand
|
||||
|
||||
Scenario: TL7h. The key's colour picked from the picture
|
||||
Given a clip of footage or a still picked, its chroma key open
|
||||
When I press pick and then press on the picture (CapCut's picker: a crosshair, a ring under the pointer)
|
||||
Then the key's colour is the clip's own at that point: read from its file where the player is in it, before its
|
||||
key, the mean of a small round patch so one noisy pixel doesn't set it, wherever the clip is placed, turned,
|
||||
scaled or mirrored on the film; a press off its picture is said, not read
|
||||
And the key takes it at once as a typed colour would, and the press leaves no comment and doesn't play
|
||||
And Esc, or pick again, stops picking and keeps the clip picked
|
||||
And the picture is read by the host from the file, not from the screen (raea's window has no canvas to read),
|
||||
so it is the same colour in raea's window and in Chrome
|
||||
|
||||
Scenario: TL7i. A mask's handles dragged on the picture
|
||||
Given a clip with a mask picked, its mask panel open and the playhead on it
|
||||
Then the mask's outline is drawn on the picture where it is, through the clip's placement, with CapCut's
|
||||
handles at a constant size: the shape itself to move it, an edge's for its width or its height, a corner's for
|
||||
both in proportion, a turn handle under it, a feather handle over it that runs out as the edge softens, and a
|
||||
rectangle's corner rounding along its top edge (a line has its turn and feather; a mirror's band its height)
|
||||
When I drag one
|
||||
Then the picture's mask follows as it moves and it is one edit when let go, the panel's numbers with it: a number
|
||||
keyed (TL5a) takes a key at the playhead, the rest a still value
|
||||
And a press on them leaves no comment and doesn't play
|
||||
|
||||
Scenario: TL7j. A text's words read aloud
|
||||
Given a text clip picked, in a film or a composition with a project
|
||||
When I press read aloud (CapCut's text to speech)
|
||||
Then its words are made into a voice on the host (raea gen speech: narration through raea's API, about a cent a
|
||||
line) and kept as a sound file of the project's, media/speech/ by the words and their hash, so the same words
|
||||
read again are the kept file and cost nothing
|
||||
And the voice is a sound clip on a sound track from where the text starts, as long as the voice, named by the
|
||||
words, as a file from Media is (TL3j); in a composition it is the host's edit, as that is
|
||||
And what goes wrong (no words, too many, no credit) is said beside the button, and nothing is added
|
||||
|
||||
Scenario: TL7k. Footage held steady
|
||||
Given a footage clip picked in a film cut here (one of the film's scenes, or footage of the project's over it)
|
||||
When I pick a level in Stabilise (CapCut's: Minimal cut, Recommended, Most stable)
|
||||
Then the host reads the part of its file the clip shows, small and grey, and finds each frame's move from the
|
||||
one before (a grid of blocks by phase correlation, fitted as one shift and turn, a thing moving across the
|
||||
picture left out); the moves add up to the camera's path, smoothed by the level (a slow sway kept at Minimal
|
||||
cut, held at Most stable), and the difference is the move for each frame with one zoom that keeps the frame's
|
||||
edges out of sight, kept as a file of the project's under media/stabilise by its file, frames and level
|
||||
And the player wears the moves under the clip's own placement, so its position, scale, turn and keys move the
|
||||
steadied picture, and the zoom is said in the row
|
||||
And not stabilised, it is as shot; what goes wrong is said beside the level, and nothing changes
|
||||
And the agent is told the level, the file of moves and what is in it, and the zoom (TL9b)
|
||||
|
||||
Scenario: TL7l. Footage cut out
|
||||
Given a footage clip picked in a film cut here (one of the film's scenes, or footage of the project's over it)
|
||||
When I pick what to keep in Auto cutout (CapCut's: a person, or the picture's subject, whatever it is)
|
||||
Then the host has the Mac's own vision models matte each frame of the part of its file the clip shows (no
|
||||
model downloaded, nothing sent anywhere), each a PNG whose alpha is what is kept, kept under media/matte by
|
||||
its file, frames and kind, so the same cutout asked again is read, not made
|
||||
And the player wears each frame's matte as it plays, cut into the clip's own mask (TL7f) and never adding to
|
||||
it, the next mattes fetched before they are worn; a part cut out shows what is under the clip
|
||||
And a long clip is matted every second or third frame, at most 900 mattes, each worn until the next
|
||||
And off, the picture is whole; what goes wrong (not a Mac, a subject cutout before macOS 14, a file with no
|
||||
moving picture) is said beside the menu, and nothing changes
|
||||
And the agent is told what is kept, by what, and where the mattes are and which frame each is (TL9b)
|
||||
|
||||
Scenario: TL7m. Footage cut out by what is brushed over it
|
||||
Given a footage clip picked in a film cut here, at a frame where what I want shows well
|
||||
When I pick Brushed in its cutout menu (CapCut's Custom cutout)
|
||||
Then a brush is on the picture, through the clip's placement: I brush over what to keep, and with the eraser
|
||||
over what to take out, at a width I set; a stroke can be taken back, or all of them, and brushing neither
|
||||
plays nor leaves a note
|
||||
And Cut out has the host find, on that frame, the things in the picture my strokes are over (the Mac's own
|
||||
vision models telling them apart), and follow them to the clip's end and back to its start, each frame's
|
||||
kept as TL7l keeps its mattes; nothing under what I kept is said, and the strokes stay to brush again
|
||||
And the player wears them as TL7l says, and Brushed opened again shows the strokes it was cut out by
|
||||
And the agent is told when it was brushed, its strokes, and where the mattes are (TL9b)
|
||||
|
||||
Scenario: TL7n. Footage retouched
|
||||
Given a footage clip picked in a film cut here, a person's face in it
|
||||
When I open its Retouch (CapCut's Retouch) and set smooth, brighten, slim face and bigger eyes, and apply
|
||||
Then the host finds the faces on each frame of the part of its file the clip shows and retouches them (the
|
||||
skin smoothed with its edges kept, brightened, the cheeks and jaw drawn in, the eyes made bigger), and keeps
|
||||
the frames, with that part's own sound under them, as one copy of the project's, named by its source, part
|
||||
and amounts, so the same retouch asked again is read, not made
|
||||
And the player shows the copy in the clip's place, in step with the playhead and wearing everything the clip's
|
||||
picture wears (its placement, mask, cutout, Adjust); the clip's picture goes only once the copy has the frame
|
||||
under the playhead, and a clip coming on next has its copy loaded before it does
|
||||
And applied again with other amounts it is a new copy; off, the picture as shot; what goes wrong (not a Mac, no
|
||||
face in it, longer than a minute) is said beside the sliders, and nothing changes
|
||||
And the agent is told the amounts, and where the copy is and the part of the file it holds (TL9b)
|
||||
|
||||
Rule: TL8. Sound
|
||||
Scenario: TL8a. The waveform, the volume line and fades
|
||||
Then a sound clip draws its waveform; a line across it is its volume, dragged up and down (Cmd+. and Cmd+,
|
||||
0.1 dB); a handle at each top corner drags a fade in and a fade out, drawn as the waveform's slope
|
||||
And volume takes keys as TL5 says
|
||||
|
||||
Scenario: TL8b. Beats
|
||||
When I ask for a sound clip's beats
|
||||
Then they are marked along it (the bed's beat map where raea made the music, else found from the sound), each
|
||||
can be turned off, and edges snap to them (TL4b)
|
||||
|
||||
Scenario: TL8c. A voice recorded onto the timeline
|
||||
When I press record and speak
|
||||
Then the take is a sound clip from the playhead on a sound track, and a file in the project
|
||||
|
||||
Scenario: TL8d. A sound's noise reduced and its voice changed
|
||||
Given a sound clip picked in a film cut here (a recording, a sound file of the project's, or the film's own
|
||||
sound taken out of its footage)
|
||||
When I press reduce noise, or pick a voice (CapCut's voice changer: chipmunk, deep, robot, telephone,
|
||||
megaphone, echo), or both
|
||||
Then the host makes a copy of the clip's own sound, never of a copy, with that done to it (its steady noise
|
||||
found in its quietest tenth and turned down per frequency; the voice by a phase vocoder, a filter or a delay),
|
||||
mono and as long as its own, kept under the project's media/voice by its file, size, time and settings, so
|
||||
asking again is the kept file
|
||||
And the clip plays the copy from where it played its own, and says so with a mark on it
|
||||
And both turned off, it plays its own sound again
|
||||
And what goes wrong (no sound here, longer than 20 minutes) is said beside the controls, and nothing changes
|
||||
And the agent is told what was done and the file it now plays (TL9b)
|
||||
|
||||
Rule: TL9. An edit is an edit, and the agent gets it as one
|
||||
Scenario: TL9a. Applied at once, to the working version
|
||||
When I make any operation above
|
||||
Then the working version's code is changed by it (docs/editing.feature E1a) and the picture shows it (TL10)
|
||||
And nothing asks me to confirm, and nothing is held as a suggestion
|
||||
|
||||
Scenario: TL9b. Sent to the agent as what was done
|
||||
Given the item's agent has a session (or is started for it, as a note's send does)
|
||||
When my sitting's edits are sent (when I leave the editor, press Send, or pause a while)
|
||||
Then the agent receives them as edits already made: the operations in order, each with the clip's element, the
|
||||
frames before and after, and the file and lines changed, with the version they made
|
||||
And its prompt says they are done and not to be redone or undone, and what is its to do next (render, check,
|
||||
carry the change to what depends on it)
|
||||
|
||||
Scenario: TL9c. The agent's edits are operations too
|
||||
When an agent changes the timeline (editor_edit, or the SDK's operations from its own code)
|
||||
Then they land in the open sitting's history as mine do, and I see each one happen
|
||||
|
||||
Scenario: TL9d. A timeline with no composition behind it
|
||||
Given a feed item or a controller whose timeline is its own data (TL0d)
|
||||
Then an operation changes that data where it is kept and is sent to its agent the same way
|
||||
|
||||
Rule: TL10. Playing while editing: buffer, cache, and clearing it
|
||||
Scenario: TL10a. The engine plays the working file
|
||||
Given a stage (the raea app)
|
||||
Then the picture is the engine drawing the working version at the playhead, for 2D, 3D and ray-traced scenes
|
||||
And a change shows on the next frame; no render stands between an edit and the picture (E4a)
|
||||
|
||||
Scenario: TL10b. Frames drawn are kept, by what draws them
|
||||
Then a range of frames the stage has drawn is kept (in memory near the playhead, on disk beyond it) under a key
|
||||
of everything that draws it: the clips over it, their props and keys, the media's own fingerprints
|
||||
And playing a kept range shows its frames without drawing them again, at the film's own rate
|
||||
And a bar over the ruler shows which ranges are kept and which are being drawn
|
||||
|
||||
Scenario: TL10c. An edit drops only what it changed
|
||||
When I move a clip from 2:00-2:05 to 2:10-2:15
|
||||
Then the kept frames of 2:00-2:05 and 2:10-2:15 are dropped and every other range plays from the store
|
||||
|
||||
Scenario: TL10d. Buffering ahead
|
||||
Given a part of the film that can't be drawn at its rate (a ray-traced scene, a 4K clip)
|
||||
Then while paused, and while playing ahead of the playhead, the stage draws and keeps what comes next
|
||||
And heavy media plays from its light copy while editing (the proxy store), and an export reads the originals
|
||||
And when playing reaches a frame that isn't ready, the picture holds and says "Buffering" until 1 s is ready
|
||||
|
||||
Scenario: TL10e. The store keeps itself small
|
||||
Then the kept frames live in the proxy store, under its one size limit, shown in Settings with what holds it
|
||||
And the least recently played ranges go first; a version that was closed or discarded goes at once; nothing a
|
||||
person made by hand is ever in it
|
||||
And clearing it by hand costs only time: everything in it is made again when needed
|
||||
|
||||
Scenario: TL10f. Whole sequences and scenes
|
||||
Then a Scene item's animation and a film's 3D shots play, scrub and cache the same way
|
||||
And a sequence of several compositions plays through its cuts without a gap or a reload
|
||||
|
||||
Rule: TL11. The framework: every part can be added to
|
||||
Scenario: TL11a. Contribution points
|
||||
Then a plugin (plugins/manifest.ts) can add: a kind of track, a kind of clip and how it draws on the strip, a
|
||||
property and its editor in the inspector, an easing preset, a speed preset, a transition, an effect, a lane,
|
||||
a tool in the bar with its key, and a snapping target
|
||||
And raea's own tracks, clips, easings and transitions are registered through the same points
|
||||
|
||||
@done
|
||||
Scenario: TL11b. The SDK alone
|
||||
# Status 11-13: built. The model is one import, `raea/editor` (sdk/raea/src/editor.ts re-exports sdk/timeline;
|
||||
# raea/timeline was already the video Sequence module), resolved by a bundle as @raea/timeline. Its reference page
|
||||
# is docs/manual/reference/sdk/editor.md, every type and field documented (the manual-ref gate fails on one
|
||||
# without), with docs/manual/examples/edits.tsx as its example: a timeline built in code, split, keyed, sped up
|
||||
# and undone by the inverses, rendered (180 frames to 150, then "as it was"). The skills' SDK reference lists it
|
||||
# (tools/skills.sh now follows export *, raea-skills #65) and motion/footage teaches it (raea-skills #64)
|
||||
Then sdk/timeline has no React and no DOM: an agent's script, the host and a test use it as the app does
|
||||
And its reference page lists every type and operation with an example, in the skills reference
|
||||
|
||||
Rule: TL12. Comments leave the timeline
|
||||
Scenario: TL12a. No comment is made on the timeline
|
||||
Then a press on the tracks never opens a comment card, with any tool on, and the strip's menu has no Comment item
|
||||
And Comment in the viewer pins a comment on the picture at the playhead's time, as it does now
|
||||
|
||||
Scenario: TL12b. A comment shows as a marker
|
||||
Then each comment with a time shows as a marker on the ruler in its author's hue; a click opens it in the viewer
|
||||
|
||||
Rule: TL13. Feel
|
||||
Scenario: TL13a. Under the pointer
|
||||
Then a drag, a trim and a scrub draw at the window's rate with 400 clips on 12 tracks, the dragged clip never
|
||||
more than a frame behind the pointer
|
||||
And a pick shows within 50 ms, a split within 100 ms, and the picture follows an edit within 100 ms where the
|
||||
stage plays it
|
||||
|
||||
Scenario: TL13b. Measured, as 0.1.4's were
|
||||
Then each number above has a harness and a before and after in this file, in a headless window
|
||||
# 11-13, raea-feed e2e/timeline-perf.spec.ts (PERF=1), headless Chrome on the M5 Pro, an item's own timeline
|
||||
# of 400 clips on 12 tracks, three runs:
|
||||
# a pick drawn 9, 10, 13 ms (the bar: 50 ms)
|
||||
# a split drawn 24, 26, 27 ms (the bar: 100 ms; 12 clips cut at once)
|
||||
# a 2 s drag 63 to 65 frames a second; a frame's median 14.2 to 14.8 ms, its 95th centile 27 ms,
|
||||
# its worst 34 to 49 ms: one frame in twenty is a frame late
|
||||
# The same in a headless raea window (blitz/pw-run.mjs, RAEA_PAGE_FPS=120), after each clip's and each
|
||||
# track's drawing was kept while nothing it shows changes (Chrome's drag went to 68 to 71 frames a second):
|
||||
# a pick drawn 45 to 59 ms (at the bar, not under it)
|
||||
# a split drawn 59 to 64 ms
|
||||
# a 2 s drag 27 to 31 frames a second, a frame's median 31 to 36 ms: not the window's rate
|
||||
# nothing moving 63 frames a second; the pointer moving over it, 61
|
||||
# and with 48 clips in place of 400: nothing moving 106 frames a second, a drag 56, a pick 39 ms. So in the
|
||||
# window both scale with the clips on screen: what the window draws each frame (16 ms for 400 clips, 9 for
|
||||
# 48) and what a drag step adds to it (about 18 ms, 8 with 48). Keeping the clips' drawings did not move the
|
||||
# window's numbers, so the step's cost there is not React's work on the clips: it is not yet told apart
|
||||
# between the operation itself (snapping and settling 400 clips) and the window laying the moved clips out.
|
||||
# Told apart since (the measurement times a step's operation and React's commit of it): a drag step asked
|
||||
# the page what was under the pointer (document.elementFromPoint, for the track a clip is carried to), which
|
||||
# in raea's window took 7.7 ms a step (0.2 ms in Chrome). The tracks' places are now read once when a clip
|
||||
# is first carried: the operation is 0.1 ms a step, its commit 2.5 ms, and the window's drag 35 to 37 frames
|
||||
# a second (a frame's median 24 to 26 ms), with nothing moving 80. What is left is the window's: a frame
|
||||
# after any change to the page costs about twice a still one with 400 clips on screen (a clip placed by a
|
||||
# transform instead of its left edge made no difference), so the rest is the engine's layout, not the app's.
|
||||
# 11-14, told apart further (PERF_LISTENERS times the window's host calls and splits a pointermove at the
|
||||
# handler and React's commit; a copy of sdk/ui timed inside built the bundle; PERF_SAMPLE takes a macOS sample
|
||||
# of raea-page-host): of a move's 10 ms in the page, 9.5 went to finding its target, every element hit-tested
|
||||
# in JavaScript, since the clip held no capture. A clip carried over its neighbour is shown on a track with
|
||||
# room for the step, its element made again there, and the capture went with the old one (in Chrome too: a
|
||||
# release over an empty stretch of track never lifted the drag). The clip's new element takes it back now: a
|
||||
# move costs the page 2.3 ms (React's commit 1.8), every move makes a step (67 of 68, against 31 of 62), and
|
||||
# the drag still draws 33 to 35 frames a second, with nothing moving 71 to 77. The host's main thread through
|
||||
# the drag: Stylo's restyle 28%, paint 15%, the page's JavaScript 14%, layout_out 11% (each element's rect
|
||||
# with its ancestors' transforms, every frame, to send the snapshot when it changed), waiting on the render
|
||||
# world 11%. Blitz's set_attribute adds restyle_subtree() to the element and its parent (an upstream TODO)
|
||||
# on top of the snapshot Stylo already diffs, so a clip's left restyled every clip on its track;
|
||||
# RAEA_FINE_RESTYLE=1 leaves it to the snapshot's invalidation (vendor/blitz-dom, off by default), waiting on
|
||||
# a release build of raea-page-host, which the disk had no room for, to be measured and run against ui-parity.
|
||||
# The picture following an edit, 11-14 (raea-feed b7e1514, blitz/scene-timeline.sh: the feed's sample room with
|
||||
# its crate in a sequence, the playhead in the crate's span, the crate's sequence carried off it and back, in a
|
||||
# headless 960x620 window). Before, the stage showed an edit only when the file written with it opened again,
|
||||
# about 1,050 ms after the release. Now the edit goes to the stage as props as it is let go (__raeaSequences:
|
||||
# each named sequence's start and length, which a Sequence takes over its own until that file has opened),
|
||||
# and a paused stage seeks its frame again so it draws them. Captures run back to back through each edit; the
|
||||
# first with the change came back within, over 16 edits:
|
||||
# 81 to 113 ms, median 88 (each counts the capture's own read back, about 78 ms, so the change is sooner)
|
||||
# and 15 of the 16 within 100 ms. The playhead kept its frame through every reopening (one pixel, 678, in all
|
||||
# 16), where it used to jump back to frame 0 and then to its frame; a clip cut where the composition ends kept
|
||||
# the length its code says when carried back (54 frames before, 60 now). Left to the engine: a paused stage
|
||||
# doesn't draw props set on it until something steps it (Live::set_props; the app seeks to work around it),
|
||||
# and the file opened again holds the stage's thread about a second, a hitch when it is playing.
|
||||
# Not yet: RAEA_FINE_RESTYLE measured, and layout_out and paint skipping what didn't change.
|
||||
|
||||
Rule: TL14. Watch, Listen and Scene are one timeline
|
||||
Scenario: TL14a. Watch
|
||||
Then a film in the feed opens with the timeline under it: the render's own reference (frames, waveform,
|
||||
words) when it has no composition, the composition's tracks when it has, edited in place (no separate editor)
|
||||
|
||||
Scenario: TL14b. Listen
|
||||
Then a sound in the feed has the same timeline: its stems as sound tracks, notes and parts as clips where
|
||||
raea made the music, with TL8's tools
|
||||
|
||||
Scenario: TL14c. Scene
|
||||
Then a 3D scene in the feed has the same timeline: its animation clips, cameras' cuts and keyed props as
|
||||
tracks, the stage as its picture, with TL5's keys on any animatable prop
|
||||
@@ -184,7 +184,7 @@ fn open(names: &[String], fps: f64, serve: Option<u16>) -> R<Peer> {
|
||||
// no plugin named: the clock still steps by frames
|
||||
let dt = Duration::from_secs_f64(1.0 / fps.max(1.0));
|
||||
app.world_mut().resource_mut::<Time<Fixed>>().set_timestep(dt);
|
||||
app.insert_resource(PluginClock { stepped: 0, dt, advancing: false, steps: 0 });
|
||||
app.insert_resource(PluginClock { stepped: 0, dt, advancing: false, steps: 0, pure: false });
|
||||
}
|
||||
if let Some(port) = serve {
|
||||
#[cfg(feature = "remote")]
|
||||
|
||||
@@ -43,6 +43,34 @@ impl EditResolve {
|
||||
let imp = named.canonicalize().map(raea_io_home::plain).unwrap_or_else(|_| named.to_path_buf());
|
||||
imp.starts_with(&self.0.work) && !imp.components().any(|c| c.as_os_str() == "node_modules")
|
||||
}
|
||||
|
||||
/// whether an importer is the edit's own code: its sources (src/) or what it imports from outside its folder (ext/),
|
||||
/// not the SDK's copies beside them
|
||||
fn own_source(&self, imp: &str) -> bool {
|
||||
let named = Path::new(imp);
|
||||
let imp = named.canonicalize().map(raea_io_home::plain).unwrap_or_else(|_| named.to_path_buf());
|
||||
self.from_edit(&imp.to_string_lossy()) && ["src", "ext"].iter().any(|d| imp.starts_with(self.0.work.join(d)))
|
||||
}
|
||||
|
||||
/// A package's import of the SDK by its names ("raea", "raea/<module>", "@raea/<package>"): the work folder's copy
|
||||
/// of that module, where the edit's own imports of it were pointed (runtime/bundle's rewrite_into: sdk/raea/src's
|
||||
/// files at motion/, a package's at <package>/ beside it), so a package and the composition share one SDK and its
|
||||
/// hooks read the Clock the engine drives. A package isn't rewritten, so its import resolved nothing from its own
|
||||
/// folder and Rolldown left `raea` an outside global: "Can't find variable: raea" before the first frame (#151)
|
||||
fn sdk_copy(&self, spec: &str) -> Option<PathBuf> {
|
||||
if !(spec == "raea" || spec.starts_with("raea/") || spec.starts_with("@raea/")) {
|
||||
return None;
|
||||
}
|
||||
// sdk/react/js's grandparent
|
||||
let sdk = self.0.js.ancestors().nth(2)?;
|
||||
let f = raea_io_home::sdk::resolve(sdk, spec)?;
|
||||
let mut parts = f.strip_prefix(sdk).ok()?.components();
|
||||
let pkg = parts.next()?.as_os_str().to_string_lossy().into_owned();
|
||||
// its src/
|
||||
parts.next()?;
|
||||
let copy = self.0.work.join(if pkg == "raea" { "motion" } else { pkg.as_str() }).join(parts.as_path());
|
||||
copy.is_file().then_some(copy)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -83,6 +111,21 @@ mod tests {
|
||||
assert!(!r.from_edit(&alias.join("node_modules").join("pkg").join("index.js").to_string_lossy()));
|
||||
let _ = std::fs::remove_dir_all(&d);
|
||||
}
|
||||
|
||||
/// three's stand-in is for the edit's own code (src/, ext/): never the SDK's copies beside it, nor a package
|
||||
#[test]
|
||||
fn the_edits_own_code_is_its_sources_and_what_it_brings_in() {
|
||||
let work = std::env::temp_dir().join(format!("raea-edit-own-{}", std::process::id()));
|
||||
for f in ["src/scene.tsx", "ext/lib.ts", "r3f/input/vanilla.ts", "playable/host/main.tsx", "src/node_modules/pkg/index.js"] {
|
||||
std::fs::create_dir_all(work.join(f).parent().unwrap()).unwrap();
|
||||
std::fs::write(work.join(f), "").unwrap();
|
||||
}
|
||||
let r = EditResolve::new(Edit { dir: work.clone(), js: work.clone(), work: work.clone() });
|
||||
let own = |f: &str| r.own_source(&work.join(f).to_string_lossy());
|
||||
assert!(own("src/scene.tsx") && own("ext/lib.ts"));
|
||||
assert!(!own("r3f/input/vanilla.ts") && !own("playable/host/main.tsx") && !own("src/node_modules/pkg/index.js"));
|
||||
let _ = std::fs::remove_dir_all(&work);
|
||||
}
|
||||
}
|
||||
|
||||
/// The person's plugins (the raea app's Plugins page installs them here with npm): RAEA_PLUGINS, else ~/.raea/plugins.
|
||||
@@ -106,6 +149,12 @@ async fn resolve_from(ctx: &PluginContext, spec: &str, dir: &Path) -> anyhow::Re
|
||||
/// raea's own text (sdk/r3f/src/input/troika.ts, text.ts; docs/r3f.feature R3F13).
|
||||
const STAND_INS: &[(&str, &str)] = &[("troika-three-text", "sdk/r3f/src/input/troika.ts")];
|
||||
|
||||
/** three as the edit's own code imports it: three with its renderer a stand-in that draws nothing and records what it
|
||||
* renders, for <Three program> (sdk/r3f/src/input/vanilla.ts, program.ts; docs/r3f.feature R3F19), at the work
|
||||
* folder's copy of the r3f package so it imports the edit's three. Three's own modules, its addons and the SDK's
|
||||
* copies (the playable host's real WebGLRenderer) import three as it is. */
|
||||
const THREE_STAND_INS: &[(&str, &str)] = &[("three", "r3f/input/vanilla.ts"), ("three/webgpu", "r3f/input/vanilla-webgpu.ts")];
|
||||
|
||||
impl Plugin for EditResolve {
|
||||
fn name(&self) -> Cow<'static, str> {
|
||||
Cow::Borrowed("raea:edit")
|
||||
@@ -128,6 +177,18 @@ impl Plugin for EditResolve {
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some((_, own)) = THREE_STAND_INS.iter().find(|(p, _)| *p == spec) {
|
||||
let f = e.work.join(own);
|
||||
if self.own_source(imp) && f.is_file() {
|
||||
return Ok(Some(HookResolveIdOutput::from_id(f.to_string_lossy().as_ref())));
|
||||
}
|
||||
}
|
||||
// a package importing the SDK: the copy the edit's own sources use (the edit's own were pointed at it already)
|
||||
if !self.from_edit(imp) {
|
||||
if let Some(f) = self.sdk_copy(spec) {
|
||||
return Ok(Some(HookResolveIdOutput::from_id(f.to_string_lossy().as_ref())));
|
||||
}
|
||||
}
|
||||
let bare = spec.starts_with('@') || spec.starts_with(|c: char| c.is_ascii_lowercase());
|
||||
if !bare || spec.starts_with("@raea/") || spec.contains(':') {
|
||||
return Ok(None);
|
||||
|
||||
Loaded 100 of 591 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user