runners: Added -Q/--query-define and friends

The fact that we don't include implicit defines in bench/test output
means we need to query the runner for these surprisingly often. So it'd
be nice to have an easier API than sedding the list output.

Some examples:

  $ ./scripts/test.py -QBLOCK_SIZE
  4096
  32768

  $ ./scripts/test.py --query-implicit-define=BLOCK_SIZE
  4096

  $ ./scripts/test.py --query-permutation-define=BLOCK_SIZE
  32768

  $ ./scripts/test.py -QBLOCK_SIZZLE
  (errors)

Unlike --list-*defines, --query-*defines:

- Separates by newline

- Errors if define is not found

Other than that, --query-*defines uses more-or-less the same code
internally.
This commit is contained in:
Christopher Haster
2026-02-12 18:16:47 -06:00
parent fb8d5a83aa
commit cb91b6b2a6
5 changed files with 465 additions and 58 deletions
+3 -6
View File
@@ -684,20 +684,17 @@ bench-widths: $(BENCH_CSV)
float(bench_readed)/float(bench_reads), \
max(1, $$( \
./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) \
--list-implicit-defines \
| sed -n 's/^READ_WIDTH=\(.*\)/\1/p')))))" \
--query-implicit-define=READ_WIDTH)))))" \
-fprogged="avg(saturate(ffrac( \
float(bench_progged)/float(bench_progs), \
max(1, $$( \
./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) \
--list-implicit-defines \
| sed -n 's/^PROG_WIDTH=\(.*\)/\1/p')))))" \
--query-implicit-define=PROG_WIDTH)))))" \
-ferased="avg(saturate(ffrac( \
float(bench_erased)/float(bench_erases), \
max(1, $$( \
./scripts/bench.py -R$(BENCH_RUNNER) $(BENCHFLAGS) \
--list-implicit-defines \
| sed -n 's/^ERASE_WIDTH=\(.*\)/\1/p')))))" \
--query-implicit-define=ERASE_WIDTH)))))" \
$(SUMMARYFLAGS))
## Show heap/stack/disk usage