vyre_libs/parsing/c/preprocess/gpu_pipeline/include_events.rs
1//! Include-graph evidence emitted by the GPU preprocessor driver.
2
3/// Residency class for include preprocessing evidence.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum IncludeEventResidency {
6 /// Include request was extracted by GPU directive payload kernels.
7 GpuResidentRequest,
8 /// Include resolution/read is unavoidable host filesystem metadata work.
9 HostFilesystemMetadata,
10 /// Include bytes were reused from this translation-unit run's header cache.
11 HostMemoryCache,
12}
13
14/// Per-translation-unit include byte-cache counters.
15#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
16pub struct IncludeByteCacheStats {
17 /// Include byte lookups satisfied from this run's in-memory cache.
18 pub hits: u64,
19 /// Include byte lookups that reached the loader.
20 pub misses: u64,
21 /// Current include byte cache entries retained for this translation unit.
22 pub entries: usize,
23 /// Header byte cache entries evicted to enforce translation-unit budgets.
24 pub evictions: u64,
25 /// Bytes currently retained by the include byte cache.
26 pub retained_bytes: u64,
27 /// Header bytes loaded through the include loader.
28 pub loaded_bytes: u64,
29 /// Header bytes reused from the in-memory cache.
30 pub reused_bytes: u64,
31}
32
33/// Include event emitted by the GPU-resident preprocessor driver.
34#[derive(Debug, Clone, PartialEq, Eq)]
35pub struct IncludeEvent {
36 /// File that contained the include directive.
37 pub includer: std::path::PathBuf,
38 /// Raw include spelling extracted by the GPU include parser.
39 pub requested_path: Vec<u8>,
40 /// Canonical path returned by the include loader.
41 pub resolved_path: std::path::PathBuf,
42 /// Directive row in the classified token stream.
43 pub directive_row: u32,
44 /// Byte offset of the include directive token in the filtered source.
45 pub directive_byte_offset: u32,
46 /// Whether the request used `<...>` system include spelling.
47 pub is_system: bool,
48 /// Whether the request came from GNU `#include_next`.
49 pub is_next: bool,
50 /// Residency of the request extractor.
51 pub request_residency: IncludeEventResidency,
52 /// Residency of the path resolution/read side.
53 pub resolution_residency: IncludeEventResidency,
54}