Repository navigation
fix(rocke): core dtype review follow-ups: uitofp_f32 source check and native test fixtures in every lane - #14050
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
|
Automated review: Model - qwen3.6:35b-a3b-coding-mtp-q4_K_M, effort: max PR #14050 — core dtype review follow-ups: uitofp_f32 source check and native test fixtures — 🟠 Not merge-ready: rebase required (code sound)
Checked and cleared (not findings): Utility: 🟢 Positive — closes a real IR type-safety gap (u8-only Legend: 🔴 blocking · 🟠 should-fix · 🟡 minor nit · 🟢 info/good · ⚪ retracted First-round review: a local qwen3.6 model made the independent first pass; the orchestrator (Claude Opus 4.8) verified it on hardware — native build, conflict analysis, and regression-vs-environment checks — and owns this merge-worthiness call. It flags whether a closer look is needed; it is not an approval or a rejection. |
CongMa13
left a comment
There was a problem hiding this comment.
No new P0 or P1 issues were identified during this review. The changes are approved.
The uitofp_f32 builder accepts only a u8 input, but IR that did not come through the builder (assembled by hand, or deserialized and retyped) could carry another source type. The lowerings would then disagree: LLVM's uitofp reads an i8 0xff as 255.0, while the HIP cast of an int8_t reads it as -1.0. The Python and C++ LLVM and HIP lowerings now refuse such an op with one message, "arith.uitofp_f32 expects a u8 source, got <type>", from a shared check in each engine. A test lowers a serialized kernel retyped from u8 to i8 through every lowering of both engines and expects that refusal. The u8 path lowers unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
Several pytest files compare the Python engine with a native C++ test binary named by an environment variable (ROCKE_STORAGE_TEST, ROCKE_IR_TYPES_TEST, ROCKE_NONTEMPORAL_HIP_TEST, ROCKE_UNSIGNED_INT_OPS_CLI, ROCKE_ARCH_TARGET_TEST_EXE) and skip without it. tests/run_all.py set all but the target identity one for a source build, and the installed rocke_pytest CTest entry set only ROCKE_UNSIGNED_INT_OPS_CLI, so the other parity cases skipped in the installed test tree, and the target identity comparison skipped everywhere. tests/run_all.py now also resolves ROCKE_ARCH_TARGET_TEST_EXE from the rocke_arch_target_identity CTest entry. The rocke_pytest entry points each of the five variables at its installed binary, for every one that is built and installed, in both the provider and the standalone install layouts, from one list that replaces the entry's separate ROCKE_UNSIGNED_INT_OPS_CLI handling. A comment beside run_all.py's list says the installed entry carries the same variables. Co-Authored-By: Claude <noreply@anthropic.com>
…oth engines The C++ engine keeps a hand-written copy of arch_specs.json's generic_targets table. The test comparing C++ target identity with Python fed it only a sample of target names, so a member missing from, or misspelled in, the C++ copy could go unnoticed. The test now also feeds every generic processor and every member read from arch_specs.json, in all the prefix, profile and feature forms it already uses, so each member must resolve to the same catalog row and generic processor in both engines. Co-Authored-By: Claude <noreply@anthropic.com>
a8d6c4f to
d9e8bbc
Compare
|
|
Automated review: Model - qwen3.6:35b-a3b-coding-mtp-q4_K_M, effort: max PR #14050 — core dtype review follow-ups: uitofp_f32 source check and native test fixtures — 🟢 Follow-up: no closer look needed — rebase resolved correctly; the installed lane now runs 127 parity cases it used to skip
Utility: 🟢 Positive — closes the u8-only Legend: 🔴 blocking · 🟠 should-fix · 🟡 minor nit · 🟢 info/good · ⚪ retracted Follow-up review: a local qwen3.6 model made the independent first pass. The orchestrator (Claude Opus 5.5) verified it with a range-diff against the reviewed head, an installed-tree build and run on the merge against develop, the native build and tests, the golden gate, and a scratch merge with #13886, and owns this merge-worthiness call. It flags whether a closer look is needed; it is not an approval or a rejection. |
TheRock Submodule Bump ActivityNewest first
|
Motivation
Follow-ups from the review of the core dtype PR.
arith.uitofp_f32was checked only by its builder, which accepts only a u8 input. IR that did not come through the builder (assembled by hand, or deserialized and retyped u8 -> i8) passed through and lowered differently per backend: LLVM'suitofp i8reads 0xff as 255.0, while the HIP lowering'sint8_tcast reads it as -1.0.rocke_pytestCTest entry set only one of the native C++ parity fixtures thattests/run_all.pysets for a source build (ROCKE_UNSIGNED_INT_OPS_CLI), notROCKE_STORAGE_TEST,ROCKE_IR_TYPES_TESTorROCKE_NONTEMPORAL_HIP_TEST, so those native parity cases skipped in the installed test tree that CI runs.ROCKE_ARCH_TARGET_TEST_EXEwas set by neither, so the C++/Python target identity comparison skipped everywhere.generic_targets, and that comparison fed it only a sample of target names, so a member missing from or misspelled in the C++ copy could go unnoticed.ISSUE ID : AICK-2667
Technical Details
Three commits.
fix)arith.uitofp_f32whose source is not a u8 scalar: the Python LLVM and HIP lowerers (shared helper_refuse_non_u8_sourceincore/ir.py) and the C++ LLVM and HIP lowerers (shared helperrocke_i_refuse_non_u8_sourceincpp/core/ir/core_builder.cpp).arith.uitofp_f32 expects a u8 source, got <type>.fix)tests/run_all.py: also resolvesROCKE_ARCH_TARGET_TEST_EXEfrom therocke_arch_target_identityCTest entry; a comment beside its fixture list says the installed entry carries the same variables.platform/CMakeLists.txt: therocke_pytestentry points each of the five fixture variables at its installed binary when that binary is built and installed, relative to the CTestTestfile, in both the provider and the standalone layouts, from one list that replaces the entry's separateROCKE_UNSIGNED_INT_OPS_CLIhandling.ROCKE_REPLAY_CLIandROCKE_PROVENANCE_MANIFESTare set as before.tests/tools/test_run_all.py: covers the new variable.test)test_cpp_target_identity_matches_pythonnow also feeds every generic processor and every member read from arch_specs.json (in all its prefix, profile and feature forms), so each must resolve to the same catalog row and generic processor in both engines.Test Plan
tests/core/test_u8_arith.py::test_lowerings_refuse_uitofp_of_a_non_u8_source: a real u8 kernel, serialized, retyped to i8 and parsed back, is refused with the message by the LLVM and HIP lowerings of both engines.rocke_pytestCTest entry with and without the new variables and compare per-case results.Test Result
rocke_pytest: the storage, IR type, nontemporal HIP and target identity native parity cases went from skipped to passed, the same set in both layouts; no case changed state otherwise.rocke_pytestentry in both layouts.ROCKE_BACKEND=both ROCKE_CPP_STRICT=1; full platform suite passes with no failures; pre-commit passes.Submission Checklist
🤖 Generated with Claude Code