## Coverage Report

#### Created: 2026-01-25 15:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)

    /home/noah/src/trueno/src/tiling/error.rs

    Line
    Count
    Source
    1
    //! Tiling error types.
    2
    3
    use std::fmt;
    4
    use super::geometry::TcbLevel;
    5
    6
    /// Tiling configuration errors
    7
    #[derive(Debug, Clone)]
    8
    pub enum TilingError {
    9
        /// Tile hierarchy is invalid (e.g., micro > midi)
    10
        InvalidHierarchy { reason: String },
    11
        /// Tile dimensions not divisible
    12
        DivisibilityError {
    13
            level: &'static str,
    14
            dimension: &'static str,
    15
            larger: u32,
    16
            smaller: u32,
    17
        },
    18
        /// Tile doesn't fit in cache
    19
        CacheOverflow {
    20
            level: TcbLevel,
    21
            required_bytes: usize,
    22
            available_bytes: usize,
    23
        },
    24
        /// Alignment violation
    25
        AlignmentError {
    26
            required: u32,
    27
            actual: u32,
    28
        },
    29
        /// Quantization alignment violated
    30
        QuantAlignmentError {
    31
            format: &'static str,
    32
            required_k: u32,
    33
            actual_k: u32,
    34
        },
    35
    }
    36
    37
    impl fmt::Display for TilingError {
    38
    0
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    39
    0
            match self {
    40
    0
                TilingError::InvalidHierarchy { reason } => {
    41
    0
                    write!(f, "Invalid tiling hierarchy: {}", reason)
    42
                }
    43
                TilingError::DivisibilityError {
    44
    0
                    level,
    45
    0
                    dimension,
    46
    0
                    larger,
    47
    0
                    smaller,
    48
                } => {
    49
    0
                    write!(
    50
    0
                        f,
    51
    0
                        "Tiling divisibility error at {}: {} ({}) not divisible by {}",
    52
                        level, dimension, larger, smaller
    53
                    )
    54
                }
    55
                TilingError::CacheOverflow {
    56
    0
                    level,
    57
    0
                    required_bytes,
    58
    0
                    available_bytes,
    59
                } => {
    60
    0
                    write!(
    61
    0
                        f,
    62
    0
                        "Tile exceeds {:?} cache: {} bytes required, {} available",
    63
                        level, required_bytes, available_bytes
    64
                    )
    65
                }
    66
    0
                TilingError::AlignmentError { required, actual } => {
    67
    0
                    write!(
    68
    0
                        f,
    69
    0
                        "Alignment error: required {} bytes, actual {} bytes",
    70
                        required, actual
    71
                    )
    72
                }
    73
                TilingError::QuantAlignmentError {
    74
    0
                    format,
    75
    0
                    required_k,
    76
    0
                    actual_k,
    77
                } => {
    78
    0
                    write!(
    79
    0
                        f,
    80
    0
                        "Quantization alignment error for {}: K must be multiple of {}, got {}",
    81
                        format, required_k, actual_k
    82
                    )
    83
                }
    84
            }
    85
    0
        }
    86
    }
    87
    88
    impl std::error::Error for TilingError {}