flowrs-engine/crates/flowrs-instruments/PROVENANCE.md
flowRS 2b6f30d348 flowRS engine, cut from flowRS f907e0756a7c
Built alone from an empty CARGO_HOME, its tests passed, and flowrsc checked, ran and exported a
document from the conformance corpus; the export built alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-10 08:54:33 -05:00

40 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# flowrs-instruments: where the ported material came from
flowrs-instruments is Apache-2.0. Most of it is flowRS's own. What came from elsewhere:
## The simulated bench (`src/sim/`), from LabCraft
LabCraft (<https://github.com/corail-labs/labcraft>, "a graphical dataflow programming language
and IDE, built in pure Rust") is MIT OR Apache-2.0 (its `Cargo.toml`, `NOTICE`, `LICENSE-MIT`,
`LICENSE-APACHE`). Read at commit `22b8dff` (2026-11-08). flowRS takes it under the MIT licence;
the notice is in `LICENSES/LabCraft-MIT.txt`, and both of its licence texts sit beside the
copied files in `data/sim/labcraft/`.
| flowRS file | Came from | What was taken | Licence |
|---|---|---|---|
| `data/sim/labcraft/*.toml` | `libs/visa/sim/*.toml` | Copied unchanged: the fifteen simulated benches | MIT |
| `data/sim/labcraft/LICENSE-MIT`, `LICENSE-APACHE` | `LICENSE-MIT`, `LICENSE-APACHE` | Copied unchanged | — |
| `src/sim/noise.rs` | `libs/visa/simulation.md` §3; `SplitMix64` in `tools/lcf-poc/lcfpoc/sim.py` | The noise generator and the sum of twelve uniforms, bit for bit | MIT |
| `src/sim/time.rs` | `simulation.md` §3–4 | The clock in whole nanoseconds, the conversion of a time, the six-decimal answer | MIT |
| `src/sim/file.rs` | `simulation.md` §1–3, §5, §7; `check_keys`, `number`, `text`, `table`, `array`, `error_entry`, `command_key`, `Quantity.__init__`, `Instrument.__init__`, `World.load`, `World.check_sources` in `sim.py` | The file's keys, their types and ranges, and the refusals `visa:S001`…`visa:S011` with their meaning | MIT |
| `src/sim/instrument.rs` | `simulation.md` §3–4; `Quantity.own_value`, `true_value`, `read`, `set`, `Instrument.push_error`, `execute`, `command_text` in `sim.py` | A quantity's true value and its ramp, a write that starts a move, the order a command is answered in, the error queue and its overflow | MIT |
| `src/sim/mod.rs` | `simulation.md` §4, §6, §9; `World.open`, `wait`, `advance` in `sim.py`; `_send`, `_receive` in `tools/lcf-poc/lcfpoc/stdlib.py` | Sessions, `-410` for an unread answer, the read that waits for its timeout, VISA's error codes, `describe` | MIT |
| `src/sim/tests.rs` | `class Simulation` in `tools/lcf-poc/tests/test_poc.py` | The cases of its tests (the refusal table, the answers of §4, the clock, the ramp), rewritten for this code; the expected values are LabCraft's own published ones and those of `tools/benchsim/oracle.py`, an independent reckoning written from the spec | MIT |
| `spec/flowrs-bench-sim-1.md` §1–10 | `simulation.md` §1–10 | The contract, adapted: LabCraft's text where flowRS behaves as LabCraft does | MIT |
What flowRS added (spec §11): SCPI matching, a catalogue `model` and `follows`, `scale`,
`offset`, `clamp`, `min`/`max`, ranges and overload, switches and `routes`, waveforms and
statistics, `faults.delay` and `faults.hang_ms`, `queue_depth`, `reset`, the strict LabCraft
reading, and every `sim:` code. None of it is in LabCraft.
## pyvisa-sim's file format (`src/sim/pyvisa.rs`)
pyvisa-sim (<https://github.com/pyvisa/pyvisa-sim>) is MIT. The reader follows its YAML format
(spec 1.0 and 1.1: devices, dialogues, properties with getters, setters and specs, error
queues, status registers, resources) and its documented matching order. No code of it is
copied; it is not linked, and flowRS's own `tools/scpi-sim/bench.yaml` is the file the tests
read. The canonical SCPI form is the one `tools/scpi-sim/bridge.py` (flowRS's) applies.
## The catalogue (`data/*.json`)
Facts from PyMeasure and python-ivi (both MIT): see `NOTICE`.