atomicops

package
v0.0.0-...-2e4c5eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package atomicops is a DST driver that differentials FoundationDB's ten atomic mutation types (Add / And / Or / Xor / Max / Min / ByteMax / ByteMin / AppendIfFits / CompareAndClear) end-to-end through the SimFDB backend against an INDEPENDENT Go reference model.

Why it earns its keep on top of the existing hunt coverage:

  • The interleave driver exercises atomic-ADD only; the other nine ops — and every width / endianness / missing-key edge — are otherwise unprobed by any hunt.
  • SimFDB's applyAtomic is already differential-tested against the pure-Go client's applyAtomic (both are ports of C++ Atomic.h). This driver adds a genuinely THIRD, independent reference: the numeric ops (Add/Max/Min) run through a math/big little-endian path instead of a byte carry-loop, so a bug common to BOTH byte-loop ports still surfaces here.
  • It drives the ops END-TO-END through the backend — the commit path, the clear→delete wiring for CompareAndClear, and RYW folding inside an open transaction — none of which the pure-function differential touches.

Two absolute oracles (the independent model is the reference; zero violations == agreement):

STATE  after each committed transaction a fresh read of the whole keyspace equals the model
       — this is where key PRESENCE is checked (absent vs present-empty).
RYW    a read of a key inside the open transaction, after its pending atomic ops, equals the
       model's in-transaction projection (SimFDB folds RYW via resolveKey).

The load-bearing distinction the model tracks and the STATE oracle probes is ABSENT (no key) vs PRESENT-EMPTY (key present with a zero-length value): AndV2 / MinV2 / ByteMin / CompareAndClear all branch on it. A store that dropped a present-empty value on commit or on read would flip an atomic op onto its absent branch — exactly the divergence this driver is built to catch.

This is RFC-199 Tier 2. It plugs into the shared hunt machinery via hunt.Workload.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Profiles

func Profiles() []hunt.Profile

Profiles is the atomic-op sweep matrix: a balanced surface, a hot 2-key arena that stacks many ops per key per transaction, and an edge profile that hammers the nil-vs-empty branches.

Types

type Result

type Result struct {
	Report *hunt.Report
	Txns   int
	OpsRun int
	Counts map[opcode]int // op -> times executed
}

Result is the rich outcome: the standard hunt.Report plus per-op counts so a test can assert every one of the ten atomic ops actually fired (the NO-FAKE-CHECKBOX proof that the driver exercises the whole surface, not just add).

type Workload

type Workload struct {
	Keys      int  // distinct keys (default 6)
	Txns      int  // transactions per run (default 12)
	OpsPerTxn int  // ops per transaction (default 8)
	RYWChecks bool // also assert in-transaction RYW reads (default true)

	// EdgeBias skews param widths to {0,1} and Set to empty values, hammering the absent-vs-
	// present-empty branches (AndV2 / MinV2 / ByteMin / CompareAndClear) far harder than the
	// balanced profile does.
	EdgeBias bool
}

Workload is a seeded atomic-op differential over SimFDB. It ignores the record-oriented hunt.Config; its knobs live on the struct.

func (Workload) Name

func (Workload) Name() string

Name implements hunt.Workload.

func (Workload) Run

func (w Workload) Run(seed uint64, _ hunt.Config) *hunt.Report

Run implements hunt.Workload; the record-oriented Config is ignored.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL