chore: remove native extension-specific code#2590
chore: remove native extension-specific code#2590stephenh-axiom-xyz merged 3 commits intodevelop-v2.0.0-betafrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Claude finished @stephenh-axiom-xyz's task in 1m 54s —— View job
Code Review: Remove Native Extension-Specific CodeThis is a thorough and well-structured removal of dead code. The changes are consistent across Rust, CUDA, guest, and transpiler layers. A few items to consider: Issues1. Dead
2. Stale Now that
Since stores are now always 3. Stale comment in
4. AOT In Looks Good
|
Resolves INT-6435. Documentation update will be part of a larger change.
Summary
Remove remaining code-level references to the Native extension, which was deleted in an earlier commit (
4d54346f6). This cleans up leftover Native-specific APIs, types, and helper code that are no longer used now that the deferral extension handles the deferral address space directly.1. Remove KvStore and hint-load-by-key
KvStoretrait and itsHashMapimpl fromStreams(crates/vm/src/arch/vm.rs)kv_storefield fromStreamsandStdIn, along withadd_key_valuehelper (crates/sdk/src/stdin.rs)Rv32HintLoadByKeySubExphantom sub-executor and its encode/decode helpers (extensions/rv32im/circuit/src/extension/mod.rs)HintLoadByKeyvariant fromPhantomImmenum andRv32Phantomenum (extensions/rv32im/guest/src/lib.rs,extensions/rv32im/transpiler/src/instructions.rs)hint_load_by_keyguest intrinsic (extensions/rv32im/guest/src/io.rs) and its re-export (crates/toolchain/openvm/src/io/mod.rs)PhantomImm::HintLoadByKey(extensions/rv32im/transpiler/src/lib.rs)hint_load_by_keyexample program and its integration test (extensions/rv32im/tests/)2. Remove native store-to-deferral-AS from rv32im loadstore
NATIVE_STOREW_FUNCT3,NATIVE_STOREW_FUNCT7constants andstore_to_native!macro from guest (extensions/rv32im/guest/src/lib.rs,extensions/rv32im/guest/src/io.rs)store_u32_to_nativewrapper (crates/toolchain/openvm/src/io/mod.rs)NATIVE_STOREW_FUNCT3R-type instruction (extensions/rv32im/transpiler/src/lib.rs)DEFERRAL_ASas an invalid address space in loadstore execution and trace generation, rather than handling it as a special case (extensions/rv32im/circuit/src/loadstore/execution.rs,extensions/rv32im/circuit/src/adapters/loadstore.rs)is_native_storevariable and allF-typed (field-element) store dispatch branches from the loadstore executor; stores are now alwaysU8-typed (extensions/rv32im/circuit/src/loadstore/execution.rs)is_aot_supportednow unconditionally returnstrue; deleteis_aot_supported_implwhich checked for deferral-AS stores (extensions/rv32im/circuit/src/loadstore/aot.rs)3. Move deferral memory helpers from rv32im to deferral crate
extensions/rv32im/circuit/src/adapters/deferral.rs(199 lines) and its re-exportextensions/deferral/circuit/src/adapters.rswith the subset of helpers still needed:memory_read_deferral,memory_write_deferral,timed_read_deferral,timed_write_deferral,tracing_read_deferral,tracing_write_deferralmemory_read_or_imm_deferral,*_from_state,tracing_read_or_imm_deferral,tracing_write_deferral_inplace) are droppedextensions/deferral/circuit/src/call/trace.rs4. Rename
Nativeterminology in types and commentsMemoryCellType::Native { size }->MemoryCellType::F { size }andnative32()->field32()(crates/vm/src/arch/config.rs+ all match sites)DEFAULT_NATIVE_BLOCK_SIZE->DEFAULT_FIELD_BLOCK_SIZEMemoryConfig::aggregation()(only used for native-extension testing) andVmChipTestBuilder::default_native()5. Delete CUDA native adapter
crates/vm/cuda/include/system/native_adapter.cuhnative::C++ namespace fromcrates/circuits/primitives/cuda/include/primitives/constants.hextensions/rv32im/circuit/cuda/src/loadstore.cu