mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:50:53 +01:00
[PR #917] ps_oracle: exit 77 when the oracle becomes unavailable during run() (PS-ORACLE-UNAVAILABLE-EXIT) #956
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#956
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/917
Author: @TuroYT
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/ps-oracle-unavailable-exit📝 Commits (1)
9dde66bps_oracle: exit 77 when the oracle becomes unavailable during run() (PS-ORACLE-UNAVAILABLE-EXIT)📊 Changes
2 files changed (+41 additions, -0 deletions)
View changed files
📝
tests/test_ps_oracle.py(+38 -0)📝
tools/ps_oracle.py(+3 -0)📄 Description
Claimed in the coordination issue as: PS-ORACLE-UNAVAILABLE-EXIT (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135530775)
What was wrong
tools/ps_oracle.pydocuments exit code 77 for a missing tool.main()catchesUnavailableonly around theOracle(...)constructor (line 822). Theo.run(...)call in the next try block does not catch it.assemble()raisesUnavailablewhen no AMD clang is found (line 629), andrun_harness()raises it when vk_harness returns 77 (line 618). Both happen duringrun(), so the user gets a traceback and exit 1.Reproduction on origin/main, with the oracle constructor stubbed (no vk_harness build here) and PATH reduced:
What changed
main()gets a first handler on theo.run(...)try block:except Unavailable as e:printsps_oracle unavailable: {e}to stderr and returns 77. This is the same message the constructor handler already prints. TheValueError/KeyError/IndexError/TypeErrorandRuntimeErrorhandlers are unchanged.tests/test_ps_oracle.py(classCli):test_unavailable_during_run_is_77makesOracle.runraiseUnavailableand checks exit 77 and the exact stderr line.test_value_error_during_run_is_still_2checks that aValueErrorstill returns 2.Tested
ps_oracle unavailable: no AMD clang (...)on stderr, thenexit=77.python3 -I tests/test_ps_oracle.py Clion the fixed code:OK(5 tests).test_unavailable_during_run_is_77on the unfixedtools/ps_oracle.py(checked out from origin/main): ERROR with the sameps_oracle.Unavailable: no AMD clang (test)traceback.python3 -I tests/test_ps_oracle.py: 25 tests, OK, 2 skipped (hardware tests need LEONIDA_PS_ORACLE_BUILD).python3 -I tests/test_ps_helper_probe.py: 6 tests, OK, 1 skipped.python3 -m unittest discover -s tests/semantic -p test_export_valid_mask.py: 24 tests, OK.python3 -I tests/test_text_write_line_endings.py: 3 tests, OK.python3 -I scripts/check_no_game_data.py tools/ps_oracle.py tests/test_ps_oracle.py: no issues.python3 -m compileall -q tools tests: OK.git diff --check: clean.Not tested
run_harness(the test raisesUnavailablefromrun()directly, not throughsubprocess).--show-templateon RADV with a missing llvm-mc. That path is outsiderun()and was not changed.AI-assisted (Claude Code).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.