Repository navigation
feat(cli)!: unify benchmark execution under celox run - #1633
Conversation
|
This pull request is part of a Mergify stack:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
celox/crates/celox-vpi/src/bin/celox/runner.rs
Lines 727 to 731 in 3e315ef
For a successful native --compile-only invocation that emits nonfatal compiler warnings, both fresh-compilation branches immediately consume NativeCompilation into its image and discard its warning vector. The equivalent compile-and-run path calls report_warnings, so adding --compile-only silently hides diagnostics. Report compiled.warnings() before consuming the compilation, including the cache-miss branch.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| design | ||
| .project_root | ||
| .as_deref() | ||
| .unwrap_or(Path::new(".")) | ||
| .join(path) |
There was a problem hiding this comment.
Resolve --source-file against the celox.toml directory
When --project names a celox.toml, design.project_root remains unset, so a relative --source-file is joined to the process working directory rather than the project manifest's directory. For example, invoking Celox from another directory with --project /tmp/p/celox.toml --source-file src/test.veryl attempts to read ./src/test.veryl, contrary to the option's project-relative contract. Preserve the manifest parent separately and use it as the base here.
Useful? React with 👍 / 👎.
| report!( | ||
| opts.report, | ||
| "CELOX_TEST_CONFIG test={} backend={} opt_level={} four_state={} compile_only={}", | ||
| opts.test, | ||
| opts.backend.as_str(), |
There was a problem hiding this comment.
Report native images' embedded state mode
When --native-image-input loads an image generated with the opposite four-state setting, build_native_from_image takes the actual mode from the image, but this record prints the current CLI flag. Thus a four-state image loaded without --four-state is reported as four_state=false (and the reverse invocation can report true while executing two-state code), corrupting machine-readable benchmark configuration. Derive this field from the loaded image or reject conflicting state-mode flags.
Useful? React with 👍 / 👎.
| if opts.require_compiled && opts.backend != Backend::Tiered { | ||
| return Err(RunError::InvalidConfiguration { | ||
| message: "--require-compiled requires --backend tiered", | ||
| }); |
There was a problem hiding this comment.
Return usage status for invalid execution options
These option-compatibility checks run after Clap parsing and return RunError::InvalidConfiguration, which main maps to exit status 1. Consequently invocations such as --report --require-compiled --backend native are indistinguishable from compilation or simulation failures and violate the CLI's documented status-2 contract for invalid arguments. Encode these relationships as Clap conflicts/requirements or otherwise return a usage error.
Useful? React with 👍 / 👎.
| if opts.dump_ir_and_run { | ||
| let mut sim = compiled.initialize()?; | ||
| let testbench = compile_initial_testbench(&sim) | ||
| .ok_or(CeloxHeliodorError::MissingInitialBlock)?; | ||
| let testbench = | ||
| compile_initial_testbench(&sim).ok_or(RunError::MissingInitialBlock)?; |
There was a problem hiding this comment.
Reject running an explicitly compile-only invocation
If users combine --compile-only --dump-ir-dir DIR --dump-ir-and-run—a combination currently accepted—control reaches this branch and initializes and executes the testbench despite the explicit compile-only request. This can run long simulations or trigger design side effects when callers expect compilation only; reject --compile-only with --dump-ir-and-run before entering the trace path.
Useful? React with 👍 / 👎.
| if [[ -z "$CELOX_RUNNER_BIN" ]]; then | ||
| if [[ -n "$HELIODOR_CELOX_EXECUTION_TARGET" ]]; then | ||
| CELOX_RUNNER_BIN="$CELOX_TARGET_ROOT/$HELIODOR_CELOX_EXECUTION_TARGET/$HELIODOR_CELOX_CARGO_PROFILE/celox-heliodor" | ||
| CELOX_RUNNER_BIN="$CELOX_TARGET_ROOT/$HELIODOR_CELOX_EXECUTION_TARGET/$HELIODOR_CELOX_CARGO_PROFILE/celox" | ||
| else | ||
| CELOX_RUNNER_BIN="$CELOX_TARGET_ROOT/$HELIODOR_CELOX_CARGO_PROFILE/celox-heliodor" | ||
| CELOX_RUNNER_BIN="$CELOX_TARGET_ROOT/$HELIODOR_CELOX_CARGO_PROFILE/celox" | ||
| fi |
There was a problem hiding this comment.
Support legacy artifacts in profiling-run reuse
In the arm64-linux-boot-full workflow's “Reuse ARM64 profiling runners” path, selecting an arm64_profile_run_id from before this migration downloads an artifact containing celox-heliodor, while the build and Rust setup are skipped and this script now looks only for target/release/celox. The later comparison/capture steps therefore fail at chmod before profiling starts. The comparison-artifact path already handles this transition; the profiling-run reuse path needs an equivalent filename-and-CLI fallback or an explicit compatibility rejection.
Useful? React with 👍 / 👎.
Heliodor previously used a separate Celox executable with backend selection, parallel execution, timing, caching and native-image support that ordinary CLI users could not access. Move that execution path into celox run and remove the celox-heliodor binary. Heliodor now invokes celox run --report --unlimited; its tiered runner also requires compiled execution and retains the configured thread count. For both SystemVerilog and Veryl, expose native/tiered/interpreter/Cranelift/WASM selection with explicit thread and state modes. Add timed tiered construction that preserves initial scheduling and live state across promotion. Keep normal runs free of JIT timing overhead and preserve execution limits and failures. Veryl additionally supports compilation caching, image import/export, compiler diagnostics and opt-in machine-readable timing records. Accept Veryl project directories and explicit source selection through the normal project resolver. Include CLI parameter, diagnostic and signal-access settings in cache identity. Compile exported VPI artifacts without initializing executable memory, retaining their warnings and supporting cross-codegen builds. Update benchmark scripts, ARM profiling, CI selection and both language guides. Resolve source-file paths against celox.toml's directory, report native images' embedded state mode, and return usage status 2 for invalid execution options. Preserve warnings from fresh native compile-only builds and reject combining compile-only with dump-ir-and-run. Reject legacy profiling-run reuse early with rebuild instructions; comparison baselines still accept legacy executables. Clamp default benchmark threads to 2–64 and reset inherited overrides in the fixed gate. Validation: - cargo test --locked -p celox-vpi: 127 passed, including review regressions and all five CLI backends in two-state/four-state mode. - Timed process tests: 9 passed, including actual tiered promotion with pending delayed processes, NBA updates, and 1/4-thread configurations. - Clippy for celox and celox-vpi across all targets, formatting, API docs, script tests, Heliodor result/gate fixtures, workflow YAML parsing and syntax checks for all 19 shell steps passed. - Earlier validation also passed bench tests, the three explicit cocotb tests, ARM64 cross-codegen image export, and the CLI no-default-features check. ARM hardware Linux boot benchmarks were not run. Existing cargo-deny CI fails on Wasmtime 49.0.3 advisories; dependency remediation is outside this CLI change. BREAKING CHANGE: celox run now defaults to two-state simulation for both SystemVerilog and Veryl. Pass --four-state to retain X/Z tracking. The internal celox-heliodor executable is replaced by celox run. Change-Id: I7db09e5916dcec3a0173ad3df4901ff82eb72bb8
3e315ef to
b407278
Compare
Revision history
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 46 minutes 49 seconds in the queue, including 36 minutes 3 seconds running CI. Required conditions to merge
|
Heliodor previously used a separate Celox executable with backend selection,
parallel execution, timing, caching and native-image support that ordinary CLI
users could not access. Move that execution path into celox run and remove the
celox-heliodor binary. Heliodor now invokes celox run --report --unlimited;
its tiered runner also requires compiled execution and retains the configured
thread count.
For both SystemVerilog and Veryl, expose native/tiered/interpreter/Cranelift/WASM
selection with explicit thread and state modes. Add timed tiered construction
that preserves initial scheduling and live state across promotion. Keep normal
runs free of JIT timing overhead and preserve execution limits and failures.
Veryl additionally supports compilation caching, image import/export, compiler
diagnostics and opt-in machine-readable timing records.
Accept Veryl project directories and explicit source selection through the
normal project resolver. Include CLI parameter, diagnostic and signal-access
settings in cache identity. Compile exported VPI artifacts without initializing
executable memory, retaining their warnings and supporting cross-codegen builds.
Update benchmark scripts, ARM profiling, CI selection and both language guides.
Resolve source-file paths against celox.toml's directory, report native images'
embedded state mode, and return usage status 2 for invalid execution options.
Preserve warnings from fresh native compile-only builds and reject combining
compile-only with dump-ir-and-run. Reject legacy profiling-run reuse early with
rebuild instructions; comparison baselines still accept legacy executables.
Clamp default benchmark threads to 2–64 and reset inherited overrides in the
fixed gate.
Validation:
and all five CLI backends in two-state/four-state mode.
delayed processes, NBA updates, and 1/4-thread configurations.
script tests, Heliodor result/gate fixtures, workflow YAML parsing and
syntax checks for all 19 shell steps passed.
ARM64 cross-codegen image export, and the CLI no-default-features check.
ARM hardware Linux boot benchmarks were not run. Existing cargo-deny CI fails
on Wasmtime 49.0.3 advisories; dependency remediation is outside this CLI change.
BREAKING CHANGE: celox run now defaults to two-state simulation for both
SystemVerilog and Veryl. Pass --four-state to retain X/Z tracking. The internal
celox-heliodor executable is replaced by celox run.