<!-- llms-explorer concept facts · https://llms-explorer.com/tree/pinned-layered-wiredtiger-page-delta-denominator-and-full-image-fallback-boundaries/ · pack 2026-11-02 · ~3681 tokens -->

# Pinned layered WiredTiger page-delta denominator and full-image fallback boundaries

> Source-anchored research for Pinned layered WiredTiger page-delta denominator and full-image fallback boundaries. Run status: COMPLETED.

Parent: [WiredTiger checkpoints and dirty-page write cost](https://llms-explorer.com/tree/wiredtiger-checkpoints-and-dirty-page-write-cost/) · 4 facets · 14 facts · page: https://llms-explorer.com/tree/pinned-layered-wiredtiger-page-delta-denominator-and-full-image-fallback-boundaries/

## How it works

- For a built, nonempty candidate, the first size check rejects when the integer quotient `r->delta.size * 100 / delta_base_size` is greater than `conn->page_delta.delta_pct`. If that check passes and the target flag is set, a second check rejects when `r->delta.size * 100 / chunk->image.size` is greater than `(100 + conn->page_delta.delta_pct) / 2`. Both divisions use integer arithmetic, so equality of a computed integer quotient to its bound passes that check; these are not exact real-valued percentage cutoffs. The image-denominator mode does not run the second check. Each size rejection increments `rec_page_delta_rejected_size_threshold` and clears `build_delta`. The extra image-relative check can reject a near-image delta even when the larger target denominator admits it. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/conn/conn_layered.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/wiredtiger.h.in) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/reconcile_private.h) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/connection.h)
- The size checks occur inside a branch requiring `page->disagg_info != NULL`, `last_block`, `r->multi_next == 1`, a `block_meta->page_id` unequal to `WT_BLOCK_INVALID_PAGE_ID`, `WT_REC_RESULT_SINGLE_PAGE` and a false `__rec_proxy_cell_orphaned` result. A delta attempt also requires `delta_enabled`. When delta writing is enabled but the structural branch is unavailable, the diagnostic alternatives identify multiblock results, invalid page IDs or non-single-page results. These alternatives do not exhaust every failed prerequisite. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)
- A proxy-only page for which `__rec_proxy_cell_orphaned` is true must write a full image to provide a replacement parent address. The helper returns false when `mod->instantiated` is true, or when `mod->rec_result` equals `WT_PM_REC_REPLACE` and `mod->mod_replace.block_cookie` is nonnull. Otherwise it calls `__rec_ref_addr_is_deleted`, whose return requires a nonnull on-page address with cell type `WT_CELL_ADDR_DEL`. The final selection block excludes an orphaned proxy from both delta creation and its unchanged-page skip path. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)
- `__rec_build_delta` initializes `*build_deltap` to false. For a leaf it requires `WT_BUILD_DELTA_LEAF`. It rejects when `total_keys` is positive and the integer removed-key percentage exceeds `conn->page_delta.delete_pct`; otherwise it builds the leaf delta. The source computes `total_keys` as the header entry count plus removed keys with `WT_PAGE_EMPTY_V_ALL`, and as half the entry count plus removed keys otherwise. Its comment says the mixed-value case underestimates key count, so this is an approximate deletion threshold. For an internal page, the builder accepts an already-built delta only when `r->delta.size > 0`. A successful return without selecting a delta reaches the caller’s build-failed counter and full-image write choice. These checks precede the denominator-based size checks. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)
- The internal row-store loop stops building its delta when `build_delta` is true and any of these conditions holds: `r->multi_next > 0`, a child has `WT_REF_FLAG_REC_MULTIPLE`, or the first key is dirty (`r->cell_zero && prev_dirty`). `__rec_stop_build_delta_int` clears both the build flag and `r->delta.size`. This split/key-representation boundary precedes the final multiblock and size checks; target-denominator selection does not bypass it. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_row.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)
- The accepted-delta write path calculates `delta_pct = (r->delta.size * 100) / chunk->image.size`. This statistic remains relative to the built full-image byte size even when eligibility uses the larger target denominator; it is a delta-to-image size ratio. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/wiredtiger.h.in) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/reconcile_private.h) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/connection.h)

## Problems, failure modes and limitations

- In `__wti_disagg_conn_config`, the page-delta parsing follows the early exit that jumps to `err` when `reconfig` is true, and occurs inside the `__wt_conn_is_disagg(session)` branch. It reads `page_delta.delta_pct` into `conn->page_delta.delta_pct`, sets `WT_DELTA_PCT_OF_TARGET_PAGE_SIZE` when `page_delta.delta_pct_of_target_page_size` is true, and reads the internal/leaf enable switches, deletion threshold and consecutive-delta limit. This is initialization parsing; this block skips these options during reconfiguration and does not establish runtime toggling of the flag. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/conn/conn_layered.c)
- Within the eligible single-page branch, a leaf with no newer selected updates and no `WT_PAGE_INMEM_SPLIT` sets `skip_write` before any delta attempt. Otherwise an enabled delta can be built only while `block_meta->delta_count` is less than `conn->page_delta.max_consecutive_delta`; equality or a larger count increments `rec_page_delta_rejected_max_consecutive_exceeded`. The declaration defaults that limit to `32` and restricts it to `1` through `32`. A successful builder return without a delta increments `rec_page_delta_rejected_build_failed`. Both `build_delta` and `skip_write` start false. If execution reaches the final write choice, `skip_write` takes precedence and copies the previous address; otherwise a surviving `build_delta` calls `__rec_write_delta`, and the remaining case calls `__rec_write_image`. Failed or rejected candidates therefore select the full-image branch when no skip path was selected. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/dist/api_data.py) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)
- The fixture inserts rows at timestamp `10`, checkpoints, reopens with its selected configuration, modifies the selected rows at timestamp `20`, evicts and checkpoints again. It reads `stat.dsrc.rec_page_delta_leaf` and `stat.dsrc.rec_page_delta_rejected_size_threshold`. It uses the fixed estimates `DELTA_PCT_OF_IMAGE = {20: 33, 40: 66}` and `limit = (100 + self.delta_pct) // 2 if self.use_target else self.delta_pct`. When its estimate is strictly below that limit, it asserts positive delta count and zero size rejections; otherwise it asserts zero deltas and positive size rejections. In target mode this expected matrix accepts the smaller modification at both percentages and the larger modification only at the higher percentage. In image mode it accepts only the smaller modification at the higher percentage. These are fixture-defined counter assertions, using approximate fixed size estimates. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/test/suite/test_layered_delta18.py)

## Comparisons and alternatives

- At the pinned source, the page_delta category contains the undocumented boolean `delta_pct_of_target_page_size`, whose default is `true`. Its declaration selects the configured-maximum-page-size policy instead of the just-built-image policy; the parser maps `page_delta.delta_pct_of_target_page_size` to `WT_DELTA_PCT_OF_TARGET_PAGE_SIZE`. The same declaration gives `delta_pct` a default of `20` and an integer range from `1` to `1000`. Its description permits deltas larger than full pages for measurement and testing; the actual write choice remains subject to the size and eligibility checks below. (high confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/dist/api_data.py) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/conn/conn_layered.c)
- In `__rec_split_write`, `delta_base_size` starts at `chunk->image.size`. With `WT_DELTA_PCT_OF_TARGET_PAGE_SIZE` set, it becomes `WT_MAX(delta_base_size, r->page_size)`; without the flag it remains the built-image size. The enabled denominator is therefore the larger of the built image and reconciliation target, and never less than the image. These are byte sizes: `image` and `delta` are `WT_ITEM` buffers, whose `size` is a `size_t` count of bytes, while `page_size` is the integer reconciliation target. `__wti_rec_split_init` assigns `primary_size` to `r->page_size`, with a salvage override. The row-store internal and leaf callers pass `btree->maxintlpage_precomp` and `btree->maxleafpage_precomp`, respectively; the operative target is this field rather than a direct read of a user configuration string. (high confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_row.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/wiredtiger.h.in) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/reconcile_private.h) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/connection.h)
- A built delta with `header->u.entries == 0` is handled before the size comparisons: it increments `rec_page_delta_rejected_zero_entries` and sets `skip_write`. The preceding assertion allows this only for an internal page. The write-choice branch then copies the previous address with `__rec_copy_prev_addr`, sets `WT_MULTI_SKIP_WRITE`, increments `rec_skip_write` and jumps to `copy_image`. Zero entries therefore select reuse of the existing block, rather than the full-image size-rejection path. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c)

## Facts and statements

- The API description says the extra bound reaches the whole image and stops applying at `delta_pct` of `100`. The code has no condition disabling its target-mode comparison at that value. If execution reaches the second check with `conn->page_delta.delta_pct` equal to `100`, substitution in `(100 + conn->page_delta.delta_pct) / 2` gives `100`; an image-relative integer quotient greater than `100` is still rejected, while equality passes that check. This is a direct reading of the expression, retained alongside the attributed API wording. (medium confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/dist/api_data.py) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/rec_write.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/conn/conn_layered.c) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/wiredtiger.h.in) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/reconcile/reconcile_private.h) · [also](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/src/include/connection.h)
- The denominator fixture is decorated with `@disagg_test_class`, uses `gen_disagg_storages(disagg_only=True)`, a `layered:` URI and `block_manager=disagg`, and enables leaf deltas while disabling internal deltas. It defines denominator scenarios using `use_target=False` and `use_target=True`, modifications of `20` or `40` out of `NKEYS = 60`, and `delta_pct` values of `20` or `50`. Its table uses `leaf_page_max=131072`, `allocation_size=4096` and `VALUE_SIZE = 500`; comments describe the page size and delta fractions approximately. (low confidence) — [source](https://raw.githubusercontent.com/mongodb/mongo/e37ae17db503703515d2ec35f6793dee7651655f/src/third_party/wiredtiger/test/suite/test_layered_delta18.py)
