test: contract + mock coverage for Apple Silicon GPU backends#1020
Open
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Open
test: contract + mock coverage for Apple Silicon GPU backends#1020yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
yasinBursali wants to merge 1 commit intoLight-Heart-Labs:mainfrom
Conversation
Collaborator
|
Audit follow-up: keep draft and rebase after the Apple/GPU merges. #999 and #1025 are now on |
Adds regression shields for the 5 new Apple GPU_BACKEND branches introduced in fix/dream-cli-apple-silicon-coverage (cmd_status_json, _gpu_status, _gpu_topology, _gpu_validate, _gpu_reassign) plus the Darwin doctor RAM/disk path (sysctl hw.memsize, POSIX df -k). tests/contracts/test-dream-doctor.sh adds Darwin-guarded fixture cases asserting positive ram_gb / disk_gb, HOST_RAM_GB fallback, and empty autofix_hints on apple backend. tests/test-gpu-apple.sh adds mock-based coverage of each gpu subcommand under GPU_BACKEND=apple, plus negative assertions that nvidia/amd backends fall through correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7717e96 to
3eff3c9
Compare
Contributor
Author
|
Rebased on current |
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.
✅ Rebased on current
main2026-04-28#999 has merged. The PR diff is now the 2 new test files (138 + 321 LoC = 459 lines added). Tests re-run on the rebased branch: 26/26 pass (21 in
tests/test-gpu-apple.sh, 5 intests/contracts/test-dream-doctor.sh).#999 (
fix/dream-cli-apple-silicon-coverage) introduced the 5 AppleGPU_BACKEND=applecode paths (_gpu_status,_gpu_topology,_gpu_validate,_gpu_reassign,cmd_status_json) plus a Darwin branch inscripts/dream-doctor.sh(RAM viasysctl hw.memsize, POSIXdf -k); this PR adds regression shields for all of them.What
Two new test files locking in Apple-Silicon behavior:
tests/contracts/test-dream-doctor.sh(138 lines, 5 cases, Darwin-guarded)dream-doctor.shexits 0 underGPU_BACKEND=apple.preflight.inputs.ram_gb> 0 (sysctl hw.memsize path).preflight.inputs.disk_gb> 0 (POSIX df -k on $HOME).autofix_hintshas 0 "incompatible with current GPU backend" entries under apple backend.envHOST_RAM_GB(writes/removes .env; pre-existing .env → SKIP)Skips cleanly on Linux CI via
[[ "$(uname -s)" == "Darwin" ]] || skip.tests/test-gpu-apple.sh(321 lines, 21 cases)Hermetic PATH-stub pattern (sysctl, system_profiler, curl, docker all PATH-prepended).
nvidia-smiintentionally absent socommand -v nvidia-smireturns false under the apple branch tests.gpu status(apple): rc=0 + header + Chip/Unified-memory/GPU-cores output + stub chip reflectedgpu topology(apple): "Single integrated GPU" + rc=0gpu validate(apple): "Result: 0 check(s) passed, 0 failed" + rc=0gpu reassign(apple): rc=1 + "not applicable on Apple Silicon"status-json(apple): valid JSON with.gpu.backend=apple,.gpu.chip,.gpu.unified_memory_gb(number),.gpu.gpu_cores=38GPU_BACKEND=nvidiaandGPU_BACKEND=amddo NOT take the apple branch; nvidia fallthrough warning emittedTop-level Bash-4+ guard skips cleanly on stock macOS
/bin/bash3.2.Testing
test-gpu-apple.sh: 21/21 pass locally (macOS Darwin, homebrew bash 5.3) — re-verified on rebased branchtest-dream-doctor.sh: 5/5 pass locally — re-verified on rebased branchbash -n+shellcheckclean (one justified# shellcheck disable=SC2016on the single-quoted child-bash probe).envfiles, no orphaned/tmp/test-*dirsPlatform Impact
uname; mock-based cases run and confirm nvidia/amd backends fall through correctly