Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: make check-rfds
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31
with:
install_url: https://releases.nixos.org/nix/nix-2.35.1/install
Expand All @@ -41,7 +40,6 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: make check-rfds
- uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31
with:
install_url: https://releases.nixos.org/nix/nix-2.35.1/install
Expand All @@ -62,7 +60,7 @@ jobs:
- run: nix develop --command ./scripts/time-model-gate-test.sh
- run: nix develop --command ./scripts/rfd3-phase0-spike-test.sh
- run: nix develop --command ./scripts/rfd3-phase1-evidence.sh
- name: RFD 3 phase 2 guest runtime
- name: RFD 20 phase 2 guest runtime
# The runtime changes root, drops credentials, and creates device nodes,
# and its guest-wide cleanup barrier needs a private PID namespace, so
# the test binary is built unprivileged and then run as PID 1 under sudo.
Expand All @@ -77,7 +75,7 @@ jobs:
nix develop --command sudo --preserve-env=PATH,SIMFERRET_BUSYBOX \
env SIMFERRET_PHASE2_TEST_BINARY="$binary" \
./scripts/rfd3-phase2-runtime.sh
- name: RFD 3 phase 4 guest-visible conformance
- name: RFD 20 phase 4 guest-visible conformance
# The conformance check changes root, drops credentials, and creates
# device nodes, and its guest-wide cleanup barrier needs a private PID
# namespace, so the test binary is built unprivileged and then run as
Expand Down
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@

# RFDs

- Follow the lifecycle and source conventions in `rfd/README.adoc`.
- Keep design documents in `rfd/NNNN/README.adoc` and implementation progress in the adjacent `IMPLEMENTATION.adoc` file.
- RFDs are published at https://chaba-rfds.pages.dev. Their source lives in the shared chaba-dev/rfds repository (https://github.com/chaba-dev/rfds), which is private to the organization; follow its lifecycle and source conventions there, not in this repository.
6 changes: 0 additions & 6 deletions Makefile

This file was deleted.

27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SimFerret is an experimental deterministic simulation platform for finding and
reproducing failures in unmodified software.

The project is currently in design and proof-of-concept development. See the
[Requests for Discussion](rfd/README.adoc) for architecture decisions and
[Requests for Discussion](https://chaba-rfds.pages.dev) for architecture decisions and
implementation plans.

## Architecture
Expand All @@ -24,7 +24,7 @@ Rust owns scenario choices, VM lifecycle, artifacts, event normalization, and
assertions. QEMU owns deterministic machine execution and its replay log. All
guest-affecting host input crosses a recorded boundary; uncontrolled network,
host filesystems, entropy, and wall clocks are outside the initial replay
contract. [RFD 1](rfd/0001/README.adoc) records the architecture and
contract. [RFD 18](https://chaba-rfds.pages.dev/rfd/0018/) records the architecture and
defines the bounded echo/restart proof of concept.

## QEMU replay spike
Expand Down Expand Up @@ -112,7 +112,7 @@ under `.poc/phase4-acceptance/`. CI runs the same command on Ubuntu.

## Network replay spike

The RFD 2 Phase 0 spike adds an explicit RTL8139 NIC with its option ROM
The RFD 19 Phase 0 spike adds an explicit RTL8139 NIC with its option ROM
disabled, restricted QEMU user networking, and a mandatory replay filter. It
fetches content across the NIC, proves a peer-specific administrative outage,
restores connectivity, passively replays the run twice after removing fixture
Expand All @@ -131,7 +131,7 @@ durations, identities, digests, serial output, and QEMU diagnostics under
`.poc/qemu-network-replay-smoke/`. Set `SIMFERRET_NETWORK_REQUESTS` from 1
through 1000 for bounded traffic-scaling experiments.

## RFD 2 network scenario
## RFD 19 network scenario

The proof-of-concept scenario, choice-plan, and guest protocols remain at
version 1. The seeded choice plan records
Expand All @@ -151,9 +151,9 @@ choice plan before launch, uses an empty adapter-owned TFTP directory for
passive replay, and verifies normalized events, assertion bytes, and the
semantic outcome digest on every replay.

## RFD 3 workload packaging spike
## RFD 20 workload packaging spike

The RFD 3 Phase 0 spike packages an external executable instead of the built-in
The RFD 20 Phase 0 spike packages an external executable instead of the built-in
fixture. It compiles one static and one dynamically linked workload, builds
local OCI image layouts that carry them, applies representative base and upper
layers twice into one stable canonical filesystem digest, normalizes every
Expand Down Expand Up @@ -184,9 +184,9 @@ The suite also runs the guest supervisor's cleanup path as PID 1 of a private PI
namespace, which needs unprivileged user namespaces or passwordless `sudo`; the
test reports which one it used and fails if neither is available.

## RFD 3 workload specification and canonical assembler
## RFD 20 workload specification and canonical assembler

The RFD 3 Phase 1 assembler replaces the Phase 0 prototype with a typed,
The RFD 20 Phase 1 assembler replaces the Phase 0 prototype with a typed,
versioned workload specification and a bounded canonical normalizer. A workload
is one of two tagged source forms:

Expand Down Expand Up @@ -260,7 +260,7 @@ Phase 1 acceptance tests:
.agents/dev cargo test --locked --workspace --all-targets --all-features
```

## RFD 3 guest process runtime
## RFD 20 guest process runtime

The PID-1 agent supervises one packaged workload at a time. The immutable
template is assembled below `/workload`, outside the agent, its tools, and the
Expand Down Expand Up @@ -308,9 +308,9 @@ sudo env "PATH=$PATH" SIMFERRET_BUSYBOX="$SIMFERRET_BUSYBOX" \

Selecting the workload in `simferret run`, recording its identity in the run
manifest, driving the live protocol from the scenario checker, and the recorded
passive replay are implemented by the RFD 3 Phase 3 integration below.
passive replay are implemented by the RFD 20 Phase 3 integration below.

## RFD 3 workload scenario and passive replay
## RFD 20 workload scenario and passive replay

`simferret run` accepts an optional `--workload SPECIFICATION`. When it is
present the scenario is parsed as the versioned workload-driven acceptance
Expand Down Expand Up @@ -344,9 +344,9 @@ after deleting the live source:
./scripts/rfd3-phase3-acceptance.sh
```

## RFD 3 acceptance and evidence
## RFD 20 acceptance and evidence

The complete RFD 3 demonstration runs unprivileged on x86-64 Linux:
The complete RFD 20 demonstration runs unprivileged on x86-64 Linux:

```shell
.agents/dev ./scripts/rfd3-phase4-acceptance.sh
Expand Down Expand Up @@ -402,7 +402,6 @@ Jujutsu. To enter the environment directly, run
Run repository commands through the development environment:

```shell
make check-rfds
nix --extra-experimental-features 'nix-command flakes' flake check
.agents/dev cargo fmt --all -- --check
.agents/dev cargo clippy --locked --workspace --all-targets --all-features -- --deny warnings
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/src/checker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! RFD 3 Phase 3: the host-side workload scenario checker.
//! RFD 20 Phase 3: the host-side workload scenario checker.
//!
//! The guest runtime reports process and byte facts only. This module owns the
//! application meaning of the recorded output frames: it reconstructs each
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/src/runtime.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! RFD 3 Phase 2: the guest process runtime.
//! RFD 20 Phase 2: the guest process runtime.
//!
//! The agent stays PID 1 outside an immutable workload template. For every
//! invocation it materializes a fresh writable root from that template, applies
Expand Down
6 changes: 3 additions & 3 deletions crates/simferret/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const MEMORY_MIB: u32 = 128;
/// The QEMU time model that record and replay both launch. `shift=auto` lets
/// QEMU adjust the virtual CPU speed against host real time.
///
/// RFD 4 pins `shift=4,sleep=off`: a fixed scale, so the guest's virtual time
/// RFD 21 pins `shift=4,sleep=off`: a fixed scale, so the guest's virtual time
/// advances with the instructions it executes and its idle timers advance
/// deterministically rather than with host scheduling, and no idle sleep, so the
/// guest's clock is not paced by the host either.
Expand All @@ -37,7 +37,7 @@ const MEMORY_MIB: u32 = 128;
/// so a recording can be driven. It is carried until upstream includes the fix,
/// and dropping it is a versioned change: recordings made under a different
/// emulator are not comparable, and every host in the supported matrix must be
/// re-validated. `rfd/0004/EVIDENCE.adoc` records the measurement, the pin, and
/// re-validated. RFD 21's evidence (https://github.com/chaba-dev/simferret/blob/83ebd1fadc50cf391a8e8002939a69870335ec7e/rfd/0004/EVIDENCE.adoc) records the measurement, the pin, and
/// the spike that established the patch.
///
/// Changing this value is a versioned change for the same reason: the model is
Expand Down Expand Up @@ -1872,7 +1872,7 @@ mod tests {

#[test]
fn record_and_replay_launch_the_configured_time_model() {
// The literal is the model the product launches. It is pinned by RFD 4
// The literal is the model the product launches. It is pinned by RFD 21
// and reaches QEMU through the pinned emulator, which carries the
// replay-flush patch `sleep=off` needs; changing either the value or the
// emulator is a versioned change that also updates this assertion and
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/src/workload/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! RFD 3 Phase 1: typed workload specification and canonical assembler.
//! RFD 20 Phase 1: typed workload specification and canonical assembler.
//!
//! One standalone static binary or one local `linux/amd64` OCI image layout is
//! normalized into one content-addressed guest workload: a canonical filesystem
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/tests/rfd3_phase1.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! RFD 3 Phase 1 acceptance: the typed workload specification and canonical
//! RFD 20 Phase 1 acceptance: the typed workload specification and canonical
//! assembler.
//!
//! The suite builds standalone binary and local OCI image-layout sources,
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/tests/rfd3_phase2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// only there. The checked-in script runs it as PID 1 in a fresh PID namespace.
#![cfg(target_os = "linux")]

//! RFD 3 Phase 2 acceptance: the guest process runtime.
//! RFD 20 Phase 2 acceptance: the guest process runtime.
//!
//! The runtime changes the child root, drops to nonzero credentials, and
//! creates the overlay device nodes, so these tests require root. They skip
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/tests/rfd3_phase3.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! RFD 3 Phase 3 acceptance: the workload-driven scenario and the host checker.
//! RFD 20 Phase 3 acceptance: the workload-driven scenario and the host checker.
//!
//! The complete record and passive-replay pipeline is exercised end to end in
//! `run.rs`'s unit tests against a deterministic fake VM, and the checked-in
Expand Down
2 changes: 1 addition & 1 deletion crates/simferret/tests/rfd3_phase4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// exactly as the guest owns its process table.
#![cfg(target_os = "linux")]

//! RFD 3 Phase 4 acceptance: guest-visible conformance and input exclusion.
//! RFD 20 Phase 4 acceptance: guest-visible conformance and input exclusion.
//!
//! Phase 1 proves the canonical view on the host and Phase 3 proves the packaged
//! workload records and replays in the real guest. This suite closes the
Expand Down
16 changes: 8 additions & 8 deletions docs/time-model.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ measurements. Current progress lives in the implementation checklist, not here.
| Artifact | Path | What it records

| RFD
| link:../rfd/0004/README.adoc[RFD 4: Deterministic guest time model]
| link:https://chaba-rfds.pages.dev/rfd/0021/[RFD 21: Deterministic guest time model]
| The proposal, the determinism, compatibility, and controllability needs it separates, what it excludes, and its acceptance criteria

| Implementation checklist
| link:../rfd/0004/IMPLEMENTATION.adoc[RFD 0004 implementation checklist]
| link:https://github.com/chaba-dev/simferret/blob/83ebd1fadc50cf391a8e8002939a69870335ec7e/rfd/0004/IMPLEMENTATION.adoc[RFD 21 implementation checklist]
| Phase 0 (pin and validate the model), Phase 1 (identity, rejection, and migration), Phase 2 (contract and documentation), and the exit criteria

| Pre-RFD measurement
| link:../poc/time-model/EVIDENCE.adoc[Guest time-model measurements]
| The exploratory probe results under `shift=auto`, `shift=auto,sleep=off`, `shift=7`, `shift=7,sleep=off`, and `shift=4,sleep=off`, with their caveats and the exploratory `shift=10` observation

| Implementation evidence
| link:../rfd/0004/EVIDENCE.adoc[RFD 4 evidence]
| link:https://github.com/chaba-dev/simferret/blob/83ebd1fadc50cf391a8e8002939a69870335ec7e/rfd/0004/EVIDENCE.adoc[RFD 21 evidence]
| The pinned-scale selection and its reason, the Phase 0 validation on the reference host, the record-mode limitation that the pinned emulator's carried patch resolves, and the re-validation trigger

| Validation gate
Expand Down Expand Up @@ -110,19 +110,19 @@ reports variation instead of failing on it:
arrival timing of live host input has no deterministic position in guest virtual
time; both are separate work.is carried by the pinned emulator and adopted by the product. The measurement, the models it
was compared against, and the source-level cause are in
link:../rfd/0004/EVIDENCE.adoc[RFD 4 evidence], and
link:https://github.com/chaba-dev/simferret/blob/83ebd1fadc50cf391a8e8002939a69870335ec7e/rfd/0004/EVIDENCE.adoc[RFD 21 evidence], and
`scripts/time-model-input-probe.sh` reproduces them. Continuous integration
asserts that known result, so a QEMU change that fixes it fails the job
instead of going unnoticed.
* The limitation is one early return in QEMU, and the spike recorded in
link:../rfd/0004/EVIDENCE.adoc[RFD 4 evidence] shows that moving the flush
link:https://github.com/chaba-dev/simferret/blob/83ebd1fadc50cf391a8e8002939a69870335ec7e/rfd/0004/EVIDENCE.adoc[RFD 21 evidence] shows that moving the flush
ahead of it makes the pinned model record and replay: the product's record and
two replays then match, with the same normalized events, assertions, and
semantic outcome digest as the model in use. Adopting that patch is a project
decision, not an open technical question.

== Related increments

* link:../rfd/0001/README.adoc[RFD 1: Deterministic execution proof of concept] established bounded record and replay.
* link:../rfd/0002/README.adoc[RFD 2: Deterministic network fault model] added the deterministic network boundary.
* link:../rfd/0003/README.adoc[RFD 3: Reproducible workload packaging] packages the workload that exercises the model.
* link:https://chaba-rfds.pages.dev/rfd/0018/[RFD 18: Deterministic execution proof of concept] established bounded record and replay.
* link:https://chaba-rfds.pages.dev/rfd/0019/[RFD 19: Deterministic network fault model] added the deterministic network boundary.
* link:https://chaba-rfds.pages.dev/rfd/0020/[RFD 20: Reproducible workload packaging] packages the workload that exercises the model.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# The pinned emulator, built from the repository's patch rather than from
# a second expression: `sleep=off` needs the replay flush the patch
# restores, and only the system target the project runs is built.
# `rfd/0004/README.adoc` records why it is carried and what dropping it
# RFD 21 (https://chaba-rfds.pages.dev/rfd/0021/) records why it is carried and what dropping it
# means.
qemuPinned = (pkgs.qemu.override {
hostCpuTargets = [ "x86_64-softmmu" ];
Expand Down
2 changes: 1 addition & 1 deletion poc/rfd3-phase0/build-layout.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Build the representative local OCI image layouts used by the RFD 3 Phase 0
"""Build the representative local OCI image layouts used by the RFD 20 Phase 0
spike.

This is throwaway spike code and is deliberately independent of the prototype
Expand Down
2 changes: 1 addition & 1 deletion poc/rfd3-phase0/oci_prototype.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""RFD 3 Phase 0 spike prototype for OCI normalization and canonical identity.
"""RFD 20 Phase 0 spike prototype for OCI normalization and canonical identity.

This is throwaway spike code. The Phase 1 Rust assembler replaces it. The
prototype exists to answer the Phase 0 questions about layer semantics, digest
Expand Down
2 changes: 1 addition & 1 deletion poc/rfd3-phase0/supervisor-test-workload.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Test-only workload for the RFD 3 Phase 0 supervisor cleanup regression.
* Test-only workload for the RFD 20 Phase 0 supervisor cleanup regression.
*
* The supervisor regression test execs this program as the primary guest
* workload. It reads its mode from /mode inside the workload root and leaves a
Expand Down
2 changes: 1 addition & 1 deletion poc/rfd3-phase0/supervisor.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* RFD 3 Phase 0 spike guest supervisor.
* RFD 20 Phase 0 spike guest supervisor.
*
* Boots one external workload inside a private chroot, feeds it a fixed command
* sequence, drains its output while it runs, then kills and reaps every
Expand Down
4 changes: 2 additions & 2 deletions poc/time-model/EVIDENCE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The remaining measurements, with the value each configuration produced:
|===

`shift=10` is a separate observation from an earlier exploratory run, not from
this probe: it used the RFD 3 workload fixture rather than `poc/time-model`, and
this probe: it used the RFD 20 workload fixture rather than `poc/time-model`, and
default `sleep` behavior. No guest output appeared within a 180-second deadline
and the replay log reached 117 MB. Those raw artifacts were not retained. It
therefore establishes only that no guest output was observed before the
Expand Down Expand Up @@ -205,7 +205,7 @@ and comparisons against runs 3 to 5 found 1,030 to 1,036 differing bytes.
Equal size across five runs is therefore not evidence of equal content, and the
raw replay log is not a suitable identity for comparing independent recordings.
The payloads of the differing regions were not decoded, so their meaning is
undetermined. This is consistent with RFD 2's evidence, which already records
undetermined. This is consistent with RFD 19's evidence, which already records
that replay-log size and wall-clock duration vary across recordings and hosts
and that they are measurements rather than replay identity.

Expand Down
Loading
Loading