name: wai-quantum-landscape-fpga reference design # The FPGA board's member of energy-landscape jobs (wai/wai-quantum-landscape-fpga): its unit tests and # clippy, warnings as errors; the member certified on the model of the logic (src/model.rs) and every # check of the conformance set, every worked example and the joint-statistics test run on it; the # board's code built and tested on the board's processor's architecture (aarch64, linux-arm64), # where its cache maintenance compiles; # and the logic itself: both testbenches replay the model's session against the RTL in an # open-source simulator, every read checked. No board and no vendor tool here: the board's own runs # are in the crate's measurements and README. # # Push filters match the push's delta, so every path the jobs read is listed. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }} cancel-in-progress: true on: push: branches: [main] paths: - 'wai/wai-quantum-landscape-fpga/**' - 'wai/wai-quantum/src/quantum_landscape/**' - 'wai/wai-quantum/src/quantum_landscape.rs' - 'wai/wai-quantum/src/repro.rs' - 'wai/wai-quantum/Cargo.toml' - 'wai/quantum-conformance/landscape/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-landscape-fpga.yml' pull_request: paths: - 'wai/wai-quantum-landscape-fpga/**' - 'wai/wai-quantum/src/quantum_landscape/**' - 'wai/wai-quantum/src/quantum_landscape.rs' - 'wai/wai-quantum/src/repro.rs' - 'wai/wai-quantum/Cargo.toml' - 'wai/quantum-conformance/landscape/**' - 'rust-toolchain.toml' - '.github/workflows/wai-quantum-landscape-fpga.yml' jobs: relevant: name: does this change touch it runs-on: gate outputs: run: ${{ steps.gate.outputs.run }} steps: - uses: actions/checkout@v5 with: fetch-depth: 0 - id: gate run: | set -euo pipefail r=$(python3 scripts/pr-touches-paths.py .github/workflows/wai-quantum-landscape-fpga.yml \ "${{ github.event.pull_request.base.sha }}" \ "${{ github.event.pull_request.head.sha }}") echo "this change touches wai-quantum-landscape-fpga: $r" echo "run=$r" >> "$GITHUB_OUTPUT" model: name: the member against the model of the logic, and the logic against the model · linux, release needs: relevant if: needs.relevant.outputs.run == 'true' runs-on: linux timeout-minutes: 60 steps: - uses: actions/checkout@v5 - name: Install Rust 1.99.1 and the simulator shell: bash run: | export PATH="$HOME/.cargo/bin:$PATH" command -v rustup >/dev/null 2>&1 || \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1 rustup toolchain install 1.99.1 --profile minimal --component clippy rustup default 1.99.1 echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" SUDO=""; [ "$(id -u)" -ne 0 ] && SUDO="sudo" command -v iverilog >/dev/null || { $SUDO apt-get update -qq; $SUDO apt-get install -y -qq iverilog; } - name: Unit tests and clippy shell: bash working-directory: wai/wai-quantum-landscape-fpga run: | set -euo pipefail cargo test --locked --release 2>&1 | tee "$RUNNER_TEMP/test.log" grep -qE '^test result: ok\. [1-9][0-9]* passed; 0 failed' "$RUNNER_TEMP/test.log" || { echo "::error::no test ran"; exit 1; } cargo clippy --locked --release --all-targets -- -D warnings # Every case the engine holds must give the reference's bits and every one it cannot must be # refused (the checks); the host's certification is printed, whatever it is: under the set # as it stands, cases beyond the engine's 64 cells cost it its certificate (README). - name: The member certified, the conformance set and the worked examples, on the model shell: bash working-directory: wai/wai-quantum-landscape-fpga run: | set -euo pipefail cargo run --locked --release -- selftest --scale 0.05 --seeds 5 | tee "$RUNNER_TEMP/selftest.log" grep -q 'certified by the host on the conformance set, within its declared capacity: settle ' "$RUNNER_TEMP/selftest.log" grep -qE '^settle cases within its declared capacity: ([0-9]+)/\1 bit for bit' "$RUNNER_TEMP/selftest.log" grep -qE '^chains within its declared capacity: ([0-9]+)/\1 bit for bit' "$RUNNER_TEMP/selftest.log" grep -qE '^[0-9]+ checks, 0 failed$' "$RUNNER_TEMP/selftest.log" - name: A job on the model, certified and sealed, with the reference's answer shell: bash working-directory: wai/wai-quantum-landscape-fpga run: | set -euo pipefail printf '{"program": "vars 2\\noppose 0 1\\nsolve\\n", "seed": "7"}' | cargo run --locked --release -- landscape run - --model --demo-key > "$RUNNER_TEMP/job.json" grep -q '"id": "fpga:model-landscape-64"' "$RUNNER_TEMP/job.json" grep -q '"state": "-+"' "$RUNNER_TEMP/job.json" - name: Joint statistics against exact enumeration, on the model shell: bash working-directory: wai/wai-quantum-landscape-fpga run: | set -euo pipefail cargo run --locked --release -- joint --model --scale 0.05 | tee "$RUNNER_TEMP/joint.log" grep -qE '^[0-9]+ checks, 0 failed$' "$RUNNER_TEMP/joint.log" - name: The logic against the model, both testbenches shell: bash working-directory: wai/wai-quantum-landscape-fpga run: sh scripts/run_tb.sh both board-target: name: the board's code on the board's processor's architecture · linux-arm64, release needs: relevant if: needs.relevant.outputs.run == 'true' runs-on: linux-arm64 timeout-minutes: 60 steps: - uses: actions/checkout@v5 - name: Install Rust 1.99.1 shell: bash run: | export PATH="$HOME/.cargo/bin:$PATH" command -v rustup >/dev/null 2>&1 || \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1 rustup toolchain install 1.99.1 --profile minimal --component clippy rustup default 1.99.1 echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" # The cache maintenance the DMA needs (dc cvac, dc civac, dsb) compiles only for aarch64. - name: Unit tests and clippy shell: bash working-directory: wai/wai-quantum-landscape-fpga run: | set -euo pipefail cargo test --locked --release 2>&1 | tee "$RUNNER_TEMP/test.log" grep -qE '^test result: ok\. [1-9][0-9]* passed; 0 failed' "$RUNNER_TEMP/test.log" || { echo "::error::no test ran"; exit 1; } cargo clippy --locked --release --all-targets -- -D warnings