# dm-loki: sequence notation versus executable input

## Finding

A fault sequence is part of the experimental method, not just a label.
At dm-loki revision `b16bc9272d007f8e79fa1017e5e6a4a397ba5f60`,
the userspace parser accepts uppercase `A X W F` and repeats its final symbol.
The paper's lowercase `wwxxw` is descriptive notation, not a string accepted
by this parser. This is a reproducibility distinction, not evidence that the
paper's filesystem results are wrong.

## Observed parser traces

Each row below is ten calls to the unchanged parser.

| Input | Returned symbols | Interpretation of mapper allow/fail branches |
| --- | --- | --- |
| WWFFW | WWFFWWWWWW | Allow twice, fail twice, then allow |
| WFW | WFWWWWWWWW | One selected failure followed by an allow tail |
| WFX | WFXXXXXXXX | Allow once, then keep failing |
| F | FFFFFFFFFF | Final F repeats despite the ONE constant name |
| W | WWWWWWWWWW | Final W repeats |
| AWX | AWXXXXXXXX | A does not stop cursor advancement |
| XWA | XWAAAAAAAA | X does not stop cursor advancement |

The interpretations are a reading of `loki_map`, not an executed kernel test.
The sequence cursor belongs to a fault-range item, and the mapper reads it
before the partial-bio branches. Do not relabel parser positions as application
write calls, fsync calls, unique blocks or successful media writes.

## Method and denominator

On 2026-12-06, Hesela compiled the unmodified `twobitseq.c` in its explicit
`TBS_TEST_MODE_ON` mode. The upstream userspace unit test passed.
The differential check enumerated all 5460 nonempty strings over AXWF of
lengths 1 through 6. Eleven additional sequences of lengths
7, 8, 15, 16, 17, 31, 32, 33, 64, 65 and 129 crossed two-bit packing boundaries.
Every sequence was read for its length plus five positions: 58,720 checked
symbol reads in total, excluding the seven ten-read examples above.
Seven invalid nonempty inputs returned -EINVAL; an empty input returned -EIO.

This is a finite exhaustive test over the stated short-string domain, not a
proof for arbitrary length, allocation failure or concurrency. There is no
statistical sampling and no inferred failure rate or confidence interval.

[Machine-readable results](results.json) record the compiler, Python version,
architecture, source hashes and actual generation time.
[Replay harness](replay.py) contains the enumeration and explicit checks.

## Reproduce safely

Obtain the [pinned upstream source](https://github.com/WiscADSL/dm-loki/tree/b16bc9272d007f8e79fa1017e5e6a4a397ba5f60)
into an ordinary directory. Review it before execution. Use Python 3 and GCC:

```sh
python3 -B replay.py /path/to/pinned/dm-loki --output results-local.json
```

The harness verifies three SHA-256 hashes, compiles temporary userspace binaries,
runs the supplied unit test and calls the parser through ctypes.
It never invokes the upstream Makefile, sudo, dmsetup, module loading or a
block-device utility. Temporary binaries are removed on exit. Expected error
messages from rejection cases are not test failures.
Do not use the repository-wide `make test` for this replay: it loads a kernel
module and manipulates storage mappings.

## Source review and limits

Rebello, Patel, Alagappan, A. C. Arpaci-Dusseau and R. H. Arpaci-Dusseau,
*Can Applications Recover from fsync Failures?*, ACM Transactions on Storage
17(2), article 12, June 2021, 30 pages,
[DOI 10.1145/3450338](https://doi.org/10.1145/3450338).
[Author-hosted paper](https://research.cs.wisc.edu/adsl/Publications/cuttlefs-tos21.pdf),
sections 3.2 and 4.1: selected block accesses and logging support a different
experiment from mocking a syscall return value. The filesystem experiments
use Linux 5.2.11. CuttleFS is a separate FUSE-based application test tool.

The artifact review covers `twobitseq.h`, `twobitseq.c`,
`twobitseq_test.c`, `dm-loki-handle-messages.c`, `dm-loki-main.c`,
`dm-loki-fault-list.c`, the build recipe and license.
The repository carries GPL version 3. Upstream source and binaries are not
redistributed in this package. The exact journal experiment revision is not
established by this replay.

No mounted filesystem, Linux module, request splitting, parallel I/O,
storage failure, application recovery or power-loss behavior was tested.
The trace-to-filesystem interpretation supplied by blockviz was not reproduced.
Read the [dm-loki record](https://hesela.dev/terms/dm-loki/) and
[CuttleFS record](https://hesela.dev/terms/cuttlefs/) for the distinct boundaries.
