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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ jobs:
cache: gradle

- name: Generate and validate fresh source report
run: ./gradlew test --tests dev.samhb.interleave.format.SourceProgramLoaderTest --tests dev.samhb.interleave.format.SourceAssertionTest --tests dev.samhb.interleave.cli.MainTest.cutoffSimplificationProducesDirectTrace --tests dev.samhb.interleave.cli.MainTest.sourceSymmetryCliCountsAndReportIdentity --tests dev.samhb.interleave.cli.MainTest.approximateSymmetryCliReportIdentity --tests dev.samhb.interleave.cli.MainTest.approximateCbsCliArtifacts --tests dev.samhb.interleave.cli.MainTest.approximateDporAndAllStrategyArtifacts --tests dev.samhb.interleave.ApproximateDporRunTest.dporRunnerKeepsApproximationAndActualPartialPaths --tests dev.samhb.interleave.ApproximateCbsIterationTest.ownedSymmetrySupportsCbsAndGlobalResourceAllowance --tests dev.samhb.interleave.ApproximateSymmetryRunTest.runnersRetainPrecisionLimitsAndIsolation --tests dev.samhb.interleave.cli.MainTest.shortestCutoffProducesProofArtifacts --tests dev.samhb.interleave.ResourcePrefixJsonTest --tests dev.samhb.interleave.cli.MainTest.declarativeSymmetryCliSupportsExactMatrix --tests dev.samhb.interleave.DeclarativeSymmetryRunTest.exactRunsRemainIsolatedAndEmitResourceFixtures --tests dev.samhb.interleave.report.DeclarativeSymmetryAttestationTest.checkedFailureSnapshotsRetainCommittedPrefix --tests dev.samhb.interleave.cli.MainTest.declarativeSymmetryCliSupportsApproximateMatrix --tests dev.samhb.interleave.ApproximateDeclarativeSymmetryRunTest --no-daemon
run: ./gradlew test --tests dev.samhb.interleave.format.SourceProgramLoaderTest --tests dev.samhb.interleave.format.SourceAssertionTest --tests dev.samhb.interleave.cli.MainTest.cutoffSimplificationProducesDirectTrace --tests dev.samhb.interleave.cli.MainTest.sourceSymmetryCliCountsAndReportIdentity --tests dev.samhb.interleave.cli.MainTest.approximateSymmetryCliReportIdentity --tests dev.samhb.interleave.cli.MainTest.approximateCbsCliArtifacts --tests dev.samhb.interleave.cli.MainTest.approximateDporAndAllStrategyArtifacts --tests dev.samhb.interleave.ApproximateDporRunTest.dporRunnerKeepsApproximationAndActualPartialPaths --tests dev.samhb.interleave.ApproximateCbsIterationTest.ownedSymmetrySupportsCbsAndGlobalResourceAllowance --tests dev.samhb.interleave.ApproximateSymmetryRunTest.runnersRetainPrecisionLimitsAndIsolation --tests dev.samhb.interleave.cli.MainTest.shortestCutoffProducesProofArtifacts --tests dev.samhb.interleave.ResourcePrefixJsonTest --tests dev.samhb.interleave.cli.MainTest.declarativeSymmetryCliSupportsExactMatrix --tests dev.samhb.interleave.DeclarativeSymmetryRunTest.exactRunsRemainIsolatedAndEmitResourceFixtures --tests dev.samhb.interleave.report.DeclarativeSymmetryAttestationTest.checkedFailureSnapshotsRetainCommittedPrefix --tests dev.samhb.interleave.cli.MainTest.declarativeSymmetryCliSupportsApproximateMatrix --tests dev.samhb.interleave.ApproximateDeclarativeSymmetryRunTest --tests dev.samhb.interleave.bytecode.BytecodeReleaseTest.bytecodeViewerUsesFreshProducerArtifacts --no-daemon

- name: Run visualizer test suite
env:
BYTECODE_DIR: build
DECLARATIVE_SYMMETRY_DIR: build
SOURCE_TRACE_JSON: build/source-visualizer.json
SOURCE_ASSERTION_JSON: build/source-assertion-visualizer.json
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ The headline artifact is a states-explored reduction table: naive DFS → +hashi
Concurrency bugs — race conditions, deadlocks, missed signals — are notoriously hard to find because they depend on exact thread ordering. Rather than running a program once and hoping for the right schedule, this checker systematically explores every distinct interleaving and reports the exact `(thread, step)` schedule that reaches a bad state.

The selected [#12 bounded Java bytecode workstream](docs/plans/bytecode-contract.md)
has an **internal loader, interpreter and concurrent exact DFS** (94A/94B; [foundation](docs/measurements/94A-bytecode-foundation.md), [concurrency evidence](docs/measurements/94B-bytecode-concurrency.md)).
94B includes pure checks and measured instruction-reference/batched execution. Public evidence/CLI/library selection follows in 94C; no public bytecode
selection is available yet. Weak-memory work remains unselected.
now exposes the initial **bounded, sequentially consistent bytecode profile**: annotated fixed actors,
exact DFS, monitor deadlocks, declared checks, artifact-bound evidence and strict replay through the
library, CLI, reports and viewer. Start with the [compiled lost-update and two-lock examples](examples/bytecode/README.md).
The [94C release ledger](docs/measurements/94C-bytecode-release.md) records validation and limitations;
[94B](docs/measurements/94B-bytecode-concurrency.md) owns the batching measurements and preservation argument.
Objects/arrays, general exceptions, wider primitives/libraries and additional bytecode search strategies
remain later phases. Weak-memory work remains unselected.

The project is built as a clean, spec-driven proof-of-concept. It is not a production Java bytecode checker; programs are modeled as explicit atomic steps or bounded `.ilv` source over cloneable shared state so the core algorithms can be taught, verified, and measured.
The project is a spec-driven proof of concept for small explicit models, bounded `.ilv` source and a
restricted interpreted Java profile. It does not execute unrestricted Java or claim Java Memory Model coverage.

## What it does

- **Compiled Java models** — explicitly compile annotated fixtures, then select `--bytecode <binary-name> --class-path <directory>`; exact DFS is the initial supported bytecode strategy.
- **Readable source models** — `.ilv` atomic blocks, bounded reusable helpers, branching, repetition and bounded loops share the existing checker and source-aware trace viewer.
- **Exhaustive DFS** — tries every enabled thread at every reachable configuration.
- **State hashing** — collapses identical configurations so the search space becomes a DAG instead of a tree.
Expand Down Expand Up @@ -77,6 +83,8 @@ Available bugs: `peterson`, `broken-peterson`, `broken-peterson-v2`, `deadlock`,
| `--all` | Run entire corpus |
| `--file <path>` | Load program from JSON file |
| `--source <path>` | Load a bounded concurrent `.ilv` source model |
| `--bytecode <binary-name>` | Check a compiled annotated Java model; requires `--class-path`, defaults to DFS/EXACT |
| `--class-path <directory>` | Sole immutable class directory for BYTECODE; no jars or automatic compilation |
| `--symmetry` | Opt-in checked symmetry for source or certified declarative JSON; requires explicit `--store exact` or `--store bitstate` (default `both` is rejected) |

### Examples
Expand Down
8 changes: 5 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ val mutationHarnessJavadoc = tasks.register<Javadoc>("mutationHarnessJavadoc") {
tasks.javadoc { dependsOn(mutationHarnessJavadoc) }

tasks.test {
dependsOn(mutationHarnessJar)
dependsOn(mutationHarnessJar, tasks.jar)
doFirst {
systemProperty("interleave.releaseJar", tasks.jar.get().archiveFile.get().asFile.absolutePath)
systemProperty("interleave.mutationHarnessJar", mutationHarnessJar.get().archiveFile.get().asFile.absolutePath)
systemProperty("interleave.testRuntimeClasspath", sourceSets.test.get().runtimeClasspath.asPath)
}
Expand Down Expand Up @@ -287,7 +288,8 @@ pitest {
// There is no `maxMemoryInMc` on this plugin; per-minion heap is a plain JVM arg,
// which is the more general lever since this is also where -XX flags would go.
jvmArgs.set(listOf("-Xmx${pitestMaxMemoryMc}m",
"-javaagent:${mutationHarnessJar.get().archiveFile.get().asFile.absolutePath}"))
"-javaagent:${mutationHarnessJar.get().archiveFile.get().asFile.absolutePath}",
"-Dinterleave.releaseJar=${tasks.jar.get().archiveFile.get().asFile.absolutePath}"))

// Must exceed the slowest covering test's normal runtime by a clear margin.
//
Expand Down Expand Up @@ -814,7 +816,7 @@ tasks.register("mutationRatchet") {
}

tasks.named("pitest") {
dependsOn(mutationHarnessJar)
dependsOn(mutationHarnessJar, tasks.jar)
inputs.file(mutationHarnessJar.flatMap { it.archiveFile })
finalizedBy(tasks.named("mutationRatchet"))
}
Expand Down
Loading
Loading