Manhattan Reasoning Gym
Python SDK and CLI (mrg) for hardware design: iterate locally with fast
synthesis / place-and-route feedback, run untrusted agents in a sandbox, and
program real cloud FPGAs — all from one package.
| Surface | What it does | Needs |
|---|---|---|
mrg.build |
local synth / place-and-route reports (no board) | Docker |
mrg.Sandbox |
run an agent in a locked container that promotes to silicon | Docker |
mrg.cloud |
program + drive a real ECP5 over the cloud | API key (Docker to build locally) |
Cloud FPGA access requires an allowlisted API key (
mrg login). Local synth/PnR and sandboxing need only Docker — no toolchain to install.mrg runalso builds the bitstream on your machine with Docker; without Docker it stops and says how to fix that, and builds in the cloud only when asked (--cloud).
Install
pip install manhattan-reasoning-gym
For local synth/PnR and sandboxing, pull the pinned toolchain image once (the SDK runs it for you — you never install yosys/nextpnr/LiteX):
docker pull ghcr.io/manhattanreasoning/mrg-sandbox@sha256:63d944155353a114e736cc6f73c03c4a6bdce96e38a29a24d24398729aa51fcd
Each SDK release pins the image by digest: the same one the cloud build runs
(mrg-sandbox commit 78f83a81342f), so a local build can't drift from the
cloud's toolchain when the image's latest tag moves. $MRG_LOCAL_BUILD_IMAGE
(mrg run --local) and $MRG_SANDBOX_IMAGE (mrg synth/pnr) choose another
image (see Environment variables).
The image is about 1.7 GB compressed. If it isn't pulled yet, the first local build pulls it and shows which image and how big while it downloads. When the image is already here, nothing is printed. Give Docker at least 4 GB of memory (Docker Desktop: Settings > Resources); with less, local builds print a warning.
If your system Python is broken or externally managed, the robust path is
uv venv && uv pip install manhattan-reasoning-gym.
Agent quickstart (headless)
Copy-paste path for coding agents and CI — no browser, no prompts:
export MRG_API_KEY=... # or: mrg login --github-token <no-scope PAT>
mrg synth examples/design.py # JSON report on stdout, ~seconds
mrg pnr examples/design.py # JSON report (fmax_mhz, timing_met), ~tens of seconds
mrg run examples/app.py # programs a real FPGA, ~2-3 min first time
# (builds locally in Docker; --cloud to build in the cloud)
mrg reset # free the board when done (async, ~1 min)
- All bus addresses are byte addresses: word n in your design's register
map is byte address
4*nforapp.read/app.writeandmrg read/mrg write. - After
mrg runthe board stays reserved to you — reuse it withmrg run --no-program/mrg read/mrg write, and release it withmrg resetwhen done. Reset is an async queued job that reflashes the base SoC (~1 min); pollmrg status --jsonrather than expecting instantidle. mrg synth/mrg pnrprint machine-readable JSON on stdout and exit non-zero when the build fails;mrg status --json,mrg jobs --json, andmrg job --jsonemit the raw orchestrator response — parse JSON, don't scrape tables. A build in flight has no board yet (see below), somrg jobsis the only way to find itsjob_idwithout already having it.- Rough time budget:
synthseconds ·pnrtens of seconds ·mrg run~2-3 min for the first program ·--no-programseconds ·reset~1 min. mrg loginwith no flags is an interactive GitHub device flow. Headless, prefer$MRG_API_KEY, ormrg login --github-token <PAT>(also reads$GITHUB_TOKEN) with a no-scope PAT — it's only used to read your username. If you must run the device flow from a non-tty context, relay the printed URL + code to a human.
Local feedback — mrg.build
import manhattan_reasoning_gym as mrg
rep = mrg.build.synth("examples/design.py") # fast: resource utilization
rep = mrg.build.pnr("examples/design.py") # full SoC: real Fmax + timing
print(rep.fmax_mhz, rep.timing_met, rep.util.dsp.used)
CLI: mrg synth design.py · mrg pnr design.py [--sys-clk-mhz N] [--timing-target-mhz N]
(--sys-clk-mhz re-clocks the SoC; --timing-target-mhz is the constraint PnR
optimizes against and timing_met is graded on, defaulting to the sys clock;
--target-mhz stays as a legacy alias for both).
synth is the cheap "is it getting bigger?" signal (core-only util); pnr
places & routes the full SoC for the truthful system-clock Fmax and timing.
Both run on your machine's native Docker platform by default, which can give a
different Fmax from the cloud's linux/amd64 build; --platform linux/amd64
matches the cloud (see Build platform).
Target FPGA
Every board, and every pnr and mrg run --local build, targets one part:
Lattice ECP5-5G LFE5UM5G-85F-8BG381, i.e. device LFE5UM5G-85F,
speed grade 8, package CABGA381 (the LFE5UM5G-85F-EVN board). pnr
reports carry it as part, the mrg run --local build summary prints it, and
mrg.build.FPGA_PART holds it.
To reproduce timing with your own nextpnr, pass the same device flags:
nextpnr-ecp5 --um5g-85k --package CABGA381 --speed 8 ...
nextpnr-ecp5 defaults to speed grade 6, which reports a much lower Fmax for
the same design (about 35% lower in one comparison), so leaving --speed 8
out understates what the boards achieve.
Sandboxed agents — mrg.Sandbox
Run untrusted agent code in a locked container (--network none, no key) that
iterates locally and promotes vetted candidates to silicon:
import manhattan_reasoning_gym as mrg
result = mrg.Sandbox(files=["examples/design.py", "examples/agent.py"]).run("agent.py")
for promo in result.promotions:
print(promo)
The container never holds a key or touches the network; the promote is a file
handoff the trusted host brokers to silicon. No promote gating by default —
the agent gates itself; pass guard= for an opt-in host-side check. With no API
key, silicon resolves to a no-op backend; set one (and silicon="cloud") for
real hardware.
Real silicon — mrg.cloud
import manhattan_reasoning_gym as mrg
app = mrg.cloud.App("my_design", design="examples/design.py")
with app: # programs the FPGA on first use, releases on exit
app.write(0x0, 3) # byte address: word n in the design => 4*n
print("read:", app.read(0x8))
read/write calls go over one WebSocket that the SDK opens on the first
call and reuses for every call after it. It stays open for the whole session;
the server closes it when the session ends. On a network that blocks WebSockets, use HTTP
instead: App(..., transport="http"), MRG_TRANSPORT=http, or
--transport http on mrg run / mrg read / mrg write. HTTP works
anywhere but is much slower: each call is a queued job (about 0.5 s or more).
A WebSocket call waits for the board's reply with no time limit. To cut a call
that is stuck, call app.abort() from another thread, for example from a
watchdog timer. It is thread-safe and returns at once; the stuck call raises
mrg.cloud.CallAborted (a ConnectionError). As with any dropped call, the
operation may or may not have run on the FPGA. The board is not released:
the next read/write opens a new connection.
watchdog = threading.Timer(30, app.abort) # give up on a reply after 30 s
watchdog.start()
try:
result = app.read(0x8)
finally:
watchdog.cancel()
Or drive it from the CLI with a file that defines an App and an
@app.local_entrypoint() — see examples/app.py, which
exercises the example MAC design end-to-end:
mrg run examples/app.py
Name your registers by subclassing mrg.RegisterMap (byte addresses).
Clock sweeps without rebuilding: app.reclock(hz) reflashes the board with
the same build at another user clock, in seconds instead of a full build. The
placement and routing are identical at every point, so a sweep is a true
overclock test. Reachable rates are VCO / n between 20 and 200 MHz (with the
usual 600 MHz VCO: 50, 60, 75, 100, 120, 150, ...); a request within 1% of one
snaps to it, and the call returns the exact rate flashed. Anything else raises
mrg.cloud.ReclockError listing the rates the build can reach. Reflashing resets the
design, so re-write any registers you had set. A rate too fast for the design
to boot ends the session.
for hz in (50e6, 75e6, 100e6, 120e6, 150e6):
app.reclock(hz)
app.write(0x0, 3)
print(hz, app.read(0x8))
Solve-cycle counter (FPSAT): App(..., solve_cycle_counter=True) (or
mrg run --solve-cycle-counter, or MRG_SOLVE_CYCLE_COUNTER=1) builds the SoC
with the FPSAT register map's solve-cycle counter. Words 10-11 of your
register window (byte addresses 0x28/0x2C, CYCLES_LO/CYCLES_HI) are then
answered by the SoC and never reach your design. The counter counts design-clock
cycles from a START written to word 0 while your design's STATUS (word 1)
is idle, until the SoC sees DONE or REJECTED in STATUS, or an ABORT
is written. It then holds its value until the next accepted START.
app.solve_cycles() reads it safely while it runs. app.design_clock_hz is
the clock the PLL actually produces (up to ~1% from what you asked for), so
the solve time is app.solve_cycles() / app.design_clock_hz. After
app.reclock() it is the new variant's clock. mrg job <id> shows both.
Off by default: without it, words 10-11 are your design's like any other.
It works with mrg run --local too.
app = mrg.App("fpsat", design="design.py", solve_cycle_counter=True)
app.write(0x0, 1) # CTRL.START
while not app.read(0x4) & 0b110: # STATUS.DONE | STATUS.REJECTED
pass
print(app.solve_cycles() / app.design_clock_hz, "s")
Board lifecycle: the with app: form releases the board on exit, but
mrg run does not — the reservation persists so you can keep iterating
with mrg run --no-program, mrg read, and mrg write. Free the board with
mrg reset (an async job that reflashes the base SoC, ~1 min — poll
mrg status).
Sessions, not boards: you never pick a board or see which one you got.
Each reservation is a session with a random id (mrg status shows its first
8 characters, app.session_id the whole thing). mrg run --no-program,
mrg read, mrg write and mrg reset act on the session you hold; if you
hold more than one, choose with --session ID (the 8-character prefix is
enough). A session's id stops working the moment it ends, and the next build
gets a new one.
Board peripherals
Some boards have extra hardware wired to a header, such as an MPU-6050 IMU.
mrg peripherals lists what you can ask for, whether a board with it is free
right now, and where its signals are wired (FPGA ball and header pin). It
doesn't say which boards have it or how many.
It also lists what every board has, such as the LAN8720 Ethernet module on
J40: that's standard equipment, so there's nothing to ask for. To ask for a peripheral:
app = mrg.App("imu_test", design="design.py", peripherals=["mpu6050"])
or mrg run design_app.py --peripheral mpu6050. You get a board with every
peripheral you asked for. If you don't ask for any, you get a board with
none when one is free. When none is, you may get a board with a peripheral
that nobody is waiting for. mrg status shows a session's peripherals. If
every matching board is busy, the build waits for one. A name no board has,
or one whose boards are all out of service, is refused before anything is
built.
Your design reaches the peripheral's pins through the user GPIO ports on
header J39; examples/mpu6050 reads the IMU this way.
Where the bitstream is built: local by default
mrg run builds the bitstream on your machine and uses the cloud only to
flash and run it, for single- and multi-file designs alike. It needs Docker
for that. Without Docker it builds nowhere: it stops and says how to fix it,
for example:
error: Docker not found. mrg run builds on this machine by default: install Docker (https://docs.docker.com/get-docker/) and run this again. Please fix this rather than switching to the cloud: local builds are preferred, as they are usually much faster and don't wait in the shared cloud build queue. Only if Docker can't be used on this machine, build in the cloud with --cloud (App(..., local=False)) or MRG_BUILD=cloud.
The cloud builds only when you ask for it:
| Choice | Builds |
|---|---|
| nothing (auto) | locally; fails with the reason if Docker or the build image isn't usable |
mrg run --local, App(..., local=True) |
locally, or fails with the reason |
mrg run --cloud, App(..., local=False) |
in the cloud, without checking Docker |
$MRG_BUILD=local|cloud|auto |
the default when neither the flag nor local= is given |
The flag or local= wins over $MRG_BUILD, which wins over auto. Auto's
check is one docker info (it never pulls the image, prompts or waits on
input before deciding). Services and CI without Docker should set
MRG_BUILD=cloud or pass local=False. In Python the failure is
mrg.cloud.LocalBuildUnavailable (a RuntimeError).
A multi-file design (one that --source, --include-dir, or discovery finds
more files for) is built locally from the same source bundle the cloud would
receive, so it builds exactly the files a cloud build would, including ones
outside the design's folder (include_dir=".."). The bundle is kept as
project.zip in the build folder. Only a build image too old to build
bundles (a custom $MRG_LOCAL_BUILD_IMAGE) can't build a multi-file design,
and the build fails saying so.
When auto picks a local build and the image isn't here yet, one line says the first build downloads
it, then the pull shows its progress. If Docker has under 4 GB of memory
(docker info MemTotal), the build still runs locally but prints a warning
naming the setting to raise.
Build locally, run in the cloud: mrg run --local
A local build keeps the build log on your disk and doesn't wait for the server's build queue.
It builds in the public toolchain image,
ghcr.io/manhattanreasoning/mrg-sandbox, which carries the same build pipeline
the cloud runs (cloud_fpga_firmware.compiler). The SDK pulls it for you;
nothing to build first.
Build platform: native by default
The image comes for linux/arm64 and linux/amd64. Local builds (mrg synth,
mrg pnr and mrg run --local alike) run your machine's native platform:
linux/arm64 on Apple silicon, linux/amd64 on x86. That avoids CPU emulation,
which makes builds several times slower.
A native build can differ from the cloud's. The cloud builds on linux/amd64, and the arm64 toolchain binaries can place and route a design differently, so a native arm64 build can report a different Fmax and produce a different bitstream from a cloud build of the same design. If you need results that match the cloud's exactly, build on linux/amd64. On Apple silicon that runs under emulation, and the SDK prints a one-line note that it will be slow. Choose the platform with:
mrg synth|pnr|run --platform linux/amd64$MRG_BUILD_PLATFORM=linux/amd64App(..., build_platform="linux/amd64")ormrg.build.pnr(..., platform="linux/amd64")
synth/pnr reports carry the platform they ran on as platform, and the
mrg run --local build summary has a platform: line saying whether it
matches the cloud build.
A variant that isn't on your machine yet is pulled automatically. If the image
has no variant for the platform at all (say, a custom amd64-only
$MRG_LOCAL_BUILD_IMAGE on Apple silicon), the SDK checks before building:
with the native default it builds on a platform the image does have and says
so in one line; a platform you chose explicitly is an error that lists the
platforms the image provides.
mrg run --local examples/app.py
mrg run --local examples/app.py --sys-clk 75e6 --timing-target-mhz 80
What it does, with a current build image (one whose SoC has the flash-time identity ROM):
-
Builds the design in Docker (
--network=none) before asking the server for anything, so no reservation can expire however long the build takes. The container sees only the selected sources: the single design file or the multi-file source bundle, copied into it, never the rest of the design's folder. No folder on your machine is mounted into the container: the results are copied out of it when the build ends, and the container (namedmrg-local-build-...) is removed, also after a failure or Ctrl-C. Every build is the same for every board: the board's network identity is a fixed placeholder that the board host replaces when it flashes the board. Output goes to./build/<app name>/in the current directory, holdingdesign.bit,manifest.json(sha256, image digest, git revision, and undersourcesevery file the build used with its sha256, paths as in the bundle),build.logand nextpnr'slitex.log(plusproject.zipfor a multi-file design).sourcesstays on your disk; it isn't uploaded. Each build replaces the previous build's files there and leaves other files alone. A build is made in its own staging folder (.staging-<random>/inside, removed when it ends) and moved in only once it is complete, so two runs of the same app at once never mix their files, and each uploads its own bitstream; an interrupted build leaves the previous one in place. The bitstream and folder paths are printed when the build finishes, and so is a timing/utilisation summary (target part, Fmax per clock, resource use, stage times). Choose another folder withmrg run --local --build-dir DIR,$MRG_BUILD_DIR, orApp(..., build_dir=DIR). Addbuild/to your.gitignore.If nothing that decides the bitstream changed since the last successful build in that folder, it is reused instead of built again, and the run says so:
[name] design unchanged since the last build; reusing build/<name>/design.bit (use --rebuild to build again). "Nothing changed" means the same source files with the same contents (the design file, or every file in the multi-file bundle), the same build image digest, Docker platform,sys_clk_freq, timing target, top module and solve-cycle counter setting, and the same SDK build script. A successful build records these as a key inbuild-cache.json; a failed build leaves none. The bitstream's sha256 must still matchmanifest.json, or it is built again. A reused build uploads the same bitstream and manifest as when it was built. So when the server refuses the job after a build (for example429 board_quota_exceeded), running the same command again later flashes the saved bitstream in seconds.mrg run --rebuild,App(..., rebuild=True)or$MRG_REBUILD=1always builds. -
Creates the job (
POST /builds/local), retrying for up to 10 minutes while the server answers503 no_build_capacityor402 build_in_flight. -
Uploads the bitstream and manifest (
PUT /jobs/{job_id}/bitstream). The server answersqueued, flashes a board, and the job endscomplete. -
Waits for the board, then runs your
@app.local_entrypoint()as usual.
If the server still hands out a build slot in step 2 (a server from before
flash-time identity), the SDK writes that slot's identity into the finished
bitstream itself (ecpbram in the build image, a few seconds, verified) and
uploads design.slot<N>.bit (with manifest.slot<N>.json; design.bit and
manifest.json stay as built). With an older build image that has no identity
ROM, the SDK falls back to the old order: reserve a slot, build for it, upload
before the deadline (30 min by default; past it the upload gets 410 and you
run mrg run --local again). The slot is baked into such a bitstream, so it
is reused only for a reservation of the same slot. With a slot written in
after the build, the reused design.bit gets that slot's identity again.
In Python, mrg.cloud.App(...) builds the same way (auto by default);
local=True forces a local build. Notes:
- Needs Docker. The image is pinned by digest per SDK release (the cloud
build's). Set
$MRG_LOCAL_BUILD_IMAGEto use another: a sha tag (ghcr.io/manhattanreasoning/mrg-sandbox:<12-char commit>), a digest,...:latest, or a local tag (local tags are not pulled). The manifest records the digest used. An image without a variant for your build platform is handled as described under Build platform. - Several local builds at once: with a flash-time-identity image any number
of
mrg run --localcan build at once, and a server that runs flash-identity local builds side by side flashes them all (only the account's board limit applies). An older server allows one local build in flight per user and answers a second job request with402 build_in_flight: the second, already built, waits (up to 10 minutes) for the first to finish flashing before it creates its job, printingbitstream built; waiting to flash it: .... If it gives up, the error says where the built bitstream is. - Local builds have no time limit by default. The cloud allows 30 minutes for
each of the three stages before the gateware stage and 90 minutes for the
gateware stage (yosys + nextpnr). To limit the gateware stage locally, use
mrg run --local --build-timeout SECONDS,$MRG_BUILD_TIMEOUTorApp(..., build_timeout=SECONDS); a build that hits it says so and names these options. These settings never change a cloud build's limits. - Place-and-route gets the cloud's memory ceiling (26624 MB), capped at the
memory Docker has (on macOS and Windows, the Docker VM's; raise it in Docker
Desktop's settings for large designs). A ceiling above what Docker has could
never be reached: the kernel would kill the build first, with no log saying
why. Set
$MRG_BUILD_MAX_MEMORY_MBto choose another. - Multi-file designs build from the cloud's source bundle (see above), with the same limits (Multi-file cloud designs).
Authentication (cloud only)
API requests authenticate with an opaque API key sent as X-API-Key. You obtain
one by exchanging a GitHub identity — the orchestrator verifies you against its
allowlist and mints a key.
mrg login # GitHub device flow (or paste a no-scope PAT), then you're set
The key is saved to ~/.config/mrg/credentials.json (mode 0600, keyed by
orchestrator URL). Every command resolves the key in this order:
--api-keyflag$MRG_API_KEY- the stored login (
mrg login)
mrg logout revokes the key on the server and clears it locally.
Tutorials
Two runnable notebooks in examples/notebooks/:
01_build_and_run— local synth/pnr feedback → program a real FPGA.02_sandboxing— run an agent in a locked sandbox that promotes to silicon.
The shared examples/design.py is a tiny tunable multiply-accumulate; tweak its
WIDTH and watch DSP/Fmax move. examples/agent.py is the sandboxed agent, and
examples/app.py is the mrg run app that drives the MAC on real silicon.
Environment variables
Every setting below can also be given as an argument; an argument wins over the variable.
| Variable | What it sets | Default |
|---|---|---|
MRG_API_KEY |
API key for the cloud | the key mrg login stored |
MRG_GITHUB_CLIENT_ID |
GitHub OAuth app mrg login uses for the device flow (--client-id) |
the SDK's built-in app |
MRG_TRANSPORT |
How read/write reach the board: websocket or http (App(transport=...), --transport) |
websocket |
MRG_POLL_TIMEOUT |
Seconds to wait for a cloud build to finish and flash (App(poll_timeout=...)). Set it and it wins over the server's suggested deadline |
14400 (4 h), or the server's poll_deadline_s for the job when longer (time the job waits queued doesn't count) |
MRG_SYS_CLK_FREQ |
SoC compute clock in Hz (App(sys_clk_freq=...), --sys-clk) |
50000000 |
MRG_TIMING_TARGET_MHZ |
Place-and-route timing target in MHz (App(timing_target_mhz=...), --timing-target-mhz) |
the sys clock |
MRG_SOLVE_CYCLE_COUNTER |
1 builds the SoC with the solve-cycle counter (App(solve_cycle_counter=...), --solve-cycle-counter) |
off |
MRG_BUILD |
Where mrg run builds: local, cloud or auto (App(local=...), --local/--cloud) |
auto: local when Docker is usable, else an error (the cloud only when asked for) |
MRG_BUILD_PLATFORM |
Docker platform for local builds, e.g. linux/amd64 (--platform) |
this machine's native platform |
MRG_LOCAL_BUILD_IMAGE |
Image mrg run --local builds in |
the pinned mrg-sandbox@sha256:63d94415… |
MRG_SANDBOX_IMAGE |
Image mrg synth/mrg pnr run in |
the pinned mrg-sandbox@sha256:63d94415… |
MRG_BUILD_DIR |
Output folder for mrg run --local (App(build_dir=...), --build-dir) |
./build/<app name>/ |
MRG_BUILD_TIMEOUT |
Seconds the gateware stage of a local build may take (App(build_timeout=...), --build-timeout) |
no limit |
MRG_REBUILD |
1 always builds locally, even when the last build in the build folder has the same inputs (App(rebuild=...), --rebuild) |
off: reuse it |
MRG_BUILD_MAX_MEMORY_MB |
Place-and-route memory ceiling of a local build, in MB | 26624 (the cloud's), capped at Docker's memory |
MRG_WORKSPACE |
Folder a sandboxed agent shares with the trusted broker (mrg.Sandbox, promote(workspace=...)) |
/work |
CLI reference
mrg --version # the installed SDK version
mrg login | logout
mrg synth <design.py> [--platform P] # local synthesis report
mrg pnr <design.py> [--sys-clk-mhz N] [--timing-target-mhz N] [--target-mhz N]
[--platform P]
# local full-SoC place & route
mrg run <file.py> [--no-program] [--session ID] # reconnect to your session, no rebuild
mrg run <file.py> [--local | --cloud] [--build-dir DIR] [--build-timeout SECONDS]
[--platform linux/amd64|linux/arm64] [--rebuild]
# build here (needs Docker; without it, stops
# and says how to fix it); --cloud builds in the cloud
mrg run <file.py> --solve-cycle-counter # SoC answers words 10-11 with the FPSAT cycle counter
mrg run <file.py> --peripheral NAME # a board with this peripheral (repeatable)
mrg peripherals [--json] # peripherals you can ask for, with pins
mrg status [SESSION | --session ID] [--json]
mrg jobs [--status queued|running|complete|failed|cancelled]
[--type build|run|reset|all] [-n N | --all] [--json]
# default: your 10 most recent builds
mrg job <job_id> [--json]
mrg logs | cancel <job_id>
mrg reset [SESSION]
mrg read <addr> [--count N] [--session ID]
mrg write <addr> <value> [--session ID]
mrg admin [online|offline <fpga_id>... [--reason TEXT]] [--json]
# admins only: physical stack view,
# take boards in/out of rotation
# (with 3-day error counts); the
# note goes in the audit log
mrg status lists the sessions you hold (it needs you signed in: mrg login).
With none it says so; mrg status --json then prints []. A session id that
has ended, or isn't yours, gets the same "no such session" answer either way.
Human-readable mrg status output includes the server commit from /health.
A package built with local changes is marked modified source. Older servers
or builds without commit metadata show unknown; an unavailable health endpoint
shows unavailable without suppressing board status. mrg status --json keeps
its existing board-only output and does not make the extra health request.
Development
pip install -e ".[dev]"
ruff check . && pytest -q
License
MIT — see LICENSE.
Multi-file designs
Provide the top-level design file. The SDK automatically finds local Python
imports, Verilog module instances, literal include headers, and literal
$readmemh/$readmemb data files under the design's folder:
app = mrg.App("my_design", design="project/design.v")
Discovery follows dependencies recursively and uploads only the files it finds. It reads source text without running your code. Python dependencies already installed on the server, such as Amaranth, are not uploaded or installed again.
Alternatively, provide a directory containing the supporting files:
app = mrg.App(
"my_design",
design="project/design.v",
include_dir="support",
)
include_dir is relative to the design file's folder (or can be absolute).
All supported source files in that directory and its subdirectories are
uploaded, together with the main design. Use a directory containing only the
files needed for the build. Directory contents become the bundle root; a main
file outside that directory is placed at the root, while a main file inside it
keeps its relative path. For example, use include_dir=".." when a design in
project/rtl/top.v needs files elsewhere under project/.
The directory option also works with Python/Amaranth designs and from the CLI:
mrg run client.py --include-dir support. Paths are relative to the design,
not the client script. Hidden entries, symlink directories, __pycache__,
node_modules, build, and dist are not scanned.
For precise control, sources=["rtl/child.v", "include/constants.vh"] replaces
automatic discovery and directory collection with that exact file list. Paths
are relative to include_dir when supplied, otherwise the design's folder.
Repeatable mrg run client.py --source rtl/child.v uses this explicit mode too.
sources=[] opts out of discovery. Do not list the main file again.
Automatic discovery supports ordinary static imports and Verilog instances;
it is not a full language preprocessor. Dynamic Python imports and generated
file names need directory or explicit-file mode. Macro-based Verilog includes
request one of those modes. Duplicate module definitions or ambiguous include
names require an explicit selection or qualified include path. Missing Verilog
modules are still checked by the compiler. Textually included .v files with
literal include names are kept out of the separate compilation list.
Supported files: .py, .v, .vh, .mem, .hex. Use simple path names
(letters, digits, _, -, ., /); source symlinks and dependencies escaping
the selected root are rejected. Bundles are limited to 128 files, 8 MiB
compressed and 16 MiB expanded including metadata. Discovery scans at most
4096 directory entries and 16 MiB of source text; choose a smaller directory
or an explicit list if necessary. A design without local dependencies keeps
the single-file upload format. This requires the matching cloud API/build-image
update. mrg run builds the same bundle locally (see
Where the bitstream is built);
mrg synth/mrg pnr remain single-file commands.
See the example.
What the dashboard shows about a build
Each cloud build also sends the command that started it (for example
mrg run sat.py --top t) and the app's name, so the web dashboard can show
them with the build. You and the Manhattan Reasoning admins can see them.
- The value of any option whose name contains
key,token,secretorpassword(as--name value,--name=valueorNAME=value) is replaced by***. - A notebook sends only
jupyter, andpython -csends no code.
Other values are sent as typed, so pass any other secret in an environment variable, not on the command line.
Status durations
mrg status shows HELD FOR (time since the current reservation began) and
JOB AGE (time since submission of the job currently assigned to the board).
When logged in, it also lists your queued/running builds, including those with
no board yet, with elapsed time and the latest stage when available. That extra
lookup has a three-second timeout; a failure does not hide the board table.
Anonymous status requests do not fetch private jobs.
Durations are snapshots in HH:MM:SS; run the command again to refresh them.
Job age includes queueing, building, and flashing—it is not billable build time.
mrg jobs and mrg job also show elapsed time; completed, failed, or cancelled
jobs use their last-update timestamp as the end instead of continuing to tick.
Older servers/sessions without start timestamps show -, as do invalid dates.
Client clock skew can affect active durations; negative values are clamped to zero.
mrg jobs lists your 10 most recent builds by default, with a footer counting
what's hidden. Every HTTP app.read()/app.write() is its own run job, so
--type all is mostly those. -n N shows more and --all shows everything.
--json is always the raw, unfiltered server response.
JSON output retains the API response shape without adding computed duration fields.
Metadata
Release files for manhattan-reasoning-gym 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| manhattan_reasoning_gym-0.6.3.tar.gz | 307.9 kB | With provenance | Details for manhattan_reasoning_gym-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| manhattan_reasoning_gym-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for manhattan_reasoning_gym-0.6.3-py3-none-any.whl |
Total release size: 427.4 kB
Release files / manhattan_reasoning_gym-0.6.3.tar.gz
| Download URL | manhattan_reasoning_gym-0.6.3.tar.gz |
|---|---|
| Size | 307.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0a723f4ccb63bdb0cc7747568625b36d49ed968d2c53b678697054f0d35fec9
|
|
BLAKE2b-256 checksum How to use checksums |
074c32bbf9bf53e28302b37820046f94ec4e0dd5074a23f7cb8ad790d79edae3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logRelease files / manhattan_reasoning_gym-0.6.3-py3-none-any.whl
| Download URL | manhattan_reasoning_gym-0.6.3-py3-none-any.whl |
|---|---|
| Size | 119.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dacbfa2ee6122c0e82d655d507849e2f81a76ecd462653162e4450b5df04add
|
|
BLAKE2b-256 checksum How to use checksums |
6391fe7e17a82c2811fcb92497c5d9eacc952fec381d5b0e4cf6682167b1a686
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logSecurity for manhattan-reasoning-gym 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for manhattan_reasoning_gym-0.6.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.