Skip to content
MedialocoPublic

About

Rediscover QNAP2: evidence-linked guides and a Rust/WebAssembly queueing-network playground.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

QRUNAP2

crates.io

A documented QNAP2 subset for queueing network simulation.

An independent Rust reconstruction of a small, evidence-linked subset of the historical QNAP2 queueing-network language. English first, with a French learning guide and interface.

What works

Five editable examples: M/M/1, constant durations, two servers, overload, and a reconstruction of an INRIA 1995 closed-network example. The same Rust interpreter runs natively and as WebAssembly. No simulation backend, third-party JavaScript CDN or visitor account is needed. Unsupported language features produce errors.

This is v0.1, an educational subset, not full QNAP2 9.3 compatibility. Historical programs are not generally drop-in compatible. No historical RNG equivalence or confidence intervals are claimed. The complete 9.3 manual remains to be recovered.

Run locally

Install the command-line tool

cargo install qrunap2 --version 0.1.1 --locked
qrunap2 --version
qrunap2 check model.qnp
qrunap2 run model.qnp 42

model.qnp is a local model file. Download a complete M/M/1 example or use the examples in this repository. run writes a JSON report; the seed defaults to 42 if omitted.

Use the Rust library

cargo add qrunap2
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let source = std::fs::read_to_string("model.qnp")?;
    let report = qrunap2::run(&source, 42)?;
    println!("Simulated {} events", report.events);
    Ok(())
}

The library exposes parse, simulate and run, together with model and report types. See the API documentation.

Build from source

cargo test --locked
cargo run -- check examples/original/first-queue.qnp
cargo run -- run examples/original/first-queue.qnp 42
rustup target add wasm32-unknown-unknown
python3 scripts/build.py
python3 -m http.server 8000 --directory dist

Open http://localhost:8000. Use HTTP rather than opening index.html directly: the worker and WASM are fetched as local web assets. Requires Rust/Cargo, Python 3 and Node.js for the WASM smoke test. Rust dependencies are pinned by Cargo.lock; the web interface has no package dependencies.

node scripts/test-wasm.mjs

GitHub Actions builds, tests and deploys to Pages on pushes to main. Repository Settings → Pages must use GitHub Actions as the build source.

Layout

src/syntax.rs parses and validates the supported language; src/engine.rs runs events and statistics; src/lib.rs exposes the shared native/WASM core; web/ contains the bilingual interface; docs/ contains sources and explanations. The build generates documentation HTML from Markdown and copies the examples.

Provenance and licensing

QRUNAP2 is an independent implementation, not an official INRIA, Bull or Simulog release. Historical documents remain with their respective rights holders. The historical example is labelled as an adaptation. The original QRUNAP2 code is available under the MIT License; this does not relicense historical source material.

License

QRUNAP2 code, original examples, documentation and verification scripts are available under the MIT License. Historical documents and third-party software retain their respective rights and licences; citing them does not relicense them.

Reproducible verification package: analytical checks, eight exact SimPy comparisons, and 192 stochastic trajectories per engine.

About

Rediscover QNAP2: evidence-linked guides and a Rust/WebAssembly queueing-network playground.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages