Search and replace in 0.1.2

Search and replace with a regular expression no longer take time quadratic in the number of matches on one line. The bounds of the line of a match are derived from the match instead of being searched again from the start of the line.

Case Before After
20,000 matches on a line of 60,000 bytes (version 0.1.2) 2.5 s about 0.1 s
20,000 matches, replacement with a regular expression with groups (version 0.1.2, debug build) 2.5 s 0.09 s
40,000 matches, same replacement (version 0.1.2, debug build) 9.5 s 0.18 s

Journal cost in 0.1.1

Operations on many small files, for example a replace over thousands of files and its undo, write cheaper journal entries:

  • such an operation is several times faster, and its entry is proportional to the changed content;
  • in a preserve call with at least 64 targets, the previous content of files up to 4096 bytes is kept in the manifest, and the new files and directories are flushed with one call before the commit, not one flush per file;
  • manifests of operations with at least 256 targets use format version 2, and the entry of an undo of thousands of files is about seven times smaller.

The undo of one million removed files takes 5.3 times the duration of the removal (version 0.1.1). The full-scale undo test undo_mass_full_scale_within_six_times_the_operation in crates/nurt-journal/src/undo.rs allows up to six times the duration of the operation. The scenario T12 of tools/release/scenarios.sh runs replace and undo over 3,000 files and requires each to end within 60 seconds.

Limits of a run

Two settings bound the output of a program. Both are documented in spec/configuration.md.

Key Default Effect
run.spool_max 1gib the largest output kept per program: its first part and, up to a quarter of the limit (at most 64 MiB), its last part; the bytes between are omitted, marked in the spool file and reported with the note spool_limit; the counters and the hash cover all output
output.max_bytes 4096 bytes of text of one output stream shown in a response; 0 is no limit

run.spool_max keeps the disk free from a program that writes without end; unlimited keeps everything and can be set at any level, including one run. With max_bytes the response of run is short by default: after exit code 0 the last 5 lines and a digest are returned, and after a failure the diagnostics of cargo, rustc and pytest are extracted with file and line.

Limits enforced by tests

Tests carry time and cost limits that the product has to keep.

Test Limit Defined in
small journaled write median at most 1 ms on in-memory volumes, 201 samples; ten times that in builds without optimisation tests/d2/perf/main.rs
undo of a bulk operation of 1,000 files at most three times the duration of the operation tests/d2/perf/main.rs
removal of a tree counted as one rename, by counting file system operations, which does not depend on the machine tests/d2/perf/main.rs
recovery of a journal of one million entries budget of 5 seconds in a release build tests/d2/crash/journal_scale.rs
recovery among one million empty entry directories less than 5 seconds crates/nurt-journal/tests/perf.rs
search against rg on a 1 GiB corpus; walk of 10^6 entries against fd at most 1.3 times the time of the other program crates/nurt-files/tests/perf_search.rs, perf_walk.rs
commands that search the programs of the system, synthetic system of 2,000 executables 5 ms to 1 s depending on the case, release builds; 25 times that in debug builds crates/nurt-programs/tests/perf.rs

The test binaries named perf run alone, with all threads of the machine reserved, through .config/nextest.toml.

Scale tests

The test remove_tree_1e6_is_undone_and_redone removes a tree of one million files, then undoes and redoes the removal. The scale tests (11 tests) ended with exit code 0, and the removal of 1,000,000 files took 24 minutes (version 0.1.1, Linux, 27 November 2026).

The benchmark of tasks

nurt-bench (the directory bench/ and the crate crates/nurt-bench) asks whether Danaco Nurt, used as the tool of an AI agent, completes more tasks with less harm and at lower cost than bash and PowerShell 7. The same agent loop runs the same tasks with several models, and only the tool differs.

  • The task set holds 720 tasks in 12 domains, 60 per domain: search, multi-edit, single edit, structured formats, code, programs, background jobs, system, archives, Git, administration, and tasks that provoke known failures of shells. 648 tasks are public and 72 are held out, listed by identifier and hash.
  • The conditions are bash, pwsh, nurt and nurt-groups. The measures are completion, harm, lost entries, encoding changes, tokens, steps and wall clock time. The analysis pairs each Danaco Nurt run with the shell run of the same task: an exact two-sided McNemar test for completion and a two-sided Wilcoxon signed-rank test for costs.
  • The entry rule of the protocol supports further work on a Nurt condition when the completion and cost criteria hold pooled over the models and for four of six models, and no run is harmed.
  • The model configurations in bench/protocol/models are six: alibaba-qwen, anthropic, deepseek, google, meta-llama and openai. The mock model --model mock:<file> runs without network access.

The workflow bench-oracles.yml validates the tasks, runs the unit tests of the oracle on Linux, Windows and macOS, and runs the reference solutions in bash on Linux and in PowerShell on Windows. 648 tasks were validated and 112 oracle tests passed (version 0.1.1, 27 November 2026).

The documentation of the journal describes the entries whose cost this page measures, and the testing page lists how the scale tests are run.