Repository navigation
Read ORACLE_FLOOR_RATES and PARAM_SCALES from omx-contract (#75) - #86
Merged
Merged
Conversation
This was referenced Oct 18, 2026
linuxnow
force-pushed
the
fix/75-contract-derived
branch
from
October 18, 2026 17:03
8bee563 to
08b68c8
Compare
The probe runner's default rates, "44100,48000,96000,192000", were typed by hand in two places (the option default and the usage text). They are omx-contract's ORACLE_FLOOR_RATES. The runner now builds both from OMX_ORACLE_FLOOR_RATES_INIT in <omxcontract/omx_contract_limits.h>, and the man page names the contract list instead of repeating its values. The protocol's parameter scales (linear, log, stepped) are omx-contract's PARAM_SCALES, whose data says the words are for this protocol. They stay in protocol.h, because an installed header a consumer compiles against must not need omx-contract. protocol-gen, which writes them into the JSON and the README, now refuses to build when an id is not where the contract's enum has it or when the count differs. It also refuses to run when a word is not the contract's id in lower case. omx-contract-devel / libomx-contract-dev >= 2.16.0 is a build dependency (a floor only). Nothing is linked: the header holds values only. tests/contract_derived.py (make test-contract, part of make test) checks the scales against the installed contract's data. It checks the runner's default rates by what its child is given and by its usage text. It also builds against a copy of the header with other rates (the runner follows) and with the scales swapped (the generator does not build), and against a protocol.h with a renamed word (the generator writes nothing). Each of the three guards has a sabotage arm. Closes #75
Contributor
Author
|
Rebased onto main 1ce8398: resolved Makefile and tests/sabotage.py: main added the relay test (test-relay, relay_test, 'relay' jack arm, three SABOTAGE entries, #85's pin entry) where this PR added test-contract (contract_test runner, 'contract' arm, three entries); kept both sides in the test: line, the arm lists, the usage comment, the entries and the runners. No logic chosen. |
linuxnow
force-pushed
the
fix/75-contract-derived
branch
from
October 18, 2026 21:27
08b68c8 to
2d11975
Compare
Merged
linuxnow
added a commit
that referenced
this pull request
Oct 18, 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.
Fixes #75.
--ratesused to be typed by hand, in the option default and in the usage text. Both now come fromOMX_ORACLE_FLOOR_RATES_INIT. The man page now names the contract list instead of copying its values.include/plugin-hostd/protocol.h, because the installed header a consumer compiles against must not need omx-contract.tools/protocol-gen.cnow holds them to omx-contract'sPARAM_SCALESin three ways: a_Static_assertfor each id's position, one for the count, and a check at run time that each word is the contract's id in lower case. A drifted generator neither builds nor writes the JSON or the README.omx-contract-devel >= 2.16.0andlibomx-contract-dev (>= 2.16.0~)are now build dependencies, floors only. The FreeMixer channel carries both. Nothing is linked. BUILDING.md describes the dependency.How it is tested:
tests/contract_derived.py(make test-contract, part ofmake test) fails on main. Its checks:ORACLE_FLOOR_RATESwhen it is given no rates, and the usage text names the same list;Each guard has a sabotage arm (a new
contractkind in tests/sabotage.py), and all three go red.Local checks in the Fedora worker image: test-pin, test-format, test-daemon, check-generated, check-schema, test-probe-schema, test-probe, test-contract, test-consumer, test-perturbation, check-readme, check-own-host-page, check-no-pins, test-mod-host-json, and the three sabotage arms.