Refactor: consolidate pto_runtime_c_api.h into src/common/worker#450
Merged
ChaoWao merged 1 commit intohw-native-sys:mainfrom Apr 3, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request centralizes the loading of orchestration shared objects by introducing a platform-specific load_orch_so function and refactoring temporary file handling across the aicpu and host runtimes. Key feedback includes addressing security vulnerabilities in the onboard implementation—such as race conditions from getpid() and lack of partial write handling—removing now-redundant unlink calls in the executor, and enhancing error reporting with dlerror().
src/a2a3/runtime/tensormap_and_ringbuffer/aicpu/aicpu_executor.cpp
Outdated
Show resolved
Hide resolved
b088576 to
6912849
Compare
d1fbe92 to
215f1a3
Compare
Merge three divergent copies into one canonical header declaring all extern-C functions (public API + record_tensor_pair). Delete arch-specific copies. Add src/common/worker to cmake include path for platform builds. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
215f1a3 to
2e792e6
Compare
ChaoWao
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
pto_runtime_c_api.hheader existed in three copies with divergent content:src/common/worker/pto_runtime_c_api.h— public API only (4 dlsym'd functions)src/a2a3/platform/include/host/pto_runtime_c_api.h— full API includingrecord_tensor_pairsrc/a5/platform/include/host/pto_runtime_c_api.h— identical to a2a3This PR merges them into a single canonical header at
src/common/worker/pto_runtime_c_api.hthat declares allextern "C"functions:get_runtime_size,set_device,run_runtime,finalize_devicerecord_tensor_pairArch-specific copies deleted. All four platform
CMakeLists.txtupdated to includesrc/common/workerin the build path.Testing
python ci.py -p a2a3sim -c 6622890 -t 600 --build-runtime— 15/15 PASS