# Vyre Shared WGSL Params Layout
`core/src/ops/wgsl/common_params.wgsl` defines the canonical `Params` uniform
struct used by string-matching and string-similarity kernels.
## Frozen Contract
This struct layout is a **frozen binary contract**.
- **Grow only:** New fields may only be appended at the end.
- **Never reorder:** Existing field order must not change.
- **Never shrink:** Fields must not be removed.
## Rationale
All consumers share the same uniform binding 0 layout. Each kernel uses only
the fields it cares about; unused fields are documented as padding for the
shared layout. Appending preserves backward compatibility with existing
compiled shaders and CPU-side upload code.
## Current Layout (16 bytes)
| 0 | `len_a` | Length of first operand |
| 4 | `len_b` | Length of second operand / count param |
| 8 | `param_c` | Algorithm-specific parameter 1 |
| 12 | `param_d` | Algorithm-specific parameter 2 / padding |
## Consumer Mapping
- `aho_corasick_scan`: `len_a`=haystack_len, `len_b`=state_count, `param_c`=max_matches
- `boyer_moore_find`: `len_a`=haystack_len, `len_b`=needle_len
- `glob_match`: `len_a`=pattern_len, `len_b`=input_len
- `kmp_find`: `len_a`=haystack_len, `len_b`=needle_len
- `rabin_karp_find`: `len_a`=haystack_len, `len_b`=needle_len
- `substring_contains`: `len_a`=haystack_len, `len_b`=needle_len
- `substring_find_all`: `len_a`=haystack_len, `len_b`=needle_len, `param_c`=max_matches
- `substring_find_first`: `len_a`=haystack_len, `len_b`=needle_len
- `wildcard_match`: `len_a`=pattern_len, `len_b`=input_len
- `hamming`: `len_a`=a_len, `len_b`=b_len
- `ngram_extract`: `len_a`=input_len, `len_b`=n, `param_c`=output_stride_words
- `ngram_histogram`: `len_a`=input_len, `len_b`=n, `param_c`=max_records, `param_d`=output_stride_words
- `simhash64`: `len_a`=input_len