borgbackup/docs
Thomas Waldmann f2b96e3d15
fastcdc: add FastCDC chunker with a keyed Gear hash
Add a new "fastcdc" content-defined chunker selectable via --chunker-params.
It uses the FastCDC Gear rolling hash (fp = (fp << 1) + Gear[byte]), which is
window-less and cheaper per byte than buzhash's cyclic-polynomial update, so it
chunks noticeably faster (see "borg benchmark cpu" output), while producing
the same chunk-size distribution and deduplication.

The Gear table is keyed: it is derived from the repo id key via CSPRNG (own
"fastcdc" domain), exactly like the buzhash64 table, so chunk cut points stay
unpredictable without the key (anti-fingerprinting). It implements the same
FastCDC techniques as buzhash64 (sub-minimum skipping, normalized chunking with
a required nc_level, min/max clamping); the mask uses the high bits of the hash
(Gear accumulates entropy there).

chunker-params: "fastcdc,chunk_min,chunk_max,chunk_mask,nc_level" - there is no
window field, because Gear is window-less. e.g. fastcdc,19,23,21,2

Also: borg benchmark cpu now measures the fastcdc chunker; tests in
borg.testsuite.chunkers (golden vector, size distribution, keyed gear table,
param parsing, slow fuzz); docs and changelog.

Benchmarks (scripts/chunker_bench.py, buzhash64 vs fastcdc, both nc_level=2,
incompressible data unless noted):

  5 GiB, 2 MiB target (default params):
    buzhash64: CV 0.294, 1011 MB/s
    fastcdc:   CV 0.295, 1313 MB/s   (+30%)

  64 MiB, 64 KiB target:
    buzhash64: CV 0.374, shift-resilience 0.9928,  963 MB/s
    fastcdc:   CV 0.359, shift-resilience 0.9929, 1331 MB/s   (+38%)

  Re-backup of a 2.5 GiB file after scattered single-byte edits (dedup ratio,
  0.5 = v2 fully deduplicated, lower is better):
     64 edits:  buzhash64 0.5237, fastcdc 0.5236
    320 edits:  buzhash64 0.6133, fastcdc 0.6161

  borg benchmark cpu, 1 GB: fastcdc 3.80s, buzhash 4.36s, buzhash64 8.13s,
  fixed 0.56s.

Chunk-size distribution, deduplication and shift-resilience match buzhash64
within noise; fastcdc is consistently faster.

Also: fix bug when computing the mask, one needs to use 1ULL instead of
1, so the shifting computation is done in a uint64, not in a 32bit int.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 23:24:25 +02:00
..
3rd_party fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
_static revert logo colour to #00dd00 (per @TW) 2017-08-16 17:50:59 +02:00
_templates docs: offer a PDF download and link offline formats in the sidebar, fixes #9731 2026-06-09 02:08:14 +02:00
binaries CI: use macOS 15 for binary builds 2025-12-15 17:40:51 +01:00
borg_theme/css docs: offer a PDF download and link offline formats in the sidebar, fixes #9731 2026-06-09 02:08:14 +02:00
deployment remove ssh:// and socket:// remote repository for current repos 2026-06-08 08:04:59 +02:00
internals fastcdc: add FastCDC chunker with a keyed Gear hash 2026-07-01 23:24:25 +02:00
man build usage / man 2026-06-16 14:17:43 +02:00
misc Renames --since to --from 2026-06-20 18:36:59 +02:00
usage buzhash64: add FastCDC-style normalized chunking 2026-06-28 12:00:09 +02:00
authors.rst fix levels in authors section 2016-11-04 21:14:59 -04:00
book.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
changes.rst fastcdc: add FastCDC chunker with a keyed Gear hash 2026-07-01 23:24:25 +02:00
changes_0.x.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
changes_1.x.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
conf.py docs: drop redundant sphinxcontrib.jquery setup_extension call 2026-06-30 21:46:33 +02:00
deployment.rst add non-root deployment strategy 2024-02-24 21:17:01 +01:00
development.rst misc docs updates 2026-06-16 15:21:57 +02:00
faq.rst remove xxhash / xxh64 requirement, mentions 2026-06-10 00:38:18 +02:00
global.rst.inc fastcdc: add FastCDC chunker with a keyed Gear hash 2026-07-01 23:24:25 +02:00
index.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
installation.rst remove python 3.10 support (master branch), fixes #9707 2026-06-06 15:34:05 +02:00
internals.rst misc docs updates 2026-06-16 15:21:57 +02:00
introduction.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
Makefile fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
man_intro.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
quickstart.rst improve docs / comments 2026-06-09 00:49:50 +02:00
quickstart_example.rst.inc key: unify keyfile/repokey classes, locate key independent of type byte (#9743) 2026-06-12 23:48:45 +02:00
support.rst docs: reflow some really long lines 2020-03-11 16:27:57 -07:00
usage.rst repo-compress: remove this command for now 2026-05-22 13:00:13 +02:00
usage_general.rst.inc [DOCS] #4587 – Make Sphinx warnings break docs build 2020-03-16 19:22:59 +01:00