Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/app.zig
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ pub fn construct(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
// A document state as the bytes that differ from another: how a track's checkpoints
// stay small. std-only (see state_delta.zig); `Tracks` keeps its checkpoints with it.
.{ "fizzy-state-delta-tests", "app/state_delta.zig" },
// Image diff: RGBA8 rows and tiles to the rects that differ. std-only (see
// Image diff (RGBA8 to rects) and text diff (histogram lines, unified output). std-only (see
// core/diff.zig); `bench-diff` measures it.
.{ "fizzy-diff-tests", "core/diff.zig" },
// When a document's transport shows and for how long, how far a held undo goes, which
Expand Down Expand Up @@ -1507,7 +1507,7 @@ pub fn construct(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
bench_step.dependOn(&run_bench.step);
}

// `zig build bench-diff` — core.diff on a 4K image and a 2048x2048 sprite of 50 layers (prints
// `zig build bench-diff` — core.diff on a 4K image, a 2048x2048 sprite of 50 layers and 1 MB of text (prints
// timings). Same rules as `bench-tape`; std-only, so it needs no window.
{
const bench_module = b.createModule(.{
Expand All @@ -1522,7 +1522,7 @@ pub fn construct(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
}));
const bench_diff = b.addTest(.{ .name = "fizzy-bench-diff", .root_module = bench_module });

const bench_step = b.step("bench-diff", "Benchmark core.diff: a 4K image, a 50-layer sprite (prints timings)");
const bench_step = b.step("bench-diff", "Benchmark core.diff: a 4K image, a 50-layer sprite, 1 MB of text (prints timings)");
const run_bench = b.addRunArtifact(bench_diff);
run_bench.has_side_effects = true;
bench_step.dependOn(&run_bench.step);
Expand Down
2 changes: 1 addition & 1 deletion core/core.zig
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub const lsp = @import("lsp/lsp.zig");
/// lower scores are better.
pub const fuzzy = @import("fuzzy.zig");

/// Std-only diffing (images so far): which regions of a document's state differ. See `diff.zig`.
/// Std-only diffing (images and text): which regions of a document's state differ. See `diff.zig`.
pub const diff = @import("diff.zig");

/// The project's file set: one cached, searchable view of what is on disk, owned by the host and
Expand Down
7 changes: 7 additions & 0 deletions core/diff.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
pub const Image = @import("diff/Image.zig");
/// A keepable per-tile hash of an image, 8 bytes per tile, to diff a past state against.
pub const TileGrid = @import("diff/TileGrid.zig");
/// A line diff of two texts: histogram with a Myers fallback, over a reusable scratch.
pub const Text = @import("diff/Text.zig");
/// A text diff's hunks as a standard unified diff, with a size cap.
pub const unified = @import("diff/unified.zig");

test {
_ = Image;
_ = TileGrid;
_ = Text;
_ = unified;
_ = @import("diff/tests.zig");
}
Loading
Loading