OpenParable
Skip to content
← Back to skills

Check Parity

Testing & Quality
check-parity

Check Parity is an Agent Skill for testing & quality published in the sebastianbiallas/pearpc repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Check that aarch64 JIT interpreter functions match generic CPU behavior

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/sebastianbiallas/pearpc/blob/HEAD/.claude/skills/check-parity/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/check-parity, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Check Interpreter Parity

Run the interpreter parity check and analyze results. If an opcode name is given, show a side-by-side diff for that specific opcode.

Steps

  1. Always run the stub audit first — this catches no-op stubs (the #1 bug source):

    python3 scripts/debug/stub_audit.py $ARGUMENTS
    

    If an opcode name was given, this shows a side-by-side generic vs JIT diff. If no arguments, it scans all functions and reports no-op stubs.

  2. Run ./scripts/debug/check_interpreter_parity.sh

  3. For any issues found:

    • Commented-out ppc_exception(): These are bugs. The exception is silently dropped. Enable the call.
    • GEN_INTERPRET with ppc_exception(): The exception will be silently dropped because GEN_INTERPRET doesn't check exception_pending. Need native gen_ function or change to GEN_INTERPRET_BRANCH/ENDBLOCK (but ENDBLOCK also doesn't work for synchronous exceptions — see doc/AGENT_DEBUGGING.md).
    • Missing MSR_POW handling: Must strip POW bit in ppc_set_msr().
  4. For each GEN_INTERPRET warning, check the x86 JIT (src/cpu/cpu_jitc_x86/ppc_opc.cc) to see how it handles the same opcode. The x86 JIT is the reference for how gen_ functions should work.

Critical rule

GEN_INTERPRET CANNOT dispatch synchronous exceptions. The only correct approaches are:

  • Native gen_ that jumps directly to ppc_program_exception_asm (like x86 JIT does)
  • GEN_INTERPRET_BRANCH which dispatches to npc (works but forces a dispatch on every call)