< Summary

Information
Class: Trailblazer.Pathing.NavigationOperationLimits
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/Operations/NavigationOperationLimits.cs
Line coverage
100%
Covered lines: 38
Uncovered lines: 0
Coverable lines: 38
Total lines: 132
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%22100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Map/Operations/NavigationOperationLimits.cs

#LineLine coverage
 1//=======================================================================
 2// NavigationOperationLimits.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8namespace Trailblazer.Pathing;
 9
 10/// <summary>Defines finite admission and candidate-overlay limits for map operations.</summary>
 11public readonly struct NavigationOperationLimits
 12{
 13    /// <summary>
 14    /// The hard ceiling that bounds conservative same-frame receipt coalescing work.
 15    /// Larger admitted queues carry over through multiple deterministic batches.
 16    /// </summary>
 17    public const int MaximumBatchItems = 256;
 18
 19    /// <summary>Initializes explicit finite operation and overlay limits.</summary>
 20    public NavigationOperationLimits(
 21        int maxPendingOperations,
 22        long maxPendingDescriptorBytes,
 23        long maxPreparedMapBytes,
 24        int maxBatchItems,
 25        long maxBatchDescriptorBytes,
 26        long maxBatchSortScratchBytes,
 27        int maxCorridorCells,
 28        int maxMaps,
 29        int maxRetainedMapIdentities,
 30        int maxOverlayCellsPerMap,
 31        int maxOverlayConnectionsPerMap,
 32        int maxOverlayTransitionsPerMap,
 33        int maxOverlayCells,
 34        int maxOverlayConnections,
 35        int maxOverlayTransitions,
 36        int maxTransitionRulesPerMap,
 37        int maxTransitionRules)
 38    {
 18539        SwiftThrowHelper.ThrowIfArgument(maxPendingOperations <= 0, nameof(maxPendingOperations));
 18540        SwiftThrowHelper.ThrowIfArgument(maxPendingDescriptorBytes <= 0, nameof(maxPendingDescriptorBytes));
 18541        SwiftThrowHelper.ThrowIfArgument(maxPreparedMapBytes <= 0, nameof(maxPreparedMapBytes));
 18542        SwiftThrowHelper.ThrowIfArgument(
 18543            maxBatchItems <= 0 || maxBatchItems > MaximumBatchItems,
 18544            nameof(maxBatchItems));
 18345        SwiftThrowHelper.ThrowIfArgument(maxBatchDescriptorBytes <= 0, nameof(maxBatchDescriptorBytes));
 18346        SwiftThrowHelper.ThrowIfArgument(maxBatchSortScratchBytes <= 0, nameof(maxBatchSortScratchBytes));
 18347        SwiftThrowHelper.ThrowIfArgument(maxCorridorCells < 2, nameof(maxCorridorCells));
 18348        SwiftThrowHelper.ThrowIfArgument(maxCorridorCells > int.MaxValue / 2, nameof(maxCorridorCells));
 18349        SwiftThrowHelper.ThrowIfArgument(maxMaps <= 0, nameof(maxMaps));
 18350        SwiftThrowHelper.ThrowIfArgument(maxRetainedMapIdentities < maxMaps, nameof(maxRetainedMapIdentities));
 18351        SwiftThrowHelper.ThrowIfArgument(maxOverlayCellsPerMap < 0, nameof(maxOverlayCellsPerMap));
 18352        SwiftThrowHelper.ThrowIfArgument(maxOverlayConnectionsPerMap < 0, nameof(maxOverlayConnectionsPerMap));
 18353        SwiftThrowHelper.ThrowIfArgument(maxOverlayTransitionsPerMap < 0, nameof(maxOverlayTransitionsPerMap));
 18354        SwiftThrowHelper.ThrowIfArgument(maxOverlayCells < maxOverlayCellsPerMap, nameof(maxOverlayCells));
 18355        SwiftThrowHelper.ThrowIfArgument(maxOverlayConnections < maxOverlayConnectionsPerMap, nameof(maxOverlayConnectio
 18356        SwiftThrowHelper.ThrowIfArgument(maxOverlayTransitions < maxOverlayTransitionsPerMap, nameof(maxOverlayTransitio
 18357        SwiftThrowHelper.ThrowIfArgument(maxTransitionRulesPerMap <= 0, nameof(maxTransitionRulesPerMap));
 18258        SwiftThrowHelper.ThrowIfArgument(maxTransitionRules < maxTransitionRulesPerMap, nameof(maxTransitionRules));
 59
 18160        MaxPendingOperations = maxPendingOperations;
 18161        MaxPendingDescriptorBytes = maxPendingDescriptorBytes;
 18162        MaxPreparedMapBytes = maxPreparedMapBytes;
 18163        MaxBatchItems = maxBatchItems;
 18164        MaxBatchDescriptorBytes = maxBatchDescriptorBytes;
 18165        MaxBatchSortScratchBytes = maxBatchSortScratchBytes;
 18166        MaxCorridorCells = maxCorridorCells;
 18167        MaxMaps = maxMaps;
 18168        MaxRetainedMapIdentities = maxRetainedMapIdentities;
 18169        MaxOverlayCellsPerMap = maxOverlayCellsPerMap;
 18170        MaxOverlayConnectionsPerMap = maxOverlayConnectionsPerMap;
 18171        MaxOverlayTransitionsPerMap = maxOverlayTransitionsPerMap;
 18172        MaxOverlayCells = maxOverlayCells;
 18173        MaxOverlayConnections = maxOverlayConnections;
 18174        MaxOverlayTransitions = maxOverlayTransitions;
 18175        MaxTransitionRulesPerMap = maxTransitionRulesPerMap;
 18176        MaxTransitionRules = maxTransitionRules;
 18177    }
 78
 79    /// <summary>Gets the maximum number of admitted operations.</summary>
 80    public int MaxPendingOperations { get; }
 81
 82    /// <summary>Gets the maximum submitted descriptor bytes retained by the queue.</summary>
 83    public long MaxPendingDescriptorBytes { get; }
 84
 85    /// <summary>Gets the maximum retained bytes across prepared maps.</summary>
 86    public long MaxPreparedMapBytes { get; }
 87
 88    /// <summary>Gets the maximum operation count admitted into one deterministic fold batch.</summary>
 89    public int MaxBatchItems { get; }
 90
 91    /// <summary>Gets the maximum descriptor bytes admitted into one fold batch.</summary>
 92    public long MaxBatchDescriptorBytes { get; }
 93
 94    /// <summary>Gets the maximum deterministic sorting-scratch bytes admitted for one fold batch.</summary>
 95    public long MaxBatchSortScratchBytes { get; }
 96
 97    /// <summary>Gets the maximum number of prisms in one connection corridor validation chain.</summary>
 98    public int MaxCorridorCells { get; }
 99
 100    /// <summary>Gets the maximum map count in a candidate registry.</summary>
 101    public int MaxMaps { get; }
 102
 103    /// <summary>
 104    /// Gets the maximum number of map IDs whose bake-version high-water marks remain retained.
 105    /// Removed IDs remain counted so stale checkpoint identities cannot be reused.
 106    /// </summary>
 107    public int MaxRetainedMapIdentities { get; }
 108
 109    /// <summary>Gets the maximum cell overlay entries retained for one map.</summary>
 110    public int MaxOverlayCellsPerMap { get; }
 111
 112    /// <summary>Gets the maximum connection overlay entries retained for one map.</summary>
 113    public int MaxOverlayConnectionsPerMap { get; }
 114
 115    /// <summary>Gets the maximum transition overlay entries retained for one map.</summary>
 116    public int MaxOverlayTransitionsPerMap { get; }
 117
 118    /// <summary>Gets the maximum cell overlay entries retained across the context candidate.</summary>
 119    public int MaxOverlayCells { get; }
 120
 121    /// <summary>Gets the maximum connection overlay entries retained across the context candidate.</summary>
 122    public int MaxOverlayConnections { get; }
 123
 124    /// <summary>Gets the maximum transition overlay entries retained across the context candidate.</summary>
 125    public int MaxOverlayTransitions { get; }
 126
 127    /// <summary>Gets the maximum procedural transition rules retained for one map.</summary>
 128    public int MaxTransitionRulesPerMap { get; }
 129
 130    /// <summary>Gets the maximum procedural transition rules retained across all maps.</summary>
 131    public int MaxTransitionRules { get; }
 132}