Skip to content

Pyrite only: drop the Renode/C# backend; the sim binary is the simulator - #55

Draft
ShahriarAhnaf wants to merge 1 commit into
mainfrom
agent/pyrite-only-5b8e
Draft

ShahriarAhnaf wants to merge 1 commit into
mainfrom
agent/pyrite-only-5b8e

Conversation

@ShahriarAhnaf

@ShahriarAhnaf ShahriarAhnaf commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #56

The model: the sim binary is the simulator and the source of truth. pippy installs it, runs it, and turns its output into Python objects and pytest results. Anything the binary does (several machines, Python scripted peers via parts:, media, bridges, --record, traces) works from Python because Python just calls the binary.

Removed (breaking, 0.5.0)

  • Renode/C# backend: _RenodeBackend, the pythonnet/coreclr loader, the Simantic.Core install, the pythonnet dependency.
  • backend= on Sim/run_firmware, --sim-backend, the sim_backend fixture, BACKENDS, engine_dir, ServerNotConfigured, Sim(show_logs=).
  • run_firmware(server=, use_cached=): retired C# CLI flags with no pyrite equivalent.
  • run_scenario(trace_symbols=, trace_memory=, trace_interrupts=, engine_dir=) and ScenarioRun.symbol_trace/memory_trace: replaced by args=.

Changed

  • run_firmware runs sim <MCU> run --elf … --timeout ….
  • run_scenario writes the scenario, runs sim run --scenario … --record DIR --frames F [args…] and builds ScenarioRun from uart.jsonl/isr.jsonl/log.jsonl. New: args= (any sim run flag), ScenarioRun.frames, .stdout (trace lines), .stderr (peer output); a non-zero exit raises SimError. No more NotSupported for parts:, multi-machine or network services.
  • pytest test.yaml items go through run_scenario.
  • No wall-clock kill around sim. It was timeout*4+30, which killed a legitimate 10 s run on a loaded host. --timeout ends runs in virtual time; the plugin still judges a manifest's wall: budget.
  • Sim stays on the in-process pyrite engine: single machine, stepping/debugging. Its NotSupported messages point at run_scenario.
  • README, docs/session-api.md, docs/writing-tests.md rewritten binary-first.

Checked

  • SIMANTIC_SIM=<sim 0.8.5> uv run pytest -q: 175 passed, 12 skipped.
  • run_scenario on an STM32H753 scenario with two Python UART peers and a CAN peer, 10 s, args=["--trace-symbol","SysTick_Handler"]: 306 UART records, 9836 SysTick hits (identical to running the binary directly), peers' output in stderr.
  • sim-fixtures manifests via the plugin (run from sim-fixtures): stm32f407 can-loopback, can-counterpart, can-2node, nucleo-f401re mips-profile: 4 passed. stm32f407 uart-counterpart fails identically under plain sim run --scenario (fixture/engine, not pippy).

Known

  • ScenarioRun.uart_records[*]["bytes"] is rebuilt from recorded text (latin-1), not byte-exact for non-UTF-8 output.
  • test_run_scenario_with_a_scripted_peer_goes_through_the_binary runs only with SIMANTIC_PARTS_MANIFEST set (no parts: manifest on sim-fixtures main).
  • docs/writing-tests.md still describes the examples-repo sample as Sim-based in places; that sample needs porting in simantic-dev/examples.

🤖 Generated with Claude Code

The C# engine is halted and its release product retired, yet Sim,
run_firmware and the pytest plugin still defaulted to backend="renode"
(pythonnet + Simantic.Core), which can no longer be fetched. The Rust
batch path was a second runner beside the binary that rejected `parts:`
and multi-machine scenarios.

- Remove the renode backend, the pythonnet/.NET loader, the Simantic.Core
  install, the pythonnet dependency, --sim-backend and backend=.
- run_firmware runs `sim <MCU> run --elf ...`; run_scenario and test.yaml
  items run `sim run --scenario ... --record DIR` and read the bundle, so
  peers, several machines and media work because the binary does them.
  `args=` passes any other sim flag; ScenarioRun keeps stdout (traces)
  and stderr (peer output).
- No wall-clock kill around sim: --timeout ends a run in virtual time; the
  plugin still judges a manifest's own `wall:` budget.
- Sim stays on the in-process pyrite engine (single machine, stepping).
- README/docs: the binary is the simulator; Python orchestrates. 0.5.0.

Checked: `SIMANTIC_SIM=<sim 0.8.5> uv run pytest -q` 175 passed, 12
skipped. run_scenario on a customer two-peer STM32H753 scenario (2 Python
peers + CAN peer, 10 s, args=["--trace-symbol","SysTick_Handler"]): 306
UART records, 9836 SysTick hits (same as the binary), 20 [gw] RX lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyrite only: drop the Renode/C# backend; the sim binary is the simulator, Python orchestrates

1 participant