Developer Guide
Use the included sysbench_cpu and TPCC targets as reference implementations
for new SemaTune targets. The documented tuner surface is fixed, llm,
bayesian, mlos, qlearning, and dqn.
For implementation contracts, see Extending SemaTune. For a copy-paste-friendly target example, see Add a Target Tutorial.
Local Checks
.venv/bin/pytest
.venv/bin/mkdocs build --strict
.venv/bin/python -m compileall src tests
.venv/bin/os-param-tuning --help
Host-mutating tests are opt-in:
sudo .venv/bin/pytest --run-host-mutation -m host_mutation
Adding A Config Field
- Add the field to
SimpleConfig. - Validate it if bad values can silently change behavior.
- Add or update an example config only if the field is part of the documented user surface.
- Document the field in Configuration Reference.
- Add a config validation test when the field has meaningful constraints.
The docs coverage test checks that every SimpleConfig field appears in the
configuration reference.
Adding An OS Parameter
- Add metadata in
PARAMETER_METADATA. - Add setter/getter behavior in
ParameterManagerwhen supported. - Keep the setter bounded to a known Linux interface, not arbitrary shell.
- Document interface, unit, scope, restore behavior, prerequisites, failures, safe starting range, and interactions in OS Parameter Reference.
- Add tests for validation and value normalization.
The docs coverage test checks that every PARAMETER_METADATA key appears in
the OS parameter reference.
Adding A Target
- Implement the
BenchmarkInterfaceadapter. - Add registry and factory wiring.
- Add one small example config.
- Add parser tests with tiny fixtures.
- Keep live target tests behind
benchmark_smoke; addhost_mutationwhen the test changes host state. - Document setup, metrics, output files, and common failures.
Adding A Tuner
- Implement
TunerInterface. - Add config validation and factory wiring.
- Keep optional dependencies lazy.
- Add example configs for the included targets when the tuner is documented.
- Add construction/suggestion tests with fake metrics.
- Document installation, expected use cases, and failure modes.
Docs Coverage Tests
tests/test_docs_coverage.py guards against common drift:
- config fields missing from
configuration.md - OS parameters missing from
os-parameters.md - prompt modes missing from
llm-prompt-modes.md - documented recipe fixtures or examples missing from the tree
Update the tests when docs move, but do not weaken them to hide drift.
Release Checklist
Before a public push:
.venv/bin/pytest
.venv/bin/mkdocs build --strict
.venv/bin/python -m compileall src tests
.venv/bin/os-param-tuning doctor
Also verify:
- README quick start still works.
- Fixed
sysbench_cpusmoke run completes. config/examples/*.jsoncontains no real API keys.results/,site/, logs, caches, and local archives are not committed.CITATION.cffand README citation placeholders are updated when final citation text exists.- Safety and restore docs still match actual parameter behavior.
Do not commit generated results, plots, logs, local secrets, or machine-specific paths.