Repository navigation
Remove stray test outputs; list RV64 flags in help; name the selected RISC-V backend in errors - #95
Conversation
… RISC-V backend in errors Stray files at the repository root: - out.png, spawn_out.txt and spawn_env.txt were test outputs committed by accident. Nothing references them. - out.png is what examples/png_encode.mere writes to its working directory. scripts/examples_parity.sh ran every example from wherever it was invoked, so out.png (and mandelbrot's and raytrace's .ppm files) landed in the checkout. The interpreter and the C binary now run from a scratch directory inside the script's temp dir; the counts are unchanged. - spawn_env.txt and spawn_out.txt are written by test/rv/host_spawn.mere to its working directory. rv_exec_check.sh runs it in a temp dir, but a run by hand from the root left them behind. The test now removes each file with file_delete once it has read it; its output is unchanged. mere --help: - lists -rvse, -rv64, -rv64s and -rv64g, and says the --ram / --coro-stack / --load-base / --bare switches apply to the -rv64 forms too - no longer states a file count for examples/ (it said 280; there are 291) RISC-V messages: - a `stack` request in mere.toml refused under -rv64 said "the RV32IM backend"; it now names RV64IM when xlen is 64 - the coroutine-region refusal and the "RV32I internal" assembler and frame-slot failures were raised outside `err`, so at 64 bits they still said RV32I; they now go through target_msg like every other message Tests: stack_request_check.sh checks the -rv64 refusal names RV64IM; test_basic checks the coroutine-region refusal at both widths.
284km
left a comment
There was a problem hiding this comment.
Reviewed 0f0fdd4 against its base 4f2c660 and checked current main 0109d7f (the intervening changes are documentation only). No actionable correctness issue found. The scratch working directory prevents generated example images entering the checkout, while preserving relative MERE=./_build/... invocation. Reusing target_msg keeps RV32 diagnostics unchanged and correctly labels RV64 errors; the new two-width regression covers the previously misleading coroutine refusal.
Actual local validation on macOS arm64 / OCaml 5.4.1:
- dune test succeeds: 3,061 passed, zero failed, including both new coroutine-region assertions; CLI build succeeds.
- stack_request_check.sh and --poison succeed, including the RV64IM refusal and both negative controls. With approved process inspection, the trivial 512 MB stack request uses 5,536 KiB RSS.
- examples_parity.sh with relative MERE=./_build/default/bin/mere.exe succeeds: 186 compared, 91 skipped, one nondeterministic, 13 C refusals. No generated checkout files remain. These are this environment's observed counts, not the PR description's counts.
- Compiled the original-base and updated host_spawn fixtures to C at O2, ran both with process inspection permitted, and compared stdout byte for byte: identical. The updated fixture leaves its working directory empty. The first sandboxed run blocked ps (and RSS inspection in the stack check); those limitations were rechecked with approved access and are not program defects.
- Shell syntax checks and doc_claims_check.sh succeed (19 claims, zero stale).
Hosted CI: the exact-head downstream examples-parity step completed successfully; other jobs are still running, with no failure observed at the last check. I did not run RV32/RV64 execution locally and do not claim the remaining hosted gates passing. No merge performed: verification is still running rather than only unassigned queues, and the recorded all-merge/new-failure hold remains active.
What changed and why
1. Stray test outputs at the repository root
out.png,spawn_out.txtandspawn_env.txtwere committed by accident. They are test outputs, and nothing in the repo references them, so this PR deletes them. It also fixes what wrote them so they cannot come back:out.pngis written to the working directory byexamples/png_encode.mere. It first appeared in the same commit that addedscripts/examples_parity.sh. That script ran every example from wherever it was invoked, soout.pnglanded in the checkout, along with the.ppmfiles frommandelbrot.mereandraytrace.mere(those are gitignored). The interpreter runs and the C binary now run from a scratch directory inside the script's temp dir. A relativeMERE=path is made absolute first, so it still resolves.spawn_env.txt/spawn_out.txtare written to the working directory bytest/rv/host_spawn.mere.rv_exec_check.shalready runs it inside a temp dir, but a run by hand from the repo root left the files behind. The test now removes each file withfile_deleteonce it has read it, ashost_files.mereandhost_run.merealready do. Its output is unchanged.Both writers could be fixed directly, so
.gitignoreis not changed.2.
mere --help-rvse(an RV32IM listing for an inline expression), plus-rv64,-rv64sand-rv64g(the same backend at 64 bits: binary, listing, debug map). These are the flagsbin/mere.mlparses.--ram/--coro-stack/--load-base/--barenow says it applies to the-rv64forms as well.examples/no longer gets a file count. It said 280; there are 291. It now just points toexamples/README.md.No file under docs/ or README quotes the changed help text (grep), so no docs files are touched.
3. Errors name the RISC-V backend that was selected
A
stacksetting inmere.tomlrefused under-rv64used to say "the RV32IM backend cannot honour …". It now says RV64IM when the backend is at 64 bits.Three other errors are raised outside
err, so they skippedtarget_msgand still saidRV32Iat 64 bits. They now go throughtarget_msglike every other message incodegen_riscv.ml:--coro-stack/--ramleaving too little heap)RV32I internalassembler failures (immediate field, CSR number)The 32-bit wording is unchanged.
Tests
scripts/stack_request_check.shalso checks that-rv64refuses the request and names RV64IM. It passes, and so does--poison.test/test_basic.mlchecks the coroutine-region refusal at both widths (RV32I / RV64I).dune test: 3307 passed, 0 failed.scripts/examples_parity.sh--poisonis ok, and the run leaves no files in the checkoutscripts/rv_exec_check.sh --contractswith memu: all pass, includinghost_spawn:32andhost_spawn:64.host_spawnby hand on C and on RV64 (memu) in an empty directory: same output, and the directory is empty afterwards.scripts/doc_cmd_check.sh(and--poison) andscripts/doc_claims_check.sh: ok, 19 claims checked, 0 stale.Affected backends: RISC-V (RV32IM / RV64IM) messages only. Nothing that is emitted changes.
No version bump or changelog entry, following recent PRs (#83–#92).
🤖 Generated with Claude Code