# FasterLog: visible records and the commit boundary

A record can be safe to read before it is recoverable. There is also an API
boundary trap: the address returned by Enqueue is the record's beginning.
Waiting until that address is committed can return before the record itself
has been committed.

## Observed result

This native API experiment uses Microsoft.FASTER.Core **2.6.5**, not a model.
In each independent directory, a writer commits "baseline", appends "candidate",
captures its state, then is killed with SIGKILL. A different process reopens
the same files. Each condition is repeated three times.

| Condition before killing writer | Safe tail | Committed boundary | Candidate visible | Candidate recovered |
| --- | ---: | ---: | --- | --- |
| Published, no second commit | 92 | 76 | Yes, 3/3 | No, 0/3 |
| Second CommitAsync completed | 92 | 92 | Yes, 3/3 | Yes, 3/3 |

The candidate occupies logical interval [76,92). Before the second commit,
WaitForCommitAsync(76) completes; WaitForCommitAsync(92) remains pending and is
then explicitly cancelled. A successful wait at the start of a record is not
evidence that the record was committed. Use a captured post-enqueue tail or the
enqueue-and-wait helper with an independent commit producer. Waiting does not
itself start a commit.

These offsets include library framing, not just payload bytes. The two payloads
are UTF-8 "baseline" and "candidate". The log uses 4096-byte pages, 65536-byte
memory, 1048576-byte segments, MutableFraction=1, automatic safe-tail refresh,
and no automatic or fast commit. Reads check the exact payload sequence, not
only a record count. The reader is bounded by the observed committed frontier;
uncommitted reads use the safe-tail frontier.

## Reproduce

Requirements: Linux, .NET SDK 10, Node 22 or newer, and NuGet access. The original
run used .NET runtime 10.0.12. Package and transitive versions/content hashes are
pinned in packages.lock.json. Run in a fresh directory, outside a site's public
folder, so compiler output cannot become published assets.

Download these files together:
[Program.cs](Program.cs), [Probe.csproj](Probe.csproj),
[packages.lock.json](packages.lock.json), [probe.mjs](probe.mjs),
[probe.test.mjs](probe.test.mjs), [results.json](results.json), [README.md](README.md).

```sh
dotnet restore Probe.csproj --locked-mode
dotnet build Probe.csproj -c Release --no-restore -o build
node probe.mjs build/Probe.dll replay.json
node --test probe.test.mjs
node probe.mjs --check
```

The fresh capture is replay.json. The final command checks the retained receipt
and its source hashes; it is not a fresh execution. The harness deletes only
its own temporary log directories and kills only its own writer child. Timing
limits detect hangs; they are not performance measurements.

## Interpretation and limits

This is a six-case deterministic mechanism check, not a durability probability,
concurrency benchmark or replication of a paper's performance result. SIGKILL
bypasses writer disposal, but the kernel, storage service and power remain
running. It cannot establish power-loss safety, device flush correctness,
multi-writer behavior, named-iterator transactions or fault-tolerant storage.
Only one short record follows the baseline, so page rollover and background
memory-pressure effects are outside the tested conditions.

The failure-free commit behavior is distinct from the explicit option to
tolerate device failures. No such option is enabled here. An application must
also coordinate external effects: a committed log position alone does not
make an unrelated remote action atomic.

## Evidence and context

- [Pinned implementation, v2.6.5](https://github.com/microsoft/FASTER/blob/e25782f602fca13b9d6dd812dfdc7facab52f0bd/cs/src/core/FasterLog/FasterLog.cs):
  WaitForCommitAsync compares a frontier; enqueue-and-wait requires coverage
  beyond the entry's start.
- [Pinned settings](https://github.com/microsoft/FASTER/blob/e25782f602fca13b9d6dd812dfdc7facab52f0bd/cs/src/core/FasterLog/FasterLogSettings.cs):
  safe-tail refresh and automatic commit are independent settings.
- [FasterLog Basics](https://microsoft.github.io/FASTER/docs/fasterlog-basics/):
  conceptual API guide. Its RefreshUncommitted examples predate this package.
- [Netherite, PVLDB 2022](https://www.microsoft.com/en-us/research/wp-content/uploads/2022/07/p1591-burckhardt.pdf),
  sections 5.2-5.3, DOI 10.14778/3529337.3529344: distinct commit-log and
  key-value-state roles; inter-partition outbox sends wait for persistence.
- [Machine-readable observations](results.json) include runtime, assembly
  informational version, assembly SHA-256, source hashes and every trial.
- [Canonical definition](https://hesela.dev/terms/fasterlog/) and
  [WAL/checkpoint context](https://hesela.com/analyses/wal-checkpoints-torn-pages/).

Original probe code and observations: Hesela, 2026-12-02. Upstream FASTER is
MIT-licensed; no upstream source or binary is redistributed in this directory.
