Files
mac-amdgpu/scripts/test-shared-buffers.sh
geramyloveless 3fe89e1ace Scale GPU buffers and integrate validated HSA signals with LSE
Grow and reclaim BO metadata in64-entry pages, raise client capacity to4096 handles, and prevent VRAM free-range metadata exhaustion. Add GPU activity history, bounded sensor sampling and clock/counter reporting.

Select the qualified GPU-owned signal mailbox by default while gating native mixed atomics on original PCIe evidence. Include native HRX/LSE adapters, guarded compute tests, reproducible signing and local build/server guides linked to Lemon Seed Engine.

Hardware validation covers1024 live buffers with fragmented reuse, pooled HRX allocations and2GiB boundaries, shared signal lifecycle, Q6 projection and680 exact convolution outputs. Full-model token generation remains blocked on the missing Loom repeat template.
2026-09-23 17:52:41 -07:00

27 lines
1.3 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p build/tests
python3 - <<'PY'
from pathlib import Path
s = Path('dext/MacAMDGPU.cpp').read_text()
a=s.index('static inline uint64_t\nmac_amdgpu_bo_make_handle(')
b=s.index('//\n// CS handle helpers',a)
Path('build/tests/bo_table_under_test.inc').write_text(s[a:b])
assert 'BOEntry *boPages[amdgpu::kMaxBOPages];' in s
assert 'const auto tableStatus = mac_amdgpu_bo_find_free_slot(ivars, idx);' in s
assert 'if (!entry) return kIOReturnNotReady;' in s[s.index('// v0.1.27 — per-BO mapping'): ]
a=s.index(' case kMacAMDGPUMethodBOAlloc:')
b=s.index(' case kMacAMDGPUMethodBOExport:',a)
Path('build/tests/bo_alloc_under_test.inc').write_text(s[a:b])
a = s.index(' case kMacAMDGPUMethodBOExport:')
b = s.index(' case kMacAMDGPUMethodBOGetInfo:', a)
Path('build/tests/shared_buffer_rpc_under_test.inc').write_text(s[a:b])
a = s.index('static void\nmac_amdgpu_bo_release_all(', s.index('// Release every BO owned'))
b = s.index('static void\nmac_amdgpu_release_client_storage(', a)
Path('build/tests/shared_buffer_release_under_test.inc').write_text(s[a:b])
PY
xcrun clang++ -std=c++20 -Wall -Wextra -Werror -fsanitize=address,undefined -fno-sanitize-recover=all \
-I dext/amdgpu -I build/tests tests/shared_buffers_test.cpp -o build/tests/shared-buffers-test
build/tests/shared-buffers-test