21 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 5626ba6e6a ci: fix the gate to assert the code, not the runner image
kv named the wrong server binary (kv-server, not valkey-server) and assumed a C
compiler the reusable installs only for Go callers; forum assumed a ruby the
reusable never provisions; rocm-rs left gpu-sort on, whose nested nightly
build-std step no stock runner can do; insights-rs asked for --all-features,
which selects the live-endpoint e2e feature.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-06 02:39:59 -07:00
zeekayandHanzo Dev 9260fbc462 ci: canonical pair — hanzo.yml + forge caller
github.com has no runner for hanzo-build-linux-amd64, so a caller under
.github/workflows is a gate that can never be scheduled. This is the ~7-line
caller on the plane that can (git.hanzo.ai git-runner fleet), pinned @v1.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-06 02:34:31 -07:00
zeekay e3ef8555b3 merge(refactor/bindgen-ffi-types): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 6203990209 merge(pr/gpu-sort-feature-gate): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay e6f055012c merge(fix/windows-msvc-abi-enum-types): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 6e1a1e4774 merge(fix/edition-2024-unsafe-fn): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay d7a8cdfbab merge(chore/fork-hygiene-notice): consolidate onto master 2026-07-21 17:18:53 -07:00
zeekay 743194fdfc chore(notice): add rocm-rs provenance and deviations 2026-07-13 16:07:41 -07:00
zeekay 92e1a4c3eb chore: OSS attribution — rocm-rs (MIT) LICENSE + NOTICE 2026-07-02 12:46:26 -07:00
zeekay a04acd2a14 docs(brand): add hero banner 2026-06-28 20:11:54 -07:00
zeekay e5321a64e1 chore(brand): dynamic hero banner 2026-06-28 20:11:53 -07:00
zeekay 62c171b688 refactor: use bindgen FFI status/enum types instead of hardcoded u32
Return/param sites used literal u32 where bindgen emits typed aliases
(rocblas_status, rocrand_rng_type, rocfft_status). No-op on Linux where the
alias is u32; correct on the native Windows/MSVC ABI where it is i32. Public
Error types stay byte-identical via explicit 'as u32'.
2026-06-24 17:37:54 +00:00
zeekay 7b0b2f9438 fix: wrap rocblas wrapper bodies in unsafe blocks for edition 2024
Edition 2024 promotes unsafe_op_in_unsafe_fn to deny-by-default; the rocblas
level1/2/3 forwarders call FFI without an explicit unsafe block (hard E0133 on
MSVC). Wrap the bodies; no behavior change on any platform.
2026-06-24 17:37:53 +00:00
zeekay aa047ca41c feat: gate amdgcn GPU-sort kernel behind default-on 'gpu-sort' feature
The kernel is built at compile time by the external amdgpu_kernel_finalize!
proc-macro via a nested nightly+build-std cargo build, which drops off nightly
on Windows/MSVC (E0463 can't find crate for core). GPU sort is unused by
inference, so gating the kernel (empty fallback) lets the crate build on every
host while keeping it default-on. No call sites change.
2026-06-24 17:37:52 +00:00
zeekay 5c8c10dbd2 Use bindgen enum/status types for native Windows (MSVC) ABI
C enums whose values are all non-negative are compiled as unsigned int
(u32) by GCC/Clang on Linux but as signed int (i32) by MSVC on Windows.
bindgen follows the platform ABI, so every generated status/enum alias
(rocblas_status, rocrand_status, rocrand_rng_type, rocrand_ordering,
rocfft_status_e, rocfft_transform_type, ...) is u32 on Linux and i32 on
Windows. The crate hardcoded a literal u32 at FFI return types,
Error::new sites, and enum-typed parameters, which produced ~50
error[E0308] 'expected u32, found i32' on a native MSVC build while
building fine on Linux.

Fix: reference the bindgen-generated type instead of a literal u32
(ffi::rocblas_status, bindings::rocrand_rng_type, ...). This is a no-op
on Linux (the alias is u32 there) and correct on MSVC. Error variants
that store the raw code keep an explicit 'as u32' so the public Error
type is identical across platforms.

Also wrap the thin rocBLAS level1/2/3 'pub unsafe fn' forwarders' calls
to their unsafe trait methods in 'unsafe { }' blocks. The crate is
edition 2024, where unsafe_op_in_unsafe_fn is deny-by-default; MSVC
enforced it as a hard error[E0133] (17 sites). The wrap is identical on
both platforms and is arguably a correctness fix Linux should enforce too.

Generated bindings.rs is intentionally not included (it is a per-toolchain
build artifact regenerated by bindgen against the locally-installed ROCm
headers).

Verified: 'cargo check' reaches Finished on Linux for both
--no-default-features --features macros and default features (proving the
type changes are no-ops there); the downstream consumer builds and runs on
native Windows/MSVC with ROCm 7.13 (gfx1151).
2026-06-22 21:46:27 -07:00
zeekay 8b99dfa648 rename crate rocm-rs -> hanzo-rocm; publish to crates.io 0.5.2
Publish the Windows/MSVC-portable fork as a first-class crate (hanzo-rocm) so
downstream depends on a proper crates.io crate instead of a git patch. Examples
alias the package (their code still uses rocm_rs::).
2026-06-22 17:29:03 -07:00
zeekay 27c2459d3c release v0.5.2: native Windows/MSVC support + upstream PR notes
Bump 0.5.1 -> 0.5.2. Adds UPSTREAM_PR_NOTES.md documenting the MSVC
portability fixes (enum signedness, edition-2024 unsafe, gated amdgcn
GPU-sort kernel) for a future PR to RustNSparks/rocm-rs.
2026-06-22 15:39:04 -07:00
zeekay 3089482c2d rocrand/rocarray: bindgen enum types for Windows ABI; edition-2024 unsafe blocks in rocblas wrappers
Windows/MSVC bindgen emits C enums with only non-negative values as
signed c_int (i32) where Linux GCC/Clang emit c_uint (u32). Two classes
of failure surfaced only on the MSVC build:

E0308 (enum signedness, 31 sites, all in rocrand):
- rocrand/mod.rs: rng_type, ordering, direction_vector_set constants
  were hand-typed "u32"; retype to the exact bindgen aliases
  rocrand_rng_type / rocrand_ordering / rocrand_direction_vector_set.
- rocrand/generator.rs: PseudoRng::new/new_host and QuasiRng::new take
  rocrand_rng_type; Generator::set_ordering takes rocrand_ordering.
- rocarray/random.rs: RandomUtils::seeded_generator rng_type param
  follows PseudoRng::new (rocrand_rng_type).
These are no-ops on Linux (c_uint == u32) and correct on MSVC (i32).

E0133 (edition 2024 unsafe_op_in_unsafe_fn, 17 sites): the rocblas
level1/2/3 thin forwarders are "pub unsafe fn" but called their unsafe
trait method with no "unsafe { }" block. MSVC denies this lint as a hard
error; wrap each forwarding call. Required identically on both platforms.

rocblas enum args (rocblas_operation/fill/side/diagonal) already convert
via From impls in types.rs and stay correct on both ABIs; rocfft enums
are already bindgen-typed. Generated bindings.rs left untouched.

Verified: cargo check Finishes on Linux for both --features macros and
default features; zero E0308, zero E0133.
2026-06-21 21:45:37 -07:00
zeekay 8e7a802800 Gate amdgcn GPU-sort kernel behind default-on 'gpu-sort' feature
The kernel is built at compile time by the external amdgpu_kernel_finalize!
proc-macro via a nested nightly+build-std cargo build; that nested build
inherits the parent rustc env and drops off nightly on Windows/MSVC
(E0463 can't find crate for core). GPU sort is unused by LLM inference, so
gating the kernel (empty fallback) lets the crate build on every host while
keeping it default-on for native Linux users.
2026-06-21 21:32:53 -07:00
zeekay 490346c497 rocrand/rocfft: use bindgen status/enum types, not hardcoded u32
C enums with only non-negative values are unsigned int (u32) under Linux
GCC/Clang but signed int (i32) under MSVC. bindgen follows the platform ABI,
so the generated status/enum types are u32 on Linux and i32 on Windows.
Hand-coding u32 at status/enum-handling sites mismatched the bindgen type on
Windows, producing E0308 'expected u32, found i32'.

Fix is uniform: stop hardcoding u32; use the module's bindgen type. No-op on
Linux (the alias is u32 there), correct on Windows.

rocrand/error.rs:
  from_status(status: bindings::rocrand_status)   // was u32
  Unknown(other as u32)                           // keep error variant u32-stable

rocfft/error.rs:
  impl From<bindings::rocfft_status_e> for Error   // was From<u32>
  check_error(status: bindings::rocfft_status_e)   // was u32
  check_compatible_types(transform_type: rocfft_transform_type,
                         in/out_array_type: rocfft_array_type)  // was u32
  Unknown(code as u32)                             // keep error variant u32-stable

rocfft/plan.rs + rocfft/description.rs:
  From<TransformType>  for rocfft_transform_type     // was for u32
  From<Precision>      for rocfft_precision          // (enum-typed FFI args:
  From<PlacementType>  for rocfft_result_placement   //  the .into() targets
  From<ArrayType>      for rocfft_array_type         //  rocfft_plan_create etc.
  From<CommType>       for rocfft_comm_type          //  expect the enum type)

rocsparse/rocarray/hip already used bindgen types (or genuine u32 flags/dims/
counts) and need no change. Verified: cargo check --no-default-features
--features macros reaches Finished on Linux (ROCm 7.13).
2026-06-21 21:21:56 -07:00
zeekay 69577a9110 rocblas: use ffi::rocblas_status return type, not hardcoded u32
MSVC compiles the rocblas_status enum as signed int (i32); GCC/Clang on Linux
make the all-positive enum u32. Hardcoding -> u32 in the FFI fn-pointer type
broke native-Windows builds (136 E0308 mismatches vs Error::new(ffi::rocblas_status)).
Referencing the bindgen-generated type is a no-op on Linux and correct on Windows.
2026-06-21 21:02:25 -07:00