Compare commits

...
4 Commits
Author SHA1 Message Date
shinyobjectz b83fd4a5ec The exposure check calls a pixel clipped white only when every channel is at the top
A flat 2D playable (pale sand, a yellow sun) was reported as 66% clipped to white: a pixel counted as clipped when its
brightest channel reached 254, so every saturated or pale colour did. White is all three channels at the top.
2026-12-05 10:52:56 -08:00
shinyobjectz ace6115ef7 Captions keep a crisp dark edge under their soft shadow, so they read over white product shots and sky
A soft 24 px shadow alone left white and accent words at 2.2:1 over a white product screenshot (the check's contrast
rule wants 3:1). A 2 px and a 6 px dark edge go under it.
2026-12-05 10:20:47 -08:00
shinyobjectz da233067b7 The check stops reading a reframe as an edit, and farm renders frame each person again
A take that plays straight on across two clips (a composition splits a clip when it reframes a shot mid-way) was read
by the sound rule as an edit point, so a word was "cut in two" where nothing was cut. sound.ts joins those clips first
(same source and level, touching in the cut and in the take, no fade between).

The farm linked each take sent by hash to its cache blob, named by its object id. A bundler follows the link, so a
composition that knows its takes by name (Framed's faces.json) found only a hash and framed every shot centred: faces
at the frame's edge in every farm-rendered cut. The link now ends at cache/named/OID/NAME, a hard link to the blob, and
the box maps that path back to the project's take as it did the blob's.

Tests: sdk/goal (72), test/farm_media.py (the link ends at the take's own name; fails on the old code), units.ts's
localSources case (units.ts's keep-alive case fails on main already).
2026-12-05 10:19:06 -08:00
shinyobjectz ee21e9ea77 raea cloud checks every render again: offload calls raea goal check, and a check that can't run fails the render
offload.ts ran the render's check as `raea make check`, which the CLI refuses (exit 2: make is the asset tools since
the goal/make split), and acted only on exit 1, so no cloud render had been checked: the agent saw a refusal line and
went on. It now calls `raea goal check OUT --at render`; exit 1 fails the render as before, and any other exit fails it
saying the check couldn't run. tools/legacy-names.sh now catches the old verb spawned as an argument list too.
2026-12-05 10:12:45 -08:00
10 changed files with 89 additions and 9 deletions

No files matched your search

+20 -2
View File
@@ -103,15 +103,33 @@ def fetch(work, cache, log=print, download=get, check=probe):
if os.path.lexists(dest): if os.path.lexists(dest):
os.remove(dest) os.remove(dest)
# a link into the cache, not a copy: a project's footage is gigabytes, the same across every job (11-25); every # a link into the cache, not a copy: a project's footage is gigabytes, the same across every job (11-25); every
# container of the job mounts the volume at the same place, so the link resolves on the GPUs too # container of the job mounts the volume at the same place, so the link resolves on the GPUs too. It ends at a
# file with the take's own name (cache/named/OID/NAME, a hard link to the blob): a bundler follows the link, and
# a composition that knows its takes by name (Framed's faces) found only a hash and framed every shot centred
try: try:
os.symlink(blob, dest) os.symlink(named(cache, oid, path), dest)
except OSError: except OSError:
shutil.copyfile(blob, dest) shutil.copyfile(blob, dest)
log(f"raea farm: {len(objects)} media files by hash, {fetched / 1e6:.1f} MB from R2, {cached / 1e6:.1f} MB already here") log(f"raea farm: {len(objects)} media files by hash, {fetched / 1e6:.1f} MB from R2, {cached / 1e6:.1f} MB already here")
return {"objects": len(objects), "fetched": fetched, "cached": cached} return {"objects": len(objects), "fetched": fetched, "cached": cached}
def named(cache, oid, path):
"""the blob under the take's own name, cache/named/OID/NAME: a hard link (the same file, no space), else the blob"""
blob = os.path.join(cache, oid)
out = os.path.join(cache, "named", oid, os.path.basename(path))
if os.path.exists(out) and os.path.getsize(out) == os.path.getsize(blob):
return out
try:
os.makedirs(os.path.dirname(out), exist_ok=True)
tmp = f"{out}.part-{os.getpid()}"
os.link(blob, tmp)
os.replace(tmp, out)
return out
except OSError:
return blob
def is_media(path, size): def is_media(path, size):
ext = path.rsplit(".", 1)[-1].lower() if "." in os.path.basename(path) else "" ext = path.rsplit(".", 1)[-1].lower() if "." in os.path.basename(path) else ""
return ext in MEDIA or size >= LARGE return ext in MEDIA or size >= LARGE
+2 -1
View File
@@ -285,7 +285,8 @@ export function localSources(manifest: { sounds?: { clips?: { src: string }[] }
const byOid = new Map(media.map((m) => [m.oid, m.path])) const byOid = new Map(media.map((m) => [m.oid, m.path]))
let n = 0 let n = 0
for (const c of manifest.sounds?.clips ?? []) { for (const c of manifest.sounds?.clips ?? []) {
const oid = /(?:^|\/)(?:blobs\/)?([0-9a-f]{64})$/.exec(c.src)?.[1] // the farm's blob (blobs/OID) or the same under its own name (blobs/named/OID/NAME)
const oid = /(?:^|\/)(?:blobs\/)?(?:named\/)?([0-9a-f]{64})(?:\/[^/]+)?$/.exec(c.src)?.[1]
const p = oid ? byOid.get(oid) : undefined const p = oid ? byOid.get(oid) : undefined
if (p) { if (p) {
c.src = path.join(root, p) c.src = path.join(root, p)
+8 -1
View File
@@ -211,10 +211,14 @@ async function main() {
} }
} }
say(`raea goal check ${path.basename(made)} --at render`) say(`raea goal check ${path.basename(made)} --at render`)
const r = spawnSync(REAL, ["make", "check", made, "--at", "render"], { stdio: "inherit", env: { ...process.env, RAEA_REAL: REAL } }) const r = spawnSync(REAL, CHECK_ARGS(made), { stdio: "inherit", env: { ...process.env, RAEA_REAL: REAL } })
if (r.status === 1) { if (r.status === 1) {
say(`${path.basename(made)} fails its checks: fix every ERROR above (each says what to change), then render again before any review`) say(`${path.basename(made)} fails its checks: fix every ERROR above (each says what to change), then render again before any review`)
process.exitCode = 1 process.exitCode = 1
} else if (r.status !== 0) {
// a refused or crashed check is loud: called by an old name, it was refused with exit 2 and every cloud render went unchecked
say(`raea goal check couldn't check ${path.basename(made)} (exit ${r.status ?? r.signal}): the render isn't done until it can`)
process.exitCode = r.status || 1
} }
} }
} finally { } finally {
@@ -222,6 +226,9 @@ async function main() {
} }
} }
/** raea's one check on a finished render, as the box runs it */
export const CHECK_ARGS = (made: string) => ["goal", "check", made, "--at", "render"]
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
main().catch((e) => { main().catch((e) => {
say((e as Error).message) say((e as Error).message)
+5 -1
View File
@@ -79,13 +79,17 @@ ws = job([{"path": "media/int1.MOV", "oid": soid, "size": len(sent)}])
gets = hits["GET"] gets = hits["GET"]
ss = fm.fetch(ws, cache, log=lambda _: None) ss = fm.fetch(ws, cache, log=lambda _: None)
assert open(os.path.join(ws, "media/int1.MOV"), "rb").read() == sent and os.path.islink(os.path.join(ws, "media/int1.MOV")) assert open(os.path.join(ws, "media/int1.MOV"), "rb").read() == sent and os.path.islink(os.path.join(ws, "media/int1.MOV"))
# followed to the end, the link is a file with the take's own name: a bundler resolves it, and a composition that knows
# its takes by name (Framed's faces) still finds this one
real = os.path.realpath(os.path.join(ws, "media/int1.MOV"))
assert os.path.basename(real) == "int1.MOV" and os.path.samefile(real, os.path.join(cache, soid)), real
assert ss == {"objects": 1, "fetched": 0, "cached": len(sent)} and hits["GET"] == gets, ss assert ss == {"objects": 1, "fetched": 0, "cached": len(sent)} and hits["GET"] == gets, ss
try: try:
fm.fetch(job([{"path": "media/gone.MOV", "oid": "ab" * 32, "size": 10}]), cache, log=lambda _: None) fm.fetch(job([{"path": "media/gone.MOV", "oid": "ab" * 32, "size": 10}]), cache, log=lambda _: None)
raise AssertionError("footage never sent was used") raise AssertionError("footage never sent was used")
except ValueError as e: except ValueError as e:
assert "never sent" in str(e) assert "never sent" in str(e)
ok("footage the box sent the farm itself comes from the cache as a link, and footage it never sent is refused") ok("footage the box sent the farm itself comes from the cache as a link that ends at its own name, and footage it never sent is refused")
w1 = job([obj]) w1 = job([obj])
s1 = fm.fetch(w1, cache, log=lambda _: None) s1 = fm.fetch(w1, cache, log=lambda _: None)
+4
View File
@@ -213,6 +213,10 @@ console.log("units: ok")
assert.equal(localSources(m, [{ path: "media/raw/a1_hl1.mov", oid }], "/work/project"), 1) assert.equal(localSources(m, [{ path: "media/raw/a1_hl1.mov", oid }], "/work/project"), 1)
assert.deepEqual(m.sounds.clips.map((c) => c.src), ["/work/project/media/raw/a1_hl1.mov", "/work/abc/media/music.mp3", "f".repeat(64)]) assert.deepEqual(m.sounds.clips.map((c) => c.src), ["/work/project/media/raw/a1_hl1.mov", "/work/abc/media/music.mp3", "f".repeat(64)])
assert.equal(localSources({}, [], "/x"), 0) assert.equal(localSources({}, [], "/x"), 0)
// the farm's blob under the take's own name (blobs/named/OID/NAME) maps back the same
const named = { sounds: { clips: [{ src: `/__modal/volumes/vo-F8fh/blobs/named/${oid}/a1_hl1.mov` }] } }
assert.equal(localSources(named, [{ path: "media/raw/a1_hl1.mov", oid }], "/work/project"), 1)
assert.equal(named.sounds.clips[0].src, "/work/project/media/raw/a1_hl1.mov")
console.log("ok localSources") console.log("ok localSources")
} }
+22 -1
View File
@@ -121,6 +121,27 @@ export function seams(words: Word[]): { at: number; before: string; after: strin
return out return out
} }
/** a manifest's clips with every seam that isn't an edit joined: a take that plays straight on across two clips (the
* same source and level, touching in the cut and in the take, no fade between) is one clip, so its seam is never read
* as an edit point. A composition splits a clip that way when it reframes or restyles a shot mid-clip */
export function joined(clips: Clip[], fps: number): Clip[] {
const out: Clip[] = []
const frame = 1.5 / fps
for (const c of [...clips].sort((p, q) => p.from - q.from)) {
const prev = out.findLast((p) => p.src === c.src && Math.abs(p.to - c.from) <= 1)
const on =
prev &&
(prev.gainDb ?? 0) === (c.gainDb ?? 0) &&
prev.bus === c.bus &&
!prev.fadeOut &&
!c.fadeIn &&
Math.abs(prev.at + (prev.to - prev.from) / fps - c.at) <= frame
if (prev && on) Object.assign(prev, { to: c.to, fadeOut: c.fadeOut })
else out.push({ ...c })
}
return out
}
/** a voice clip's in and out: inside a word, or on sound */ /** a voice clip's in and out: inside a word, or on sound */
export function editPoints(c: Clip, fps: number, words: Word[], l: Levels): Finding[] { export function editPoints(c: Clip, fps: number, words: Word[], l: Levels): Finding[] {
const out: Finding[] = [] const out: Finding[] = []
@@ -210,7 +231,7 @@ export async function soundOf(f: FileFacts): Promise<{ findings: Finding[]; voic
out.push({ level: "error", kind: "manifest", at: null, says: `its render manifest holds ${frames} of the cut's ${length} frames, so its edit can't be checked: render the cut again` }) out.push({ level: "error", kind: "manifest", at: null, says: `its render manifest holds ${frames} of the cut's ${length} frames, so its edit can't be checked: render the cut again` })
const heard: Heard[] = [] const heard: Heard[] = []
let voice = 0 let voice = 0
for (const c of m.sounds?.clips ?? []) { for (const c of joined(m.sounds?.clips ?? [], fps)) {
const kind = busOf(c) const kind = busOf(c)
const file = f.take(c.src) const file = f.take(c.src)
if (!file) { if (!file) {
+13 -1
View File
@@ -2,7 +2,7 @@ import { test } from "bun:test"
import assert from "node:assert/strict" import assert from "node:assert/strict"
import type { Clip } from "../src/facts.ts" import type { Clip } from "../src/facts.ts"
import type { Levels } from "../src/media.ts" import type { Levels } from "../src/media.ts"
import { balance, busOf, editPoints, nearestGap, soundOf, type Heard } from "../src/packs/sound.ts" import { balance, busOf, editPoints, joined, nearestGap, soundOf, type Heard } from "../src/packs/sound.ts"
test("the sound pack's measures", async () => { test("the sound pack's measures", async () => {
// the sound pack's measures, on made-up takes // the sound pack's measures, on made-up takes
@@ -114,3 +114,15 @@ test("a word timed longer than a word runs is no word to cut in two (12-04, Elfs
// a cut 4 s into the stretch, on quiet: nothing to say about a word // a cut 4 s into the stretch, on quiet: nothing to say about a word
assert.equal(editPoints(clip, 30, words, take).filter((f) => f.kind === "edit-in-word").length, 0) assert.equal(editPoints(clip, 30, words, take).filter((f) => f.kind === "edit-in-word").length, 0)
}) })
test("a take that plays straight on across two clips is one clip: its seam is no edit point", () => {
const take = "/w/footage/Acme_Interview.mp4"
const a: Clip = { from: 76, to: 96, src: take, at: 53.7, gainDb: 5.5 }
const b: Clip = { from: 96, to: 183, src: take, at: 54.3667, gainDb: 5.5 }
assert.deepEqual(joined([b, a], 30), [{ ...a, to: 183, fadeOut: undefined }])
// a real cut: the take jumps, or the level changes, or the two meet in a fade
assert.equal(joined([a, { ...b, at: 92.9 }], 30).length, 2)
assert.equal(joined([a, { ...b, gainDb: -1 }], 30).length, 2)
assert.equal(joined([{ ...a, fadeOut: 0.2 }, b], 30).length, 2)
assert.equal(joined([a, { ...b, src: "/w/footage/Other.mp4" }], 30).length, 2)
})
+2 -1
View File
@@ -114,7 +114,8 @@ function CaptionLine({ g, saying, px, accent, style, className, children }: { g:
fontSize: px, fontSize: px,
lineHeight: 1.05, lineHeight: 1.05,
color: "var(--brand-text, #fff)", color: "var(--brand-text, #fff)",
textShadow: "0 4px 24px rgba(0,0,0,0.55)", // a crisp dark edge under the soft shadow: the words hold 3:1 over a white product shot or sky, not only over faces
textShadow: "0 0 2px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.8), 0 4px 24px rgba(0,0,0,0.55)",
overflowWrap: "break-word", overflowWrap: "break-word",
...style, ...style,
}} }}
+12 -1
View File
@@ -42,7 +42,9 @@ pub fn stats(rgba: &[u8]) -> Option<Exposure> {
let enc = if y <= 0.0031308 { 12.92 * y } else { 1.055 * y.powf(1.0 / 2.4) - 0.055 }; let enc = if y <= 0.0031308 { 12.92 * y } else { 1.055 * y.powf(1.0 / 2.4) - 0.055 };
sum_luma += enc; sum_luma += enc;
hist[(enc * 255.0).round().clamp(0.0, 255.0) as usize] += 1; hist[(enc * 255.0).round().clamp(0.0, 255.0) as usize] += 1;
if p[0].max(p[1]).max(p[2]) >= 254 { // white is every channel at the top: a saturated colour (a flat yellow sun, pale sand) has one channel there and
// isn't clipped
if p[0].min(p[1]).min(p[2]) >= 254 {
hi += 1; hi += 1;
} }
if p[0].max(p[1]).max(p[2]) <= 1 { if p[0].max(p[1]).max(p[2]) <= 1 {
@@ -170,6 +172,15 @@ mod tests {
assert!(b.found("f").iter().any(|(_, s)| s.contains("crush to black"))); assert!(b.found("f").iter().any(|(_, s)| s.contains("crush to black")));
} }
#[test]
fn a_saturated_colour_is_not_clipped_white() {
let sun: Vec<u8> = (0..100).flat_map(|_| [255, 184, 0, 255]).collect();
let sand: Vec<u8> = (0..100).flat_map(|_| [255, 229, 165, 255]).collect();
assert_eq!(stats(&sun).unwrap().clipped_high, 0.0);
assert_eq!(stats(&sand).unwrap().clipped_high, 0.0);
assert!(stats(&sun).unwrap().found("f").iter().all(|(_, s)| !s.contains("clip to white")));
}
#[test] #[test]
fn percentiles_and_transparency() { fn percentiles_and_transparency() {
// half black, half white: p01 black, p99 white; transparent pixels ignored // half black, half white: p01 black, p99 white; transparent pixels ignored
+1
View File
@@ -25,6 +25,7 @@ NAMES=(
'raea-runtime-(cut|goal)-plan => sdk/goal (raea/goal)' 'raea-runtime-(cut|goal)-plan => sdk/goal (raea/goal)'
'naming-check\.ts => raea/goal'"'"'s naming pack' 'naming-check\.ts => raea/goal'"'"'s naming pack'
'raea make (check|seen|look|judge|gates)\b => raea goal check|seen|judge|gates (MK45: goal is the loop, make the asset tools)' 'raea make (check|seen|look|judge|gates)\b => raea goal check|seen|judge|gates (MK45: goal is the loop, make the asset tools)'
'"make", *"(check|seen|look|judge|gates)" => ["goal", "check", ...]: a spawned raea make check is refused with exit 2'
'raea make plan\b => raea make blockout (a project'"'"'s tasks: raea goal tasks)' 'raea make plan\b => raea make blockout (a project'"'"'s tasks: raea goal tasks)'
'raea next\b => raea goal next' 'raea next\b => raea goal next'
'raea (clothes|motion|solid|wear|splat|physics|bake|sao|tokensynth|sounds|component)( |`|$) => raea make clothes, motion, solid... (MK45: the asset tools are under make)' 'raea (clothes|motion|solid|wear|splat|physics|bake|sao|tokensynth|sounds|component)( |`|$) => raea make clothes, motion, solid... (MK45: the asset tools are under make)'