SIGN IN SIGN UP

fix: keep Level Zero memory provenance in sync (#401)

## Summary

Re-read the Level Zero apply layer against the Linux sysfs and Windows WMI/DXGI/PDH precedence contracts. The two archived defects were already fixed by #365: a Sysman dedicated carve-out no longer replaces a Windows shared aperture, and `Metrics Source` appends layers instead of erasing them. The fresh audit found one remaining provenance defect: when a dedicated Sysman sample replaced `used_memory`, `Source: Memory Used` still claimed the older PDH source.

## What changed

- Record `Level Zero Sysman` as the used-memory source whenever a fresh dedicated/local Sysman sample wins.
- Extend focused tests to prove Linux and discrete Windows samples update the used-memory provenance together with the value.
- Extend the integrated Windows regression shape to prove a DXGI shared aperture preserves both the PDH shared-usage value and its source when the Sysman dedicated pool is only a stolen-memory carve-out.

## Review findings

- Correctness: the source label now follows the exact overwrite branch that changes `used_memory`, while the shared-aperture branch remains untouched.
- Security: no input handling, unsafe code, FFI calls, or trust boundaries changed.
- Performance: the winning dedicated-memory path performs one additional detail-map update per refresh; no polling, allocation topology, or hardware query behavior changed.
- Finalization: focused regression coverage, formatting, compilation, and lint checks pass; no documentation change is needed for this correction to an existing detail-key contract.

## Test plan

- [x] `cargo test --lib device::readers::intel_gpu_level_zero::tests::apply::`
- [x] `cargo fmt --check`
- [x] `cargo check --lib --tests`
- [x] `cargo clippy --lib --tests -- -D warnings`

Closes #377
J
Jeongkyu Shin committed
730f6e775caff9d3393e0ca637de740f7ebfeb6d
Parent: d602fe6
Committed by GitHub <noreply@github.com> on 8/24/2026, 3:09:15 PM