File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
server/fishtest/templates Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 700700
701701 const isRun = ${'true' if is_rerun else 'false'};
702702
703+ function handleLtcSpsaThroughput() {
704+ const ltcTestRadio = document.getElementById("ltc_test");
705+ const spsaRadio = document.getElementById("stop-rule-spsa");
706+ const throughputSelect = document.getElementById("throughput");
707+ if (!ltcTestRadio || !spsaRadio || !throughputSelect) return;
708+
709+ // Non-LTC test selected : leave throughput as already set elsewhere.
710+ if (!ltcTestRadio.checked) return;
711+
712+ if (spsaRadio.checked) {
713+ // Case : LTC + SPSA → set recommended 50% throughput.
714+ if ([...throughputSelect.options].some(o => o.value === "50")) {
715+ throughputSelect.value = "50";
716+ }
717+ return;
718+ }
719+
720+ // Case : LTC without SPSA → restore LTC default from its data-options.
721+ try {
722+ const ltcOptions = JSON.parse(ltcTestRadio.dataset.options || "{}");
723+ if (ltcOptions.throughput) {
724+ throughputSelect.value = ltcOptions.throughput;
725+ }
726+ } catch (_) {
727+ // Malformed/missing data-options : keep current throughput.
728+ }
729+ }
730+
703731 function updateSprtBounds(selectedBounds) {
704732 if (selectedBounds === "custom") {
705733 document
821849 }
822850
823851 spsaWork();
852+ handleLtcSpsaThroughput();
824853 }
825854 })
826855 );
839868 document.querySelectorAll("[name=stop-rule]").forEach((btn) =>
840869 btn.addEventListener("click", function () {
841870 stopRule = btn.value;
871+ handleLtcSpsaThroughput();
842872
843873 if (stopRule) {
844874 // Hide all elements that have the class "stop-rule"
You can’t perform that action at this time.
0 commit comments