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
use *;
/// Half-domain extent in standard deviations covered by `GAUSSIAN_ERFC_LUT` (`[-3.2σ, +3.2σ]`).
pub const GAUSSIAN_LUT_RANGE: f32 = 3.2;
/// Number of intervals inside `GAUSSIAN_ERFC_LUT` (`512` intervals, `513` sample points).
pub const GAUSSIAN_LUT_SEGMENTS: usize = 512;
/// Inverse spacing `(512.0 / 6.4) = 80.0` mapping `u + 3.2` into table index space.
pub const GAUSSIAN_LUT_STEP_INV: f32 =
/ ;
/// Compile-time 2 KB analytical Gaussian `0.5 * erfc(u / sqrt(2))` lookup table eliminating per-pixel `exp()` calls.
pub const GAUSSIAN_ERFC_LUT: = build_gaussian_erfc_lut;
/// Maximum cached `TextLayoutResult` entries retained by `SoftwareRenderer` between frames.
pub const TEXT_LAYOUT_CACHE_LIMIT: usize = 512;
/// Default resident memory budget for `TextLayoutCache` (2 MiB) before LRU eviction trims cold entries.
pub const TEXT_LAYOUT_CACHE_BUDGET_BYTES: usize = 2 * 1024 * 1024;
/// Fixed per-entry metadata overhead counted toward `TextLayoutCache::resident_bytes`.
pub const TEXT_LAYOUT_ENTRY_OVERHEAD_BYTES: usize = 64;
/// Fixed per-line `TextLine` struct overhead counted toward `TextLayoutCache::resident_bytes`.
pub const TEXT_LINE_OVERHEAD_BYTES: usize = 32;
/// Initial power-of-two slot table size for `TextLayoutCache` (load factor `<= 0.5` at `TEXT_LAYOUT_CACHE_LIMIT`).
pub const TEXT_LAYOUT_CACHE_SLOTS: usize = 1024;
/// 64-bit FxHash mixing multiplier for fast SipHash-free cache hashing and slot indexing.
pub const FX_HASH_K64: u64 = 0x517C_C1B7_2722_0A95;
/// Sentinel empty slot for `TextLayoutCache` open-addressed probing.
pub const EMPTY_TEXT_LAYOUT_SLOT: TextLayoutSlot = TextLayoutSlot ;
/// Maximum stack-cached width in physical pixels for precomputed 1D vertical rounded-rect edge strips.
pub const ROUNDED_EDGE_STRIP_CAP: usize = 16;
/// Maximum cached rounded-clip corner side length in physical pixels (`dim = ceil(r + 1)`).
pub const CORNER_MASK_MAX_DIM: u32 = 96;
/// Maximum cached quadrant corner coverage masks retained by `SoftwareRenderer` between frames.
pub const CORNER_MASK_CACHE_LIMIT: usize = 128;
/// Thread name prefix assigned to persistent horizontal-band rasterization workers.
pub const BAND_WORKER_THREAD_PREFIX: &str = "euv-band";
/// Maximum total rasterizer threads (caller plus background workers) in `BandWorkerPool`.
pub const BAND_WORKER_MAX_THREADS: usize = 16;
/// Short spin-loop iterations performed by idle band workers before parking on the condition variable.
pub const BAND_WORKER_SPIN_LIMIT: u32 = 256;
/// Short spin-loop iterations performed by the calling thread before parking on `wake_caller`.
pub const BAND_CALLER_SPIN_LIMIT: u32 = 256;
/// Maximum damaged pixel area executed directly on the calling thread without touching `BandWorkerPool`.
pub const SMALL_DAMAGE_SINGLE_THREAD_PIXELS: usize = 32_768;
/// Minimum prepared command count before waking `BandWorkerPool` for mid-sized single-row dirty rects.
pub const BAND_DISPATCH_MIN_CMDS: usize = 6;
/// Minimum damaged pixel area required before splitting horizontal bands across background worker threads.
pub const BAND_DISPATCH_MIN_PIXELS: usize = 65_536;
/// Minimum vertical height in physical rows required for multi-threaded band dispatch.
pub const BAND_DISPATCH_MIN_HEIGHT: u32 = 64;