Skip to content

probe-output.schema: the shared enums come from omx-contract's vocabulary (#115) - #120

Merged
linuxnow merged 6 commits into
mainfrom
fix/115-vocabulary-enums
Oct 20, 2026
Merged

linuxnow merged 6 commits into
mainfrom
fix/115-vocabulary-enums

Conversation

@linuxnow

Copy link
Copy Markdown
Contributor

Closes #115.

The probe output keeps its own format and its own probe.* codes; the words it shares with the other readers of a measurement now come from omx-contract 2.18.0, declared once there.

What is derived now

  • protocol/probe-output.schema.in names five enums as @OMX_<ITEM>@ tokens and holds no list of them: latency method (MEASUREMENT_LATENCY_METHODS: impulse-onset, declared-port, note-onset), the held notes' basis (MEASUREMENT_VOICE_BASES), machine.class.coreBand / clockBand (MACHINE_CORE_BANDS / MACHINE_CLOCK_BANDS) and offer.realtime (RESOURCE_THREAD_SCHEDULING).
  • tools/protocol-gen writes each token from the item's _INIT in <omxcontract/omx_vocabulary.h>, in the contract's order, and does not build when a word list is not its _COUNT. The generated probe-output.schema.json has the same values as before (only the five lists are now written on one line).
  • src/probe.c writes the bands, the latency method and the scheduling class by the header's names instead of literals; the documents it writes are unchanged.
  • The probe.* outcomes, steps, limits, limit mechanisms, reasons and profile codes stay this protocol's own, as do cancelledBy, via and plugin.format.

Checks

  • make test-vocabulary (new, in make test): tests/vocabulary_derived.py reads the installed omx-vocabulary.schema.json (pkg-config datadir of omx-contract, or OMX_VOCABULARY) and holds every enum the template takes by a token to $defs.<ITEM>.enum, word for word and in order; requires the five items above to be taken that way; refuses a template list that is a whole contract item typed by hand; and checks that note-onset is a latency method. A positive control tells a contract with a word more and one reordered apart.
  • make test-contract gains a scratch omx_vocabulary.h with a latency method more: the schema the generator writes follows, and the same list without its count does not build.
  • make check-generated keeps the generated schema current with the header.

Sabotages (make sabotage), each seen red:

  • the generated schema lost a latency method the contract has
  • the generated schema has the clock bands in an order of its own
  • a copy of the contract gives its hosts a scheduling class the schema does not have
  • the template types the latency methods by hand again
  • the template takes the voice basis from nowhere
  • the generator types the latency methods by hand
  • the generator does not hold a word list to its count

Two existing sabotages had their text moved with the code (the note-onset schema entry, now on one line; the note-onset method in src/probe.c, now a macro).

Packaging: the floor of omx-contract-devel / libomx-contract-dev rises to 2.18.0, the first release with omx_vocabulary.h; both channels carry it. No version or changelog change.

Verified in the worker image with omx-contract-devel 2.18.0: make test green, make sabotage green but for "worker_env is not applied to a running worker", which survives on main as well when the suite runs niced (#103).

Codes: none. No hosting.* code is added, removed or renamed; the step's hostingCode stays a pattern.

…ulary header (#115)

The probe output's shared words (latency method, voice basis, core and clock
bands, thread scheduling) come from omx-contract's omx_vocabulary.h, which
2.18.0 is the first release to install.
… vocabulary header (#115)

The latency method, the voice basis, the core and clock bands and the
realtime scheduling were lists typed in the template. Each is now an
@OMX_<ITEM>@ token the generator replaces with the item's _INIT words from
omx_vocabulary.h, in the contract's order, with a static check that the
list holds as many words as the item's count. The generated schema keeps
the same values, note-onset among the methods. The probe.* outcomes,
steps, limits, reasons and profile codes stay this protocol's own.
…word for word (#115)

tests/vocabulary_derived.py reads the installed omx-vocabulary.schema.json
and holds every enum the template takes by an @OMX_<ITEM>@ token to
$defs.<ITEM>.enum, same words, same order; requires the five items of #115
to be taken that way; refuses a template list that is a whole contract item
typed by hand; and checks note-onset is a latency method. A positive control
tells a contract with a word more and one reordered apart.

make sabotage gains five breaks, each seen red: a method dropped from the
generated schema, the clock bands reordered, a scheduling class added to a
copy of the contract, the methods typed by hand in the template, and the
voice basis taken from nowhere.
…y omx-contract's names (#115)

The runner typed the core and clock bands, impulse-onset and note-onset,
and "none" as literals of its own; it now writes the words of
omx_vocabulary.h (MACHINE_CORE_BANDS, MACHINE_CLOCK_BANDS,
MEASUREMENT_LATENCY_METHODS, RESOURCE_THREAD_SCHEDULING). The documents it
writes are unchanged.
A copy of omx_vocabulary.h with a latency method more moves the probe
schema the generator writes, and the same word list without its count
does not build. Two sabotages, each seen red: the generator types the
methods itself, and it drops the check of a list against its count.
@linuxnow

Copy link
Copy Markdown
Contributor Author

Coordinator's answers (2026-10-20, recorded in decisions-2026-10-19.md): (1) limit.unit and cost.unit stay plugin-hostd's own lists, but add a check that every word is a word of the contract's RESOURCE_UNITS (a subset test), so they cannot drift to a word the core lacks; do it in this PR if small, else as a follow-up issue. (2) machine.class field names and machine.profile field names: derive them the same way (tokens from MACHINE_CLASS_FIELDS and MACHINE_PROFILE_FIELDS); a follow-up PR is fine, file the issue. (3) The packaging floor rises to omx-contract-devel >= 2.18.0 with this change: agreed, it is part of the change, not a spec change. The release 0.6.0 PR (#119) is merged and is not touched; this PR goes in the next plugin-hostd release. Image: the worker image needs a rebuild with contract 2.18.0 (ops#219); CI here installs the published 2.18.0.

@linuxnow
linuxnow merged commit 03d6d27 into main Oct 20, 2026
35 checks passed
@linuxnow
linuxnow deleted the fix/115-vocabulary-enums branch October 20, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant