Skip to content

docs(agent): document NEMU agent maintenance standards#1066

Open
xiaokamikami wants to merge 2 commits into
masterfrom
maint/nemu-harness
Open

docs(agent): document NEMU agent maintenance standards#1066
xiaokamikami wants to merge 2 commits into
masterfrom
maint/nemu-harness

Conversation

@xiaokamikami

Copy link
Copy Markdown
Member

This PR adds repository-local guidance for AI-assisted NEMU maintenance under agent/.

It introduces:

  • agent/skills/nemu-harness.md

    • maps NEMU harness-related entry points such as CI, ready-to-run, DiffTest, checkpoint restore, and ref-so-runner
    • defines module boundaries for keeping agent-authored commits narrow
  • agent/skills/nemu-delivery-standard.md

    • requires AI-authored commits to stay within one NEMU module unless a narrow exception is explained
    • documents the expected NEMU commit format: type(scope): intent plus Lore trailers
    • defines the expected Linux + Spike DiffTest smoke gate for execution-sensitive changes
  • agent/architecture.md

    • summarizes NEMU startup, execution, DiffTest, memory, checkpoint, device, build/config, and CI architecture
    • gives agents a first-read architecture map before editing code

This PR is documentation-only and does not change executable NEMU behavior.

Tested:

  • git diff --check

Not-tested:

  • Loading these documents through an external AI-agent runtime
  • Linux DiffTest smoke, because this PR only documents maintenance standards

@github-actions

Copy link
Copy Markdown

NEMU Performance Results - XS Interpreter

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions) Change vs Baseline (Throughput)
bitmanip.bin 1.385e+05 5.189e+07 2.669e+07 2.898e+07 5.189e+07 3.107e+07 -0.00% -6.74%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 1.752e+08 1.914e+08 1.851e+08 1.752e+08 1.831e+08 +0.00% +1.10%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 1.747e+08 1.943e+08 1.876e+08 1.747e+08 1.908e+08 -0.00% -1.65%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 1.718e+08 1.766e+08 1.801e+08 1.718e+08 1.736e+08 +0.00% +3.74%
amtest-riscv64-xs.bin 1.587e+04 8.704e+06 1.823e+07 1.503e+07 8.702e+06 1.869e+07 -0.03% -19.60%
aliastest-riscv64-xs.bin 1.376e+03 7.704e+06 1.786e+06 5.931e+06 7.704e+06 3.965e+06 +0.00% +49.57%
softprefetchtest-riscv64-xs.bin 2.643e+03 7.752e+06 3.410e+06 5.900e+06 7.752e+06 1.001e+07 +0.00% -41.07%
zacas-riscv64-xs.bin 6.470e+04 1.222e+07 5.296e+07 1.968e+07 1.222e+07 2.040e+07 +0.00% -3.53%
linux-hello 7.545e+07 1.882e+10 4.010e+07 4.459e+07 1.882e+10 4.449e+07 -0.00% +0.23%

NEMU Performance Results - XS Ref Shared Object

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions) Change vs Baseline (Throughput)
bitmanip.bin 1.385e+05 1.118e+09 1.239e+06 1.013e+06 1.118e+09 1.010e+06 +0.00% +0.26%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 6.961e+09 4.819e+06 3.664e+06 6.961e+09 3.743e+06 +0.00% -2.13%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 6.996e+09 4.852e+06 3.716e+06 6.996e+09 3.838e+06 -0.00% -3.17%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 6.555e+09 4.630e+06 3.645e+06 6.555e+09 3.458e+06 -0.00% +5.40%
amtest-riscv64-xs.bin 1.588e+04 3.707e+07 4.283e+06 1.648e+06 3.707e+07 1.668e+06 -0.00% -1.20%
aliastest-riscv64-xs.bin 1.379e+03 5.088e+06 2.710e+06 7.029e+05 5.087e+06 9.267e+05 -0.00% -24.16%
softprefetchtest-riscv64-xs.bin 2.646e+03 7.392e+06 3.580e+06 1.383e+06 7.392e+06 1.214e+06 -0.00% +13.90%
zacas-riscv64-xs.bin 6.471e+04 1.399e+08 4.627e+06 1.818e+06 1.399e+08 1.900e+06 -0.00% -4.31%
linux-hello 7.522e+07 6.802e+11 1.106e+06 1.076e+06 6.802e+11 1.062e+06 -0.00% +1.32%
  • Host Instructions is measured by DynamoRIO's inscount client.
  • Estimated Host Throughput assumes a fixed 4GHz CPU and IPC=2.5.
  • Actual NEMU Throughput is a single native NEMU run and may vary with host CPU performance.
  • Baseline columns are populated on pull_request runs when the PR base contains the same defconfig.
  • Change vs Baseline (Instructions) is computed from host instruction count; positive means fewer host instructions than baseline.
  • Change vs Baseline (Throughput) is computed from native throughput; positive means faster than baseline.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

NEMU Performance Results - XS Interpreter

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions)
bitmanip.bin 1.385e+05 5.199e+07 2.664e+07 2.553e+07 5.199e+07 3.048e+07 -0.00%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 1.783e+08 1.881e+08 1.600e+08 1.783e+08 1.765e+08 +0.00%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 1.777e+08 1.910e+08 1.661e+08 1.777e+08 1.309e+08 +0.00%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 1.749e+08 1.735e+08 1.589e+08 1.749e+08 1.071e+08 +0.00%
amtest-riscv64-xs.bin 1.587e+04 8.738e+06 1.816e+07 1.936e+07 8.738e+06 1.286e+07 -0.00%
aliastest-riscv64-xs.bin 1.376e+03 7.715e+06 1.784e+06 3.127e+06 7.715e+06 2.709e+06 +0.00%
softprefetchtest-riscv64-xs.bin 2.643e+03 7.765e+06 3.404e+06 6.104e+06 7.765e+06 4.823e+06 -0.00%
zacas-riscv64-xs.bin 6.470e+04 1.234e+07 5.245e+07 1.114e+07 1.233e+07 1.906e+07 -0.02%
rvv-workload-suite 4.566e+04 1.081e+08 4.224e+06 5.060e+06 1.081e+08 4.277e+06 -0.00%
linux-hello 6.677e+07 1.682e+10 3.971e+07 4.868e+07 1.682e+10 4.845e+07 +0.01%

NEMU Performance Results - XS Ref Shared Object

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions)
bitmanip.bin 1.385e+05 1.094e+09 1.266e+06 7.199e+05 1.094e+09 7.168e+05 +0.00%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 6.387e+09 5.252e+06 3.288e+06 6.387e+09 3.356e+06 -0.00%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 6.415e+09 5.291e+06 3.370e+06 6.415e+09 4.693e+06 -0.00%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 6.036e+09 5.028e+06 3.337e+06 6.036e+09 3.217e+06 -0.00%
amtest-riscv64-xs.bin 1.588e+04 3.435e+07 4.621e+06 1.877e+06 3.435e+07 1.605e+06 +0.00%
aliastest-riscv64-xs.bin 1.379e+03 4.851e+06 2.843e+06 6.595e+05 4.851e+06 6.944e+05 -0.00%
softprefetchtest-riscv64-xs.bin 2.646e+03 6.939e+06 3.813e+06 9.962e+05 6.939e+06 1.183e+06 -0.00%
zacas-riscv64-xs.bin 6.471e+04 1.288e+08 5.024e+06 2.069e+06 1.288e+08 2.001e+06 -0.00%
rvv-workload-suite 4.568e+04 4.298e+08 1.063e+06 5.514e+05 4.298e+08 5.980e+05 -0.00%
linux-hello 7.522e+07 6.673e+11 1.127e+06 1.100e+06 6.673e+11 1.033e+06 -0.00%
  • Host Instructions is measured by DynamoRIO's inscount client.
  • Estimated Host Throughput assumes a fixed 4GHz CPU and IPC=2.5.
  • Actual NEMU Throughput is a single native NEMU run and may vary with host CPU performance.
  • Baseline columns are populated on pull_request runs when the PR base contains the same defconfig.
  • Change vs Baseline (Instructions) is computed from host instruction count; positive means fewer host instructions than baseline.

Module: docs-only / agent. This commit adds repository-local agent skills that describe NEMU harness maintenance, module boundaries, commit format, and delivery gates without changing executable NEMU behavior.

Constraint: NEMU needs repository-local maintenance guidance for AI agents without using Codex-specific .codex directories.

Constraint: AI-authored commits must use NEMU's existing Conventional Commit title style plus Lore trailers, and must stay inside one NEMU module boundary unless the body explains a narrow exception.

Constraint: AI-maintained NEMU changes that can affect execution must prove local NEMU-as-DUT Linux execution under Spike DiffTest before full handoff.

Rejected: Storing the harness skill under .codex | the repository should keep agent assets in an explicit project-owned directory.

Rejected: Multi-module AI commits by default | they make review, revert, and regression isolation too hard for NEMU's architecture.

Rejected: Treating syntax/build checks as sufficient delivery evidence for execution-sensitive changes | they do not prove NEMU can still boot Linux under Spike DiffTest.

Confidence: medium

Scope-risk: narrow

Directive: Keep agent/ focused on agent-facing workflows, module boundaries, commit standards, and validation guidance; do not mix it with generated local IDE or Codex runtime state.

Tested: git diff --check.

Not-tested: Loading these skills through an external AI-agent runtime; running the required Linux DiffTest smoke, because this commit only documents the standard.
Module: docs-only / agent. This commit adds a repository-local software architecture map for AI agents and links the existing skills to it, without changing executable NEMU behavior.

Constraint: Agent guidance should improve architectural understanding through documentation rather than hard-gating maintenance with scripts.

Constraint: The architecture map must be broad enough to classify module ownership and validation impact before editing NEMU code.

Rejected: Adding script-based enforcement for now | the requested direction is documentation guidance, not hard local gates.

Confidence: medium

Scope-risk: narrow

Directive: Keep agent/architecture.md as the first-read map for future agent changes; update it when module boundaries or major execution flows change.

Tested: git diff --check.

Not-tested: Loading this architecture document through an external AI-agent runtime.
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

NEMU Performance Results - XS Interpreter

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions)
bitmanip.bin 1.385e+05 5.747e+07 2.410e+07 2.298e+07 5.748e+07 2.590e+07 +0.00%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 1.946e+08 1.723e+08 1.561e+08 1.946e+08 1.679e+08 +0.00%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 1.940e+08 1.750e+08 1.633e+08 1.940e+08 1.061e+08 +0.00%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 1.911e+08 1.588e+08 1.256e+08 1.911e+08 1.487e+08 -0.00%
amtest-riscv64-xs.bin 1.587e+04 8.830e+06 1.798e+07 1.856e+07 8.830e+06 1.721e+07 +0.00%
aliastest-riscv64-xs.bin 1.376e+03 7.730e+06 1.780e+06 2.377e+06 7.730e+06 4.260e+06 -0.00%
softprefetchtest-riscv64-xs.bin 2.643e+03 7.783e+06 3.396e+06 5.660e+06 7.783e+06 5.966e+06 -0.00%
zacas-riscv64-xs.bin 6.470e+04 1.266e+07 5.110e+07 1.881e+07 1.266e+07 1.092e+07 -0.00%
rvv-workload-suite 4.566e+04 1.112e+08 4.107e+06 4.798e+06 1.112e+08 4.676e+06 +0.01%
linux-hello 6.677e+07 1.690e+10 3.951e+07 4.725e+07 1.690e+10 4.739e+07 +0.00%

NEMU Performance Results - XS Ref Shared Object

Test Guest Instructions Host Instructions Estimated Host Throughput (instr/s) Actual NEMU Throughput (instr/s) Baseline Host Instructions Baseline Actual NEMU Throughput (instr/s) Change vs Baseline (Instructions)
bitmanip.bin 1.385e+05 1.097e+09 1.262e+06 1.054e+06 1.097e+09 1.059e+06 +0.00%
coremark-riscv64-xs-rv64gc-o2.bin 3.354e+06 6.447e+09 5.203e+06 4.541e+06 6.447e+09 4.615e+06 -0.00%
coremark-riscv64-xs-rv64gc-o3.bin 3.394e+06 6.475e+09 5.242e+06 4.679e+06 6.475e+09 4.453e+06 -0.00%
coremark-riscv64-xs-rv64gcb-o3.bin 3.035e+06 6.090e+09 4.983e+06 4.468e+06 6.090e+09 4.483e+06 -0.00%
amtest-riscv64-xs.bin 1.588e+04 3.464e+07 4.583e+06 1.955e+06 3.464e+07 1.804e+06 +0.00%
aliastest-riscv64-xs.bin 1.379e+03 4.877e+06 2.828e+06 7.631e+05 4.877e+06 6.944e+05 +0.00%
softprefetchtest-riscv64-xs.bin 2.646e+03 6.987e+06 3.787e+06 1.281e+06 6.987e+06 8.885e+05 -0.00%
zacas-riscv64-xs.bin 6.471e+04 1.300e+08 4.979e+06 2.050e+06 1.300e+08 1.954e+06 -0.00%
rvv-workload-suite 4.568e+04 4.311e+08 1.060e+06 6.297e+05 4.311e+08 6.288e+05 -0.00%
linux-hello 7.522e+07 6.683e+11 1.125e+06 1.130e+06 6.683e+11 1.124e+06 -0.00%
  • Host Instructions is measured by DynamoRIO's inscount client.
  • Estimated Host Throughput assumes a fixed 4GHz CPU and IPC=2.5.
  • Actual NEMU Throughput is a single native NEMU run and may vary with host CPU performance.
  • Baseline columns are populated on pull_request runs when the PR base contains the same defconfig.
  • Change vs Baseline (Instructions) is computed from host instruction count; positive means fewer host instructions than baseline.

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.

1 participant