Commit d5b976e
committed
Split src/FindFirstFunctions.jl into a 10-file hierarchy
The package source had grown to a single 1900-line file mixing every layer:
LLVM IR templates, equality-search primitives, strategy type definitions,
the per-strategy dispatch methods, Auto's heuristic decision tree, the
batched in-place API, the Guesser correlated-lookup helper, the findequal
strategy-framework wrapper, and the PrecompileTools workload. Splitting
into one file per logical layer makes the source navigable without changing
any behaviour.
src/
├── FindFirstFunctions.jl 39 lines module + exports + includes
├── simd_ir.jl 135 IR template + IR constants + SIMD
│ primitives (eq, sgt, sge, ogt, oge)
├── equality.jl 73 findfirstequal + findfirstsortedequal
├── strategies.jl 268 SearchStrategy abstract + concrete
│ strategy types + SearchProperties +
│ Auto (struct + docstrings)
├── search_properties.jl 120 _sampled_looks_linear /
│ _sampled_looks_log_linear / _has_nan
│ + populated SearchProperties ctor
├── dispatch.jl 583 Per-strategy searchsortedfirst/last
│ methods + bracketstrictlymonotonic*
│ + searchsortedfirstexp + _interp_guess
│ + _bit_interp_guess_f64 +
│ _simdscan_*_specialized
├── auto.jl 168 Auto crossover constants + per-query
│ Auto + _estimate_avg_gap +
│ _auto_simd_eligible /
│ _auto_simd_gap_max /
│ _auto_interp_eligible + _auto_pick
├── batched.jl 321 searchsortedfirst!/last! +
│ sorted/unsorted inner loops +
│ _take_sorted_path + generic
│ _batched! + Auto-specialized
│ _batched! + searchsortedrange
├── guesser.jl 109 looks_linear + Guesser + GuesserHint
│ dispatch (relies on BracketGallop)
├── findequal.jl 91 findequal generic + BisectThenSIMD
│ shortcut for DenseVector{Int64}
└── precompile.jl 58 PrecompileTools @setup_workload
Include order is significant — each file may depend on names from earlier
files. The order is documented in `FindFirstFunctions.jl` and is:
simd_ir → equality → strategies → search_properties → dispatch → auto →
batched → guesser → findequal → precompile. The two non-obvious
dependencies are:
- `auto.jl` references `_sampled_looks_linear` from `search_properties.jl`
(the `_auto_interp_eligible` loose tier).
- `batched.jl` references `_estimate_avg_gap`, `_auto_simd_eligible`,
`_auto_simd_gap_max`, `_auto_interp_eligible`, `_AUTO_*` constants from
`auto.jl` (the Auto-specialized `_batched!` lives in `batched.jl`
because it shares the sorted/unsorted-loop infrastructure with the
generic `_batched!`).
84626 tests pass; no behavioural change.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>1 parent aaaf5a5 commit d5b976e
11 files changed
Lines changed: 1941 additions & 1930 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments