diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 18:06:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 19:01:23 -0300 |
| commit | e63b0624f57472d40af32a006c32cc47d403b822 (patch) | |
| tree | b7295da62acd96bc7aba425720eed95605526693 /anim/src/cursor.zig | |
| parent | 318e16181a28725e218121363555580725d6d0d4 (diff) | |
| download | computeranim-e63b0624f57472d40af32a006c32cc47d403b822.tar.gz computeranim-e63b0624f57472d40af32a006c32cc47d403b822.zip | |
canim: what the review found; the band as two panels; list and sort by instruction
The first videos were reviewed frame by frame and the catalogue changed
with them. A lens is a drawing over the program column and its view over
the state column, so the stack keeps six slots, its window on the whole
frame. Operands are whole. list and sort are recorded by instruction
from main (record --from), so their registers strike, links reach nodes
and cells, rows that ran are marked and jumps are drawn. A call's node is
a projection of its return address; pins travel and keep their side; a
mark covers the bytes that changed, at the element's width; a syscall's
result is stored after the kernel returns it and every panel is of one
moment; fast passes are veiled; the clock stands still during a step;
captions get their reading time and a scene's first step comes by four
seconds.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/cursor.zig')
| -rw-r--r-- | anim/src/cursor.zig | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/anim/src/cursor.zig b/anim/src/cursor.zig index 2f7be1a..6e3a5b7 100644 --- a/anim/src/cursor.zig +++ b/anim/src/cursor.zig @@ -109,6 +109,8 @@ pub const Cursor = struct { /// cannot be read at that pace is veiled. hurried: anim.Value, veil: anim.Value, + /// The veil over what a sprint also cannot show: the source and the band's view. + sprint_veil: anim.Value, /// Steps taken. count: anim.Value, /// The levels the scene shows: set before the first step. @@ -130,6 +132,7 @@ pub const Cursor = struct { .marks = .{ s.value(here), s.value(here) }, .hurried = s.value(0), .veil = s.value(0), + .sprint_veil = s.value(0), .count = s.value(0), .first = start, .last = start, @@ -202,8 +205,13 @@ pub const Cursor = struct { pub fn reading(c: Cursor, from: u64, to: u64) Plan { const rec = c.rec; const regs: f32 = @floatFromInt(@popCount(rec.registersChanged(from, to) & ~quiet)); - const wrote: f32 = @floatFromInt(rec.written(from, to).len); - const touched = wrote > 0 or rec.read(from, to).len > 0; + // Memory gives up its slot when nothing it touched is drawn. + var wrote_n: usize = 0; + for (rec.written(from, to)) |span| wrote_n += @intFromBool(rec.drawn(span, from, to)); + var read_n: usize = 0; + for (rec.read(from, to)) |span| read_n += @intFromBool(rec.drawn(span, from, to)); + const wrote: f32 = @floatFromInt(wrote_n); + const touched = wrote_n > 0 or read_n > 0; const deeper = rec.depths[to] > rec.depths[from]; const back = rec.depths[to] < rec.depths[from]; const levels = [3]bool{ @@ -221,8 +229,8 @@ pub const Cursor = struct { // A drawing made of the bytes reacts when the projection from // them arrives: its bracket and its line after their strike, and // for a write its own arm. - const projected = level == 2 and is and levels[1] and c.levels.idea == .data; - if (projected) slot += time.project.bracket + time.project.draw + @as(f32, if (wrote > 0) time.strike.arm else 0) else if (is) slot += time.cascade; + const projected = level == 2 and is and levels[1] and (c.levels.idea == .data or deeper); + if (projected) slot += time.project.bracket + @as(f32, if (c.levels.idea == .data) time.project.draw else time.project.far) + @as(f32, if (wrote > 0 and c.levels.idea == .data) time.strike.arm else 0) else if (is) slot += time.cascade; strikes.* = @max(slot, time.cascade); } // The writes of one step strike 6 f apart: the last is later. @@ -288,9 +296,10 @@ pub const Cursor = struct { const n: f32 = @floatFromInt(c.steps(by, here, until)); if (n == 0) return; // Anticipation: the veil and the counter come with the first shortened step. - const veiled = options.veil orelse (options.pace < time.run); + // What changes faster than it can be read is veiled at a run too. + const veiled = options.veil orelse true; const start = s.cursor; - s.play(.{ c.hurried.to(1), c.veil.to(if (veiled) 1 else 0) }, .{ .seconds = time.veil, .ease = anim.ease.linear }); + s.play(.{ c.hurried.to(1), c.veil.to(if (veiled) 1 else 0), c.sprint_veil.to(if (options.pace < time.run) 1 else 0) }, .{ .seconds = time.veil, .ease = anim.ease.linear }); s.cursor = start; var k: f32 = 0; while (here < until) : (k += 1) { @@ -306,7 +315,7 @@ pub const Cursor = struct { here = next; } if (!options.settle) return; - s.play(.{ c.hurried.to(0), c.veil.to(0) }, .{ .seconds = time.veil, .ease = anim.ease.linear }); + s.play(.{ c.hurried.to(0), c.veil.to(0), c.sprint_veil.to(0) }, .{ .seconds = time.veil, .ease = anim.ease.linear }); s.wait(time.beat); } @@ -337,6 +346,7 @@ pub const Cursor = struct { .marks = .{ whole(rec, placed.value(c.marks[0])), whole(rec, placed.value(c.marks[1])) }, .hurried = placed.value(c.hurried), .veil = placed.value(c.veil), + .sprint_veil = placed.value(c.sprint_veil), .count = @intFromFloat(@max(placed.value(c.count), 0)), .of = c.of, .place = 0, @@ -385,6 +395,7 @@ pub const Now = struct { /// 0 to 1: steps are hurried; what cannot be read is veiled. hurried: f32, veil: f32, + sprint_veil: f32 = 0, /// Steps taken, of how many in the scene (0: not told). count: u32, of: u32, |
