| 774 | |
| 775 | // UAF retry wrapper for improved stability with GoldHen v2.4b18.8 |
| 776 | async function uaf_ssv_with_retry(fsets, index, save_pop = false, maxRetries = 3) { |
| 777 | for (let attempt = 1; attempt <= maxRetries; attempt++) { |
| 778 | try { |
| 779 | return await uaf_ssv(fsets, index, save_pop); |
| 780 | } catch (e) { |
| 781 | if (attempt === maxRetries) throw e; |
| 782 | log(`UAF attempt ${attempt}/${maxRetries} failed, retrying...`); |
| 783 | gc(); |
| 784 | await sleep(100); |
| 785 | } |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | async function main() { |
| 790 | log('STAGE: UAF SSV'); |