edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Decode wall time and minor page faults for one `EC_AV1_PLANE_ALLOC` arm. |
| 2 | //! |
| 3 | //! The three closures lane-uballoc had to choose between (see |
| 4 | //! `lanes/av1uballoc.report.md`) are selected by `EC_AV1_PLANE_ALLOC` inside |
| 5 | //! the crate, not by a build flag -- see [`ec_av1`]'s `fresh_plane`. Measuring |
| 6 | //! them that way means all arms share one binary, one allocator state and one |
| 7 | //! machine, which three separate builds cannot do. |
| 8 | //! |
| 9 | //! ```text |
| 10 | //! EC_AV1_PLANE_ALLOC=zeroed cargo run -p ec-av1 --release --example alloc_timing -- s.obu |
| 11 | //! ``` |
| 12 | //! |
| 13 | //! One process does ONE decode and prints ONE line, so the harness interleaves |
| 14 | //! arms across processes instead of trusting one process's warm-up history: |
| 15 | //! |
| 16 | //! ```text |
| 17 | //! ALLOC_TIMING arm=zeroed frames=24 wall_ms=1234.567 minflt=61234 majflt=0 hash=8f2a... |
| 18 | //! ``` |
| 19 | //! |
| 20 | //! `hash` is FNV-1a over every picture's Y/U/V samples in decode order. It is |
| 21 | //! the cross-arm determinism evidence: identical `hash` on every arm means the |
| 22 | //! closure chosen does not move a single output sample. |
| 23 | use Instant; |
| 24 | |
| 25 | const FNV_OFFSET: u64 = 0xcbf2_9ce4_8422_2325; |
| 26 | const FNV_PRIME: u64 = 0x0000_0100_0000_01b3; |
| 27 | |
| 28 | /// Minor/major faults from `/proc/self/stat` fields 10 and 12, read around the |
| 29 | /// decode. A zeroed-from-the-kernel allocation and an explicit memset differ in |
| 30 | /// how many pages they actually touch, and that is the only cheap proxy for it |
| 31 | /// that does not need `perf`. |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 |