From cba5bb7a7d8eb17f38757d7117c0c97fda19b708 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 3 Feb 2023 11:45:05 -0500 Subject: Fix the fuzzer's generate-and-adjust method for -z 1 --- test/fuzz.bqn | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/fuzz.bqn b/test/fuzz.bqn index 4f0c3c24..e3d46452 100644 --- a/test/fuzz.bqn +++ b/test/fuzz.bqn @@ -64,9 +64,13 @@ RandPart ← ¯1 (⊢-») (Subset∾⊢)○(-⟜1) (0⌈-⟜1) ⌊ Rand∘(1⌈⌈)⌾((2⋆3+⊢)⁼) + ¯7+Rand∘15 # Near power of two ⟩_randChoose - P ← ×´opts.zerobound⌈⊢ + z ← opts.zerobound + Squash ← { # Multiply by constant so product is ≤𝕨 + a←(∧`𝕨>×`÷⊢⋆1+↕∘≠)⊸/∘∨⍟z 𝕩 # Numbers that don't need to go below 1, if z + ⌊ 𝕩 × (≠a) √ Sigmoid⊸÷1⌈𝕨÷˜×´a + } Augment ← { - d ← 1+⌊𝕨÷1⌈P𝕩 # Maximum bound that can be added, plus 1 + d ← 1+⌊𝕨÷1⌈×´z⌈𝕩 # Maximum bound that can be added, plus 1 C ← 10⊸+ Rand⊸< 1.2⊸√ # Decide whether to add d (𝕨 𝕊 ⟨∾,∾˜⟩_randChoose⟜RandBound˜)⍟(C⊣) 𝕩 } @@ -75,7 +79,7 @@ RandPart ← ¯1 (⊢-») (Subset∾⊢)○(-⟜1) ×´¨ (⊐·Rand¨⥊˜∘≠)⊸⊔∘⊢ # Distribute randomly ⟩_randChoose RandShape ⇐ ⊢ Augment ⟨ - ⊢ (⊢ ⌊∘× ⊢ ≠⊸√ (Sigmoid⊸÷1⌈×´⊸÷˜)) · Rand¨ (RandRank⌈√