Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 3ab943cc5b4fc1f29a1e667581266ef41f9d4fb6
parent d301776055748f7c2152800940811ab11adb285d
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 12 Nov 2026 23:16:17 -0500

umtool: no chrome over an analysis item -- every region's overlay leaves its span out (chromeBlackouts)

rev9-a10 R1: the diet strip, the goal notes and the promise clock were laid over the analysis page. The deck's
choreography hides the deck, dial, odometer and trail over a segment that hides it, but the measure extras keep
no such time, and the build's overlay blackouts (videoBlackouts) covered only a video entry. chromeBlackouts adds
each analysis segment, from the first frame of its dissolve in to the end of its dissolve out (the cut's end + 1
when it is last); every region's overlay -- the full cut, a preview, a --cut-window -- takes it as an `enable`.
A cut without an analysis item lays exactly the blackouts it did. Test over the real overlay planners
(analysis-chrome-off.test.mjs); docs say it.

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
Mumtool/docs/report-video.md | 7+++++--
Aumtool/report-to-video/analysis-chrome-off.test.mjs | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/report-to-video/analysis-plan.mjs | 18++++++++++++++++++
Mumtool/report-to-video/build-video.mjs | 16++++++++++++++--
4 files changed, 117 insertions(+), 4 deletions(-)

diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -533,8 +533,11 @@ row, a two-line reading, the QR -- has clear room. **Its segment** is composed and rendered once (`chrome/analysis-<id>/`, cached by its page key, as a teaser's is) and encoded with its sound; `segments/<id>.analysis.json` keys the frames, the sound (the source file, its offset, its gain) and the encode, so an unchanged item is not encoded again, and -`--chrome-only` rebuilds it from the cache; a `--cut-window` preview lays it as any segment. The deck is away -over it (full frame). It draws in the deck's faces: a cut without `render.fontRegular` and `render.fontBold` +`--chrome-only` rebuilds it from the cache; a `--cut-window` preview lays it as any segment. Its page is the +whole frame: **no chrome layer is laid over it** -- the deck, the instruments, the diet strip and the goal notes, +the promise clock, the stamps, the effects, the chapter bands, every region -- each region's overlay leaves its +span out (`chromeBlackouts`, as a video entry's), from the first frame of its dissolve in to the end of its +dissolve out (to the cut's end when it is last). It draws in the deck's faces: a cut without `render.fontRegular` and `render.fontBold` is refused early. No vertical form: a 9:16 cut, or `--vertical` on a landscape one, refuses it before anything is spent. Its date axis is by days alone (`trailLayout`'s `dayShare: 1`), whatever share the by-date trail gives its weights: a span's width says its days. `umtool ledger rm` refuses diff --git a/umtool/report-to-video/analysis-chrome-off.test.mjs b/umtool/report-to-video/analysis-chrome-off.test.mjs @@ -0,0 +1,80 @@ +// NO CHROME OVER AN ANALYSIS ITEM (rev9-a10 R1, 13 Nov: the diet strip, the goal notes and the promise clock were +// laid over the analysis page -- the deck's own choreography hides the deck, the dial, the odometer and the trail +// over it, but the measure extras keep no such time). Every overlay module the build lays (modules deckOverlays, +// their real `regions` planners) gets an `enable` that leaves the analysis segment's span out -- from the first frame +// of its dissolve in to the cut's end -- as a video entry's (build-video.mjs chromeBlackouts, chromeOverlayChain). +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import path from "node:path"; +import test from "node:test"; +import { fileURLToPath } from "node:url"; + +import { chromeBlackouts, chromeOverlayChain } from "./build-video.mjs"; +import { analysisBlackouts } from "./analysis-plan.mjs"; +import { deckOverlays } from "./modules/index.mjs"; +import { videoBlackouts } from "./video-entry.mjs"; + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const MEASURE = JSON.parse(readFileSync(path.join(HERE, "fixtures/measure-extras/measure.json"), "utf8")); +const RENDER = { + width: 1920, height: 1080, fps: 30, + palette: { bg: "#0F1312", fg: "#EDF0EC", muted: "#98A29B", accent: "#22AB83", amber: "#E8A33F" }, + chrome: { engine: "hyperframes", layout: "deck", deck: { dial: true, odometer: true, trail: true, diet: {}, goals: {}, promise: {}, peak: true, streak: {} } }, +}; +const D = 0.4; +// Clips to 732.6 s, then the analysis item 732.6–739.6, the cut's last. +const SCHEDULE = { + kind: "deck", fps: 30, total: 739.6, transition: D, + segments: [ + { id: "a", type: "clip", start: 0, duration: 733, end: 733 }, + { id: "analysis", type: "analysis", start: 732.6, duration: 7, end: 739.6, hideDeck: true }, + ], + measure: MEASURE, +}; + +/** Each overlay's enable, as a predicate of cut second t (blackoutEnable's `not(between(...)+...)`). */ +function enabledAt(part, t) { + const m = /enable='not\((.*)\)'/.exec(part); + if (!m) return true; + const spans = [...m[1].matchAll(/between\(t,([\d.]+),([\d.]+)\)/g)].map((x) => [Number(x[1]), Number(x[2])]); + return !spans.some(([a, b]) => t >= a && t <= b); +} + +test("every overlay module's region is off over the analysis segment, from its first frame to the cut's end", () => { + const on = deckOverlays().filter((m) => m.on(SCHEDULE, RENDER)); + const ids = on.map((m) => m.id); + for (const id of ["shell", "diet", "goals", "promise", "dial", "odometer", "trail"]) assert.ok(ids.includes(id), `${id} is laid (${ids.join(", ")})`); + const regions = on.flatMap((m) => m.regions(SCHEDULE, { render: RENDER, outDir: "/out", frames: `/out/chrome/${m.region}-frames`, shift: 0 })); + assert.ok(regions.length >= ids.length); + const blackouts = chromeBlackouts(SCHEDULE); + assert.deepEqual(blackouts, [[732.6, 740.6]]); + const chain = chromeOverlayChain(RENDER, regions, "[0:v]", 1, { blackouts }); + const overlays = chain.chain.split(";").filter((p) => p.includes("overlay=")); + assert.equal(overlays.length, regions.length); + const fps = SCHEDULE.fps; + for (const part of overlays) { + // Every frame of the item: its dissolve in (732.6–733.0), the page, its last frames to the cut's end. + for (let f = Math.round(732.6 * fps); f <= Math.round(739.6 * fps); f += 1) assert.equal(enabledAt(part, f / fps), false, `${part.slice(0, 60)} at ${f / fps}`); + // ...and only there: the frame before the dissolve keeps the chrome. + assert.equal(enabledAt(part, 732.6 - 1 / fps), true); + assert.equal(enabledAt(part, 100), true); + } +}); + +test("in a window of the cut (--cut-window, a preview) the span is shifted to the window's clock", () => { + const regions = deckOverlays().filter((m) => m.id === "promise").flatMap((m) => m.regions(SCHEDULE, { render: RENDER, outDir: "/out", frames: "/f" })); + const chain = chromeOverlayChain(RENDER, regions, "[0:v]", 1, { blackouts: chromeBlackouts(SCHEDULE), shift: 730 }); + const part = chain.chain.split(";").find((p) => p.includes("overlay=")); + assert.equal(enabledAt(part, 2.6), false); + assert.equal(enabledAt(part, 2.5), true); +}); + +test("a cut without an analysis item: the blackouts it always had (a teaser's span is not one -- reported, unchanged)", () => { + const withTeaser = { ...SCHEDULE, segments: [SCHEDULE.segments[0], { ...SCHEDULE.segments[1], id: "t", type: "teaser" }] }; + assert.deepEqual(chromeBlackouts(withTeaser), videoBlackouts(withTeaser)); + assert.deepEqual(chromeBlackouts(withTeaser), []); + assert.deepEqual(analysisBlackouts(withTeaser), []); + // An analysis item mid-cut: off from its dissolve in to the end of its dissolve out. + const mid = { ...SCHEDULE, total: 760, segments: [...SCHEDULE.segments, { id: "b", type: "clip", start: 739.2, duration: 20.8, end: 760 }] }; + assert.deepEqual(chromeBlackouts(mid), [[732.6, 739.6]]); +}); diff --git a/umtool/report-to-video/analysis-plan.mjs b/umtool/report-to-video/analysis-plan.mjs @@ -194,6 +194,24 @@ export function analysisSeconds(entry) { return Number.isFinite(s) && s > 0 ? s : ANALYSIS_SECONDS.silent; } +/** + * THE CUT SECONDS NO CHROME DRAWS OVER, for an analysis item (its page is the whole frame): each analysis segment + * of the schedule as `[from, to]` cut seconds -- from the first frame of its dissolve in (its segment's start) to the + * last of its dissolve out (its end), the cut's end + 1 when it is last. The build lays every chrome region with an + * `enable` that leaves these out, as it does a video entry's (video-entry.mjs videoBlackouts). [] without one. + */ +export function analysisBlackouts(schedule) { + const segs = schedule?.segments ?? []; + const out = []; + segs.forEach((s, i) => { + if (s?.type !== "analysis" || !Number.isFinite(Number(s.start))) return; + const end = Number.isFinite(Number(s.end)) ? Number(s.end) : Number(s.start) + Number(s.duration); + const to = i === segs.length - 1 ? Number(schedule.total ?? end) + 1 : end; + out.push([Math.round(Number(s.start) * 1e4) / 1e4, Math.round(to * 1e4) / 1e4]); + }); + return out; +} + /** The ledger a cut's analysis reads: the variant's whole measure record (selectVariant keeps it), else the ledger. */ export const analysisLedger = (manifest) => (Array.isArray(manifest?.measureLedger) ? manifest.measureLedger : manifest?.ledger ?? []); diff --git a/umtool/report-to-video/build-video.mjs b/umtool/report-to-video/build-video.mjs @@ -155,7 +155,7 @@ import { } from "./sources.mjs"; // A clip whose media is a file beside the manifest (`src`, `cues`). import { clipLabel, createLocalMedia, hasLocalMedia, resolveManifestPath, validateLocalMedia } from "./local-media.mjs"; -import { analysisSeconds, validateAnalysisEntries } from "./analysis-plan.mjs"; +import { analysisBlackouts, analysisSeconds, validateAnalysisEntries } from "./analysis-plan.mjs"; import { blackoutEnable, validateVideoEntries, videoBlackouts, videoFit, videoLoudnessTarget, videoLead, videoMeasureFilter, videoSeconds, videoSegmentGraph, videoSegmentKey, videoSpan } from "./video-entry.mjs"; import { createPostChannelResolver, resolvePostLinks } from "./post-links.mjs"; import { ensureWriteDir } from "../lib/report/storage.mjs"; @@ -6157,11 +6157,23 @@ async function renderDeck({ manifestPath, render, outDir, variant, schedule, fro } // Over a video entry the chrome is OFF (video-entry.mjs): each region's overlay leaves its span out. // Only when the cut has one, so every other cut's graph is the one it was. - const blackouts = videoBlackouts(schedule); + const blackouts = chromeBlackouts(schedule); return { regions, outLabel: "[hfout]", ...(blackouts.length ? { blackouts } : {}) }; } /** + * The cut seconds every chrome region leaves out (its overlay's `enable`): a video entry's span (video-entry.mjs + * videoBlackouts) and an analysis item's, whose page is the whole frame (analysis-plan.mjs analysisBlackouts) -- + * no layer at all over it. A cut with neither: []. + */ +export function chromeBlackouts(schedule) { + const blackouts = videoBlackouts(schedule); + const analysisOff = analysisBlackouts(schedule); + if (analysisOff.length) blackouts.push(...analysisOff), blackouts.sort((x, y) => x[0] - y[0]); + return blackouts; +} + +/** * A cached concat is a base for the overlay only when it is as long as the * schedule says AND no segment is newer than it: a re-trimmed clip that kept * its length would otherwise pass the length check and play the old cut.