Skip to content

fix(core): close execute_op signal fence fd, enforce tensor bounds before host indexing, and avoid compounding vk caps - #47

Merged
saariuslystoned merged 1 commit into
mainfrom
fix/state-machine-freesched-core-guards
Nov 30, 2026
Merged

saariuslystoned merged 1 commit into
mainfrom
fix/state-machine-freesched-core-guards

Conversation

@saariuslystoned

Copy link
Copy Markdown
Contributor

Summary

Fixes 3 core C++ memory/resource/state-machine defects:

  • src/fs_executor.cpp: close the execute_op signal fence fd on both success and error paths (eliminating fd leak) and reject undersized reference tensors with FS_ERR_OVERFLOW before host_ptr indexing (eliminating ASan heap-buffer-overflow in fs_read_act).
  • src/fs_backend_openbuenos.cpp & src/fs_internal.h: apply the same tensor bounds check before hardware matmul/SwiGLU dispatch.
  • src/fs_topology.cpp: apply fs_topology_apply_vk_caps against the profile GPU baseline so repeated invocations do not compound FP16 peak or no-DMA-BUF handoff penalties (first apply behavior unchanged).

Proof

  • Added standalone host regression test tests/test_core_state_machine_guards.cpp:
    • Base (-fsanitize=address,undefined -Werror): leaked signal fence fd, compounded Laguna/IQ9075/host-mock caps on second apply, and ASan heap-buffer-overflow exit 134 in fs_read_act.
    • Head (-fsanitize=address,undefined -Werror): exit 0.
  • make test exit 0 (test_freesched 9/9, test_adreno663_iq9075 132, smoke pass, 41 Python tests).
  • scripts/clean-room-audit.sh PASS; public hygiene clean; git diff --check clean; TruffleHog 0 findings; zero overlap with open PRs.

…fore host indexing, and avoid compounding vk caps
@saariuslystoned
saariuslystoned merged commit 1f3ba65 into main Nov 30, 2026
5 checks passed
@saariuslystoned
saariuslystoned deleted the fix/state-machine-freesched-core-guards branch November 30, 2026 18:25
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