Repository navigation
Import the N4 video editing engine - #152
Merged
Merged
Conversation
The spatial rasterizer accepts a rig of rect lights with a constant ambient term through record_studio_rig. record_studio is unchanged. nothing-spatial-cycles drives a pinned Cycles v5.3.0 session from nothing-spatial data. It builds without Cycles and reports how to provision it; tools/provision.sh builds the bundle into .local/cycles.
…shot A scene3d accepts rect-light, ambient-light and path-trace, and a surface accepts role="emissive" with emission and glow. The rasterizer lights such a scene from its rect lights and ambient term. Existing documents are unaffected: the new fields are optional and are not written when default.
A scene3d with path-trace is drawn by the rasterizer as a Draft until its Final exists. Engine::render_final traces missing scenes with the authored recipe and keeps them in a store keyed by what the scene evaluates to, so an edit outside the scene reuses the picture. The n4 render command gains --final and --final-store. Cycles is optional: build n4-engine with --features cycles after running spatial/cycles/tools/provision.sh. Without it render_final says so. The bridge caps Cycles' path pool by default and delivers in-progress pictures; an earlier note that it could not was wrong.
Export feeds the encoder Finals and traces what is missing; a build without a path tracer fails instead of delivering a Draft. n4 finish traces a frame range into the user cache so the viewer and a later export reuse it. The transport follows a parked Draft with its Final, interrupts the trace when the user moves on, and does not cache Draft pictures. In-progress pictures from Cycles are chosen when a session is created.
tools/qualify.py edits a private copy of the shot through the n4 command line and records what was traced, reused and how long it took. The receipt is from an Apple M4 Pro.
The host controller keeps polling a parked Draft for the Final the transport sends after it. The native viewer's title says which one is on screen.
Viewer: a reloaded Draft is labelled and followed by its Final, and parking on a Draft reached by playing or dragging asks for its Final. Cancellation: a stop is a standing request the bridge watches for the whole render. It stops the path tracer only, because Cycles' own cancel retires the Metal device. An export can interrupt a parked trace. Key: file contents instead of paths, so a relative path, a copy of the project and media replaced under the same name all behave. The shot clock is included where a screen shows video, a wipe or a periodic shader. Mesh parts, texture bindings and image sizes, the device, and the Cycles release and bridge revision are covered. Stored pictures from the previous key are not reused. Store: the user cache evicts least recently used pictures beyond 20 GB (N4_FINAL_STORE_GB); a named directory is never trimmed. Corrupt or mismatched pictures are rejected. Bridge: sized read-backs, per-thread errors, guarded entry points, and a monitor that may outlive its session. provision.sh pins commits and can be re-run. Qualification: 12 of 12 on Metal, receipt updated.
Path-traced Final through embedded Cycles
Share timing, seeking and alpha-aware resizing between animated image readers. Pin accepted media for preview, thumbnails and export, and qualify transparency, disposal and reload behavior with CC0 fixtures.
Move to skia-safe 0.158. On the CPU its pictures are unchanged: twelve frames of the two examples match 0.90 byte for byte. The default `skia-gpu` feature draws rectangles, paths and labels through Skia's Graphite renderer into compositor textures on the engine's own device and queue, without painting on the CPU and uploading. One painter trait receives the same canvas calls for both targets. `N4_SKIA_GPU=0`, or a build without the feature, selects the CPU reference. SVG and decoded images still arrive as uploaded pixels. Antialiased edges differ slightly between the two painters. A native path and an SVG of the same shape give the same bytes on the CPU reference; on the default pair they agree within a rounding step except at fractional corners, and the two tests that compared them say so. Run on an Apple M4 Pro: the workspace tests on the default painter and the engine tests on the CPU reference pass except the existing tests/proxy.rs failure; the Cycles path-trace test, the editor and host tests and the asset check pass. The hosted runner has not built the new default yet.
Hand edits. The editor session slides and trims an overlay or a sound, reorders shots, and takes each as a gesture with one undo step. The Electron timeline draws the dragged clip under the pointer and lets the engine follow. A row may end with `in <frames>`, which shows its target from that frame of the target's own clock. Compositions (RFC 0011). A film is a folder with an index named composition.n4. A row places a file or another folder by a path relative to its index, and a placed composition has its own clock and length. A row can show a window of it, and it can be placed more than once. The index replaces project.proj, the sequences/ folder and indented nesting. - The reader loads a tree of indexes and reports a cycle, a missing target, a window past the end and two things under one name. - A placed composition is a definition with uses. The watcher follows every index, and a changed index damages each use over its window. - A row edited through a use is rewritten in the composition's own index. The session holds the text of every index. Undo restores that set, save writes only the indexes that changed, and a change on disk to any of them is a conflict. - The command line, the sidecar, the Electron harness and the Python SDK open a composition folder. A detail is named by its path from it. - Signal Atlas and Field Unit are converted, and the fixtures and tests are rewritten. The old reader is removed. A film in the older layout is converted once with scripts/convert-to-compositions.py, and the engine names that script when it meets one. The harness does not yet drag clips inside a use that shows only a window of its composition. Checked with cargo fmt, the full engine suite, the CI subset, just editor-test, just host-test, the SDK tests, and the Electron drag, export and inspector checks. The two Cycles tool scripts that write a film were updated and not run.
Editor feedback from use of the harness. Engine rules stay in the editor core, and the host kit owns pointer and view choices. Outline and picking (RFC 0008). - The editor core describes each layer's outline with an ordered list of rules: the part of its box that its ancestors' masks leave showing, baselines for text, and the contour of a path or a rounded rectangle. A layer no rule knows keeps its box. - A `hud` request carries the view the host shows the picture in. The engine draws the outline in the pixels of that view, with line widths in points, so a line is as wide and as sharp at every zoom. Without a view the tile is in picture pixels. The session keeps no view. - A pointer command reports the size of a screen pixel. A slender layer is picked from three screen pixels away and the edge of a large shape stays exact. A point without that size is exact. - The outline of a layer follows the in-point of its placement. - A click beside the picture lets go of the selection. Preview. - The kit zooms and pans the preview: fit, true size at one screen pixel for each picture pixel, zoom about the pointer, and a pan that stops at the pane's edge. The harness adds a zoom menu, Shift+1 and Shift+Z to fit and Shift+0 for true size. - A marquee starts anywhere in the pane. The host draws it. Timeline. - Any overlay or sound track is switched off with `track <name> off` in the index. The switch is saved and the export follows it. V1 and CAM have none. - Each sound clip shows its own waveform. The mix row is removed, and the host protocol is 5. - A marquee over the lanes selects the clips it touches. `select` takes a list of targets. - An edit this viewer made is not pointed out as a change from outside. - Space plays and pauses from any focus except a text field. Open decisions are listed in the editor task list, each with the headless test it needs: pan limits and zoom keys, the cost of an outline tile, the shape of a mask, an SVG and an image, reaching a layer under another, edits on several clips, a V1 switch and a solo, the size the preview renders at, and outside changes under unsaved edits. Checked with cargo fmt, the full engine suite, just host-test, the embedding test and the Electron editor, slide, inspector and export checks. The editor and slide checks now turn off background throttling, since a covered window paused the frames they wait on. The SDK tests passed before the zoom change and were not rerun after it.
…es back The first editing milestone (E1), and the review and decisions it rests on. The editor core decides what a gesture means and what it writes. The host sends the pointer and draws the outline ahead of the answer. Authoring model (RFC 0012, new). - A review of the layer model, the film structure and the source text found thirteen design flaws. Six decisions answer the ones that block property editing: one property type, a transform that is written back exactly, the film kept as a tree, properties of a use, identity, and one source vocabulary with a version. - The work is cut into nine milestones, each ending in something a person can do in the editor. They are in the editor task list. Transform (RFC 0012, decision 1). - A layer is placed by five values: position, pivot, rotation, skew and scale. The matrix is derived from them and is never written or eased. Position places the layer's origin, and the pivot only says what it turns about. - Values are read back from a matrix with the values before the edit as a hint, so turns add up, a flip is told from a half turn and nothing is lost at the edge cases. A script and the same checks in Rust cover it. - The reader and the painter take a skew, a mirrored scale and a position that is not on whole pixels. `scale` is one factor or two. The `scale-x` and `scale-y` attributes are refused, and scripts/convert-transforms.py rewrites a film once. A scale of zero is still refused. Editing a layer in the picture (RFC 0008). - `beginTransform`, `updateTransform`, `finishTransform` and `cancelTransform` hold a layer by a corner, a side, itself or a turn just outside a corner. `transformLayer` applies a change in picture pixels as one edit. `handleAt` and the state's `handle` say what the pointer would hold. - A gesture writes only the values that changed, rounded, and leaves every other byte of the artwork file as written. A layer is found in its XML by the indexes of a layer reference. - Detail files are part of the draft, with undo, save and the conflict check. - The outline tile carries a square on each corner of the box. - A layer whose place is keyed is selected and has no handles yet. Host kit and harness. - A press on a layer selects it and a drag moves it. Corners and sides scale, and a drag from outside a corner turns. Shift constrains, and Escape puts the layer back. Command or Control draws a rectangle from over a layer. - The outline goes with the pointer at once, and the engine's picture and outline replace it as they arrive. - The cursor shows what a press would hold. - An outline asked for a picture that an edit has replaced is answered quietly. The Python SDK writes the new position, scale and skew. Tests: the engine suite, the host kit and sidecar tests, the Python SDK tests, and the Electron transform, editor, slide, inspector and export tests pass. One step of a drag takes 14 ms on Signal Atlas and 25 ms on a generated film of an hour, in an optimized headless build. Short of the plan and recorded under E1: a scale of zero, several layers at once, a handle outside the pane, moving the pivot by hand, and a drag measured in Electron with an optimized sidecar.
The second editing milestone (E2), delete from E5 built ahead of the rest, and a harness that follows Final Cut Pro. The editor core decides what a drop and a delete mean and what they write. The host lists, drags, draws a ghost ahead of the answer and maps its keys. Media in a row (RFC 0012, decision 6). - A row names a movie or a sound as it is on disk, with its extension, and `in` says where it starts in frames: `[128,192) A1 assets/pings.wav in 128`. A path with a space or a `#` is in double quotes. Artwork named with `.xml`, `.json` or `.n4` is refused. - A movie on V1 fills the frame and must have the film's shape. An overlay track takes no media row yet. - The one-line details for a movie and a sound still open, because a sound's level has no other home yet. scripts/convert-media-rows.py rewrites a film. Signal Atlas and Field Unit are converted. Bringing media in (RFC 0008). - `listMedia` lists the compositions, artwork, movies, images and sounds under the opened folder, measured once per file. `importMedia` copies a file into `assets/`, or links it. - `placeMedia` adds rows as one edit and selects what was added. `landMedia` says where a drop would land without changing anything. The kind decides the tracks a thing can go to. On V1 a shot is inserted at the nearest cut and the film after it ripples, or it overwrites: shots under it are trimmed, removed or split, camera cuts included. An overlay or a sound lands on the nearest free track. A movie brings its sound as a second row. - A picture a row cannot place yet becomes the one layer of an artwork file of its own, about the pointer when dropped on the picture, where it is selected with its handles. - A file the edit creates is part of the draft: written by save, gone with undo. Removing (RFC 0008). - `remove` takes the selected clips and layers out as one edit. `close` moves the film up behind a removed shot, and `attached` takes what starts under it. An overlay or a sound goes alone. - A layer is cut out of its artwork with every other byte kept. The one layer of an overlay placed once takes its row, so a dropped picture leaves with its clip, and a file never saved leaves the draft. - The last row of an index, a camera cut and a track are refused. Host kit and harness. - A media browser with posters and skimming, a drag by pointer, ghosts on the timeline and the picture, and a drop from the Finder. - Delete and Backspace remove the selection. The editing model says what they do to a shot: magnetic closes up and takes connected clips, tracks leaves a gap, and Shift or Option gives the other. Backspace no longer leaves a scope. - The window follows Final Cut Pro: clip colours by kind, a resizable browser and timeline, and an eye or a speaker for a track's switch. Tests: headless media and removal tests compare each edit byte for byte with a film written by hand; Electron tests drive real pointer and key input for the media pane and for delete. Milestones are reordered so media comes second, and what falls short of each is recorded in the tooling backlog.
…dule A first slice of E3. The format of a film is expected to change more than once, so the milestone is built on the format as it is, with the part that outlasts a format built in full and everything else kept narrow. The layers - A model that says what a film is made of apart from any file: kinds of layer, five value types, a table of nine properties, what a file states of each (written, default, keyed or held), addresses and edits. - A format module that alone knows how artwork is spelled. It reads a file as the model sees it, applies edits to the text and leaves every other byte, and writes a new file. - The gestures of E1, the removal of a layer and the file a drop creates now go through that module and write the bytes they wrote before. - A check reads the engine's source and fails when the editor spells a property or an element, or when anything else parses artwork. Reading and setting a value - `properties` lists what each selected layer has. `setProperty` sets one value by name as one history entry, and with `continues` joins a run, so a dragged number is one undo step. A run that returns to the value it began with restores the text and leaves no step. - A wrong value is refused with a code and a reason, and the revision stays. The host kit and the harness - An inspector at the right of the viewer, after Final Cut Pro, with a heading for each group the engine names. It draws one field for each value type and knows no kind of layer. A number is typed or dragged sideways, a colour picked or typed, a copy edited and a blend chosen. Tests - The editor's tests ask through its requests and open films kept as files, so a change of format leaves them and a converter reaches the films. The tests that compare bytes sit beside the format module, with one that holds the new reader and the painter's to the same values on every example. - An Electron test types a colour, a position, a copy and a blend, drags a rotation, and compares the saved artwork with the original. The milestone plan now records first slices from E3 on, what waits for the format change, and the order of the slices as an open decision.
…nd the timeline A first slice of E4, on the tracks a file has today. The model gains a key, an easing, the named easings and an edit that names every key of a property. The painter draws by the model's curve, so the number an inspector shows is the one drawn. The format module reads an <animate> track as keys of the property it moves and writes an edit to keys as the difference: a value or an easing changed in place, a key put in beside its neighbours, a key taken out. A position's keys are translate-x and translate-y, counted from the position the layer states, and only the format knows it. The editor maps a frame of the film to a layer's own clock, so a host names a key by a frame of the film. New requests: setKeyed, moveKey, removeKey and setEasing. setProperty and the handles of E1 set a key where a value is keyed, so a layer with a keyed position or rotation now has handles. In the kit, a value that can be keyed has a key button and, between two keys, a list of easings. The inspector shows the value at the playhead and follows it while the film plays. The timeline draws a row of key marks under the selected layer's clip: a mark is pressed, dragged with the pointer and deleted. Also in this commit, from the session that works on the look: the window follows the system between light and dark, and a sound's wave is drawn in decibels on its clip's bottom edge. The plan records what remains as six steps, and reshapes E8: the editor writes each edit as it is made and the last writer of a value wins. Tests: eight headless key tests on films under tests/films, format tests that compare bytes, kit tests for the key logic and the dragged mark, and an Electron test that keys a move with real input.
A first slice of E8. A person's edits and an agent's edits to the files are both the way to work on a film, so the session keeps no draft to be saved and stops at no conflict. This is how a session opens. A session that keeps a draft until Save is behind --manual-save on the CLI and the sidecar. An edit is written when it is finished: a typed value at once, and a gesture or a dragged number when it is let go. endRun ends a run of setProperty so it can be written. A change from outside is read in whenever it arrives. An edit to a value that is in the hand is made again on the new text, so it changes the bytes it names and leaves what came from outside. A dragged number goes on from there as one step. A handle gesture ends with its move kept. The last writer of a value wins, by the order of arrival. History entries for values and keys hold the edits that take them back and make them again, beside the film as it was. After a change from outside an undo makes the earlier value on the text as it is now. A value cleared to its default is an edit, so an undo leaves a file as it found it. Entries for rows, a removed layer and dropped media are still copies of files, and are dropped when a change from outside is read in. A layer is found again by its kind and name at the same place, until it has an id. A selected layer whose own values were changed from outside stays selected. The harness says "Saved" where it had a Save to press. The viewer lets go of a layer when the engine says a gesture is over, and shows a notice when an edit was dropped. Tests: eight headless tests that play the other writer, and an Electron test that rewrites the artwork under a dragged number. The older tests run on the new default: those that asserted a draft now assert the write, and the conflict tests open a session that keeps a draft. The plan records what the slice leaves, and what it asks of the format.
One page beside the plan: how to build and test, how the owner has asked for the work to be done, what is built and at which commit, what the slices ask of the format, the questions and the choices that wait for the owner's word, what each slice leaves undone, what was found along the way and not fixed, and what was not run or measured. It gathers what the milestones record under each slice and adds what was only said in conversation: the notes of the session that worked on the look, two tests that failed once, and the checks that were skipped.
The public examples were two whole films. These five run five to eleven seconds each and show one idea well, for use as a showcase. Kinetic headline, Product demo and Map explainer follow the choreography of private studies of published films, with a new subject, new copy, new pictures and public-domain type. Print through type and Liquid glass are N4 studies moved here with a new headline, a new plate and public-domain type in place of fonts under other licenses. - Kinetic headline: colour passes timed across the named parts of one paragraph, a dot anchored to a numeral, and a wordmark whose letters replace stickers. - Product demo: a masked camera window that becomes an attachment, a typed reply, a chip anchored to its last line, and a notification. - Map explainer: one generated town plan through four cameras, with a travelling focus, multiply highlighters and a grid drawn street by street. - Print through type: CC0 race footage drawn twice, with a live headline opening the photograph onto a halftone shader. - Liquid glass: one keyed number driving a refracting backdrop shader over a generated plate. Every picture is drawn by a generator in its folder or as paths in the sequence files. Type is Aileron and Seshat by Sora Sagano, CC0. Each README names the idea, the edits to try with the frames to compare, and the origin of every file. `just examples-check` validates every example and CI now runs the same loop. The examples index says what a public example is and that the folder is converted with the format. The handoff page records that for the format change.
Separate format contracts, engine, adapters, hosts, and SDKs by ownership. Consolidate contributor documentation and regenerate shared fixture media from adjacent Python recipes.
Merge spikes into main
Remove artwork from the repository README
Import gridaco/n4 main at fc32f6cd1a52db549aa4557db554e40952ba3ab9. Rewrite paths into n4/ and omit the standalone .github workflows, which are integrated separately.
Keep N4 media and symlink validation project-local and resolve documentation against the tracked monorepo. Port contributor and OpenUSD workflows. Omit the standalone release placeholder because it publishes no artifact.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 616 files, which is 516 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 500 files.
|
Only the producer checks out N4. Scope the n4 working directory to that job so the fresh-consumer step can run from its empty workspace after downloading the artifact.
This was referenced Dec 1, 2026
softmarshmallow
marked this pull request as ready for review
December 1, 2026 12:53
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
N4, the active native video editing engine, moves from gridaco/n4 into
n4/as its own project. This is the second repository cutover step after #151 and follows #150.mainatfc32f6c. Replay its 49 commits with paths nested undern4/. Keep the Rust and pnpm workspaces, CLI, SDL and Electron hosts, examples, fixtures, and licensing together. The original repository retains the original commit IDs and local work remains in the standalone checkout.Native
.nothingrendering and editing is follow-up work. Merge using a merge commit so N4's imported ancestry stays reachable frommain.Verification