Skip to content

asm_difftest: evidence for the retroactive review (#10) and the shift proposal (#11) - #30

Merged
AananthV merged 1 commit into
masterfrom
issue-10-retro-difftest
Oct 22, 2026
Merged

AananthV merged 1 commit into
masterfrom
issue-10-retro-difftest

Conversation

@AananthV

Copy link
Copy Markdown
Owner

Test harness and docs only; no compiler or trusted-base change. Part of #10 (which stays open until the owner approves) and evidence for #11.

What this adds

harness/asm_difftest/ now runs four groups: loadop, zx, cvt and shift (run.sh [TREE] [N] [SEED] [GROUPS]). Each test loads a full random register state (GPRs, all 128 bits of xmm0–15, flags), runs the exact printed sequence, and compares with the extracted Asm.exec_instr.

Results (about 20k tests per instruction, two seeds; my re-run with a third seed agrees)

  • zx group (round 1): 0 mismatches where the model is defined. The upper 32 bits are always zeroed by the hardware.
  • cvt / sqrtsd group with xor-zeroing: 0 mismatches. No other register or flag changes.
  • shift group, current model: 0 mismatches where defined. It is defined only for counts below 32 (or 64) with clean upper bits of %rcx.
  • shift group, Model x86 shift-count masking in Asm semantics #11 proposal: 0 mismatches on all 256 counts, including garbage in the upper bits of %rcx.

TRUSTED_BASE.md records this evidence under the pending retroactive review.

… %cl shifts

Adds a full-register-state harness (regs_frame.s, hw_regs.c,
check_regs.ml, gen_tests.py) to the differential test, with groups zx
(Pshrlzx_ri, Pandlzx_ri, Psallzx_ri), cvt (the printed xor + conversion
and sqrtsd sequences) and shift (the six %cl shifts, against both the
current semantics and the refinement proposed in #11).  Records the
evidence for the retroactive review (#10) in TRUSTED_BASE.md.
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