pub struct TestCache { /* private fields */ }Expand description
Memoized test-commit verdicts, keyed by (plane, property_hash).
Implementations§
Source§impl TestCache
impl TestCache
Sourcepub fn lookup(&self, plane_id: u32, property_hash: u64) -> Option<bool>
pub fn lookup(&self, plane_id: u32, property_hash: u64) -> Option<bool>
The cached verdict, if any.
Sourcepub fn record(&mut self, plane_id: u32, property_hash: u64, passed: bool)
pub fn record(&mut self, plane_id: u32, property_hash: u64, passed: bool)
Record a verdict, counting failures so scoring can back off.
Sourcepub fn failure_count(&self, plane_id: u32, property_hash: u64) -> u32
pub fn failure_count(&self, plane_id: u32, property_hash: u64) -> u32
How many times this combination has been rejected; zero while its latest verdict is a pass.
The score subtracts this. Counting every verdict instead – what this did until drm-cxx#267 – decayed a plane the kernel keeps accepting as fast as one it keeps rejecting, so the search walked away from the plane that worked. Zero after a pass, so a combination rejected while some other state was wrong stops being penalized once it succeeds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestCache
impl RefUnwindSafe for TestCache
impl Send for TestCache
impl Sync for TestCache
impl Unpin for TestCache
impl UnsafeUnpin for TestCache
impl UnwindSafe for TestCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more