Skip to content

[CI] Fix integer widening (Spike v1.0.2) + regression test#268

Open
YWHyuk wants to merge 2 commits into
developfrom
test/widen-dtype-regression
Open

[CI] Fix integer widening (Spike v1.0.2) + regression test#268
YWHyuk wants to merge 2 commits into
developfrom
test/widen-dtype-regression

Conversation

@YWHyuk

@YWHyuk YWHyuk commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Fixes integer widening dtype conversions (int8/int16 -> wider via tensor.to), which were silently scrambled/zeroed.

Root cause (Spike): widening lowers to vsext.vf*/vzext.vf* (VI_VV_EXT). Spike wrote each result via elt<T>(rd_num, i, true) -- the literal true bound to the vu_idx parameter, so every lane's result went to lane 1 and the others stayed zero. Fixed in PSAL-POSTECH/riscv-isa-sim#4 (released as v1.0.2).

This PR:

  • tests/ops/misc/test_widen_dtype.py -- regression test (int8/int16 + uint8<128 widening; signed/small-unsigned so it is independent of the separate uint8->int8 issue [Bug][Frontend] uint8 and bool dtypes silently downcast to int8 via MLIR_TO_DTYPE round-trip #238).
  • Bump the Spike pin v1.0.1 -> v1.0.2 in thirdparty/github-releases.json. The base-image pin is sha256(github-releases.json + Dockerfile.base), so ensure-base rebuilds the base with the fixed Spike automatically.
  • Add the test to the CI allowlist (pytorchsim_test.yml).

Verified locally with a Spike built from the v1.0.2 source: all widening cases go FAIL -> PASS (Spike+gem5 allclose).

🤖 Generated with Claude Code

YWHyuk and others added 2 commits June 19, 2026 17:51
Guards the Spike VI_VV_EXT (vsext/vzext) lane bug where widening int conversions
(int8/int16 -> wider via tensor.to) returned scrambled/zero output. Signed and
uint8<128 only so it is independent of the separate uint8->int8 dtype issue (#238).

Requires the riscv-isa-sim fix (PSAL-POSTECH/riscv-isa-sim#4) in the pinned Spike;
add to the CI allowlist + bump thirdparty/github-releases.json spike tag once that
release is cut.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v1.0.2 includes the riscv-isa-sim VI_VV_EXT fix (PSAL-POSTECH/riscv-isa-sim#4)
so integer widening conversions no longer scramble. Bumping the pin changes the
thirdparty base-image hash, so ensure-base rebuilds the base with the new Spike.
Wire test_widen_dtype.py into the allowlist now that the fixed Spike is pinned.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@YWHyuk YWHyuk changed the title [Test] Add integer widening dtype-conversion regression test [CI] Fix integer widening (Spike v1.0.2) + regression test Jun 19, 2026
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