about summary refs log tree commit diff
path: root/test/python/server_test_case.py
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-08 15:45:48 +0000
committerPjotr <wrk@bosa.lan>2026-11-08 15:45:48 +0000
commitfc0e8fff3c1bed8d40e982a0a5e808180e772590 (patch)
treebe76e5db9c0566adc50f9d193a786601010f554d /test/python/server_test_case.py
parent386aed031612abc118e3390638cb5aff144be971 (diff)
downloadgenenetwork4-fc0e8fff3c1bed8d40e982a0a5e808180e772590.tar.gz
compute: refuse GEMMA permutations instead of ignoring them
`gemma-wrapper --permutate n` repeats the *whole* LOCO association scan
per permutation -- it shuffles the phenotype file and starts over -- so a
thousand permutations is thousands of full scans: hours to days on a real
panel, against the single slot `/compute/gemma` has. That is not a test
this deployment carries, and an assistant asked for significance
thresholds will ask for it, so the answer has to be an explicit one.

Until now the request type simply had no such field and serde ignores
unknown keys, which is the worst of the three outcomes: the caller gets a
200, no thresholds, and no indication that what it asked for was dropped.
`nperm`, `permutations` and `permutate` are now named fields and refused
with `422 permutations_not_supported`, naming the cost, pointing at
`POST /compute/rqtl` with `nperm` (the endpoint that does have the test,
over the same panel and values) and at the `actions` member every
successful GEMMA response already carries, pre-filled with exactly that
call. Zero keeps its usual meaning -- off -- so a client sharing one body
shape across the two endpoints still works.

* src/routes/gemma.rs: the three fields, the refusal before anything
  expensive runs, and the response note now saying permutations are
  refused rather than merely absent.
* tests/gemma.rs: `compute_gemma_refuses_permutations` pins all three
  spellings, the code, and that `nperm: 0` is not a request for any. It
  takes the compute lock: the gate answers before the handler does, so a
  concurrent job in the same test binary came back 409 instead.
* README.md, docs/www/ai-instruction.md: what to do instead -- judge a
  peak against the smallest `p_lrt`, and get thresholds from R/qtl.

273 tests pass; the same four as before do not.
Diffstat (limited to 'test/python/server_test_case.py')
0 files changed, 0 insertions, 0 deletions