Summary
parse_flow_variables() and parse_tunable_variables() in tools/AutoTuner/src/autotuner/utils.py have explicit TODO: Tests. comments but currently lack any unit test coverage.
These are core parsing functions in the AutoTuner pipeline:
parse_flow_variables() — Invokes make vars, then extracts environment variable names from env() patterns across Tcl scripts and vars.tcl. Used to determine the set of valid flow variables.
parse_tunable_variables() — Reads variables.yaml and returns the set of variables marked with tunable: 1. Used to validate which variables the AutoTuner is allowed to tune.
Proposed Test Coverage
parse_tunable_variables() (7 tests)
- Returns a non-empty set
- Known tunable variables (e.g.,
CORE_UTILIZATION, CORE_AREA) are present
- Non-tunable variables (e.g.,
EQUIVALENCE_CHECK, DETAILED_METRICS) are excluded
- Correctly filters on
tunable: 1 flag (with mock YAML)
- Handles empty YAML and YAML with no tunable variables
parse_flow_variables() (6 tests)
- Exits on Makefile failure (non-zero return code)
- Exits when
vars.tcl is not generated
- Passes correct platform argument to
make
- Extracts
env() patterns from Tcl files
- Uppercases all variable names
- Deduplicates variables (returns a set)
Summary
parse_flow_variables()andparse_tunable_variables()intools/AutoTuner/src/autotuner/utils.pyhave explicitTODO: Tests.comments but currently lack any unit test coverage.These are core parsing functions in the AutoTuner pipeline:
parse_flow_variables()— Invokesmake vars, then extracts environment variable names fromenv()patterns across Tcl scripts andvars.tcl. Used to determine the set of valid flow variables.parse_tunable_variables()— Readsvariables.yamland returns the set of variables marked withtunable: 1. Used to validate which variables the AutoTuner is allowed to tune.Proposed Test Coverage
parse_tunable_variables()(7 tests)CORE_UTILIZATION,CORE_AREA) are presentEQUIVALENCE_CHECK,DETAILED_METRICS) are excludedtunable: 1flag (with mock YAML)parse_flow_variables()(6 tests)vars.tclis not generatedmakeenv()patterns from Tcl files