diff --git a/drivers/gpu/drm/asahi/g16/engine.rs b/drivers/gpu/drm/asahi/g16/engine.rs index 2d8e1ccdd30c3..d317e40db5042 100644 --- a/drivers/gpu/drm/asahi/g16/engine.rs +++ b/drivers/gpu/drm/asahi/g16/engine.rs @@ -294,6 +294,19 @@ fn plan_render_barriers( } } +/// Whether the TA ring's own order already holds TA(N) behind TA(N-1), so that the TA->TA +/// `prev_barrier` of [`plan_render_barriers`] would only re-check a stamp the ring implies. +/// +/// Every render's TA work goes on the one firmware TA queue, whose works the firmware runs in +/// ring order: on Metal's TA ring, which carries no barriers, each pass's tiling starts after +/// the previous pass's tiling has ended. A same-VM predecessor shares this render's parameter +/// buffer and UMA slot only through that order. A predecessor of another VM +/// (`cross_vm_prev`, its own UMA slot and the conflict of [`msaa_render_conflict`]) and any +/// InitBM producer or consumer (`producer_initbm`) keep the barrier. +fn ta_ring_orders_prev(cross_vm_prev: bool, producer_initbm: bool) -> bool { + !cross_vm_prev && !producer_initbm +} + /// Whether the FS ring's own order already holds FS(N) behind FS(N-1), so that the FS->FS /// `fs_dep` barrier of [`plan_render_barriers`] would only re-check a stamp the ring implies. /// @@ -459,6 +472,9 @@ struct Prefix { last_fs: u32, /// Compute commands staged onto the VM's shared compute UMA descriptor in this prefix. uma_delta: u64, + /// Staged TA->TA barrier counts committed only after TA producer publication. + ta_prev: u64, + ta_order: u64, /// Staged FS->FS barrier counts committed only after TA producer publication. fs_dep: u64, fs_order: u64, @@ -544,6 +560,9 @@ pub(crate) struct Stats { pub(crate) job_cmds: u64, pub(crate) job_max: u64, pub(crate) early: u64, + /// TA->TA barriers posted, and those the TA ring's order made unnecessary. + pub(crate) ta_prev: u64, + pub(crate) ta_order: u64, /// FS->FS barriers posted, and those the FS ring's order made unnecessary. pub(crate) fs_dep: u64, pub(crate) fs_order: u64, @@ -3382,6 +3401,8 @@ impl Firmware { prefix.ta_head, &mut self.engine.stats.publications[1], )?; + self.engine.stats.ta_prev += prefix.ta_prev; + self.engine.stats.ta_order += prefix.ta_order; self.engine.stats.fs_dep = self.engine.stats.fs_dep.saturating_add(prefix.fs_dep); self.engine.stats.fs_order = self.engine.stats.fs_order.saturating_add(prefix.fs_order); @@ -4036,12 +4057,18 @@ impl Firmware { || fs_wait_render.is_some_and(|w| w.initbm) || ta_wait_fs.is_some_and(|w| w.initbm); let render_bar = cross_engine_barrier_type(producer_initbm, init_buffer); - // Pipelined renders share TA/FS pipes across same-VM and cross-VM flights, so keep - // the TA(N-1)->TA(N) `prev_barrier` (matching G15) whenever `plan.ta_fs_wait` does not - // already serialize behind `prev_fs`. Emit `ta_fs_barrier` only when `plan.ta_fs_wait` - // names an in-flight FS stamp, and `fs_dep` when `plan.fs_render_wait` names an - // in-flight FS dependency (or cross-VM `prev_fs`) not already dominated by TA. - if plan.ta_prev_wait { + // Pipelined renders share TA/FS pipes across same-VM and cross-VM flights. The plan + // asks for the TA(N-1)->TA(N) `prev_barrier` (matching G15) whenever `plan.ta_fs_wait` + // does not already serialize behind `prev_fs`; it is posted unless the TA ring's own + // order already holds TA(N) behind TA(N-1) (`ta_ring_orders_prev`). Emit + // `ta_fs_barrier` only when `plan.ta_fs_wait` names an in-flight FS stamp, and `fs_dep` + // when `plan.fs_render_wait` names an in-flight FS dependency (or cross-VM `prev_fs`) + // not already dominated by TA. + let ta_ordered = ta_ring_orders_prev(cross_vm_prev, producer_initbm); + if plan.ta_prev_wait && ta_ordered { + pf.ta_order += 1; + } + if plan.ta_prev_wait && !ta_ordered { let prev = encode::barrier( r.fw_stamp[0].va, prev_ta, @@ -4053,6 +4080,7 @@ impl Firmware { p.prev_barrier.write(0, &prev)?; r.ring[0].w64(8 * pf.ta_head as usize, p.prev_barrier.va)?; pf.ta_head = (pf.ta_head + 1) % cap; + pf.ta_prev += 1; } if let Some(wait_fs) = plan.ta_fs_wait { let ta_fs = encode::barrier( diff --git a/drivers/gpu/drm/asahi/g16/hw.rs b/drivers/gpu/drm/asahi/g16/hw.rs index df06f69a5aba7..4dfae0b0c414f 100644 --- a/drivers/gpu/drm/asahi/g16/hw.rs +++ b/drivers/gpu/drm/asahi/g16/hw.rs @@ -1298,10 +1298,14 @@ pub(crate) mod sizes { pub(crate) const COALESCE_WINDOW_NS: u64 = (COALESCE_WINDOW_US as u64) * 1000; /// Per-queue retired CDM execution EWMA threshold (microseconds) at or above which /// barrier-free compute fans out across both CDM pipes instead of staying 1-pipe affine. - pub(crate) const COMPUTE_HEAVY_EMA_US: u32 = 200; + /// Light dispatches, a few tens of microseconds each, stay well below it and keep folding + /// on one pipe; heavy dispatches of about 185 us clear it with room to get faster. + pub(crate) const COMPUTE_HEAVY_EMA_US: u32 = 140; /// Elapsed wall-clock time (nanoseconds) on a sole active single-command compute flight /// that immediately classifies the queue as heavy before its first retirement updates EWMA. - pub(crate) const COMPUTE_HEAVY_INFLIGHT_NS: u64 = 180_000; + /// It is the same crossover as [`COMPUTE_HEAVY_EMA_US`], so a queue the probe promotes + /// stays heavy once its retired dispatches feed the EWMA. + pub(crate) const COMPUTE_HEAVY_INFLIGHT_NS: u64 = COMPUTE_HEAVY_EMA_US as u64 * 1000; /// Jobs admitted to the engine per logical queue: enough to keep deep queues (`d=64`) /// queued back to back without scheduler backpressure stalls; exact prior-command /// dependencies still gate each one. diff --git a/drivers/gpu/drm/asahi/g16/poll.rs b/drivers/gpu/drm/asahi/g16/poll.rs index 76a71b28e929e..658764fcdffc3 100644 --- a/drivers/gpu/drm/asahi/g16/poll.rs +++ b/drivers/gpu/drm/asahi/g16/poll.rs @@ -2356,6 +2356,11 @@ impl Firmware { self.slots.tilemap_clear_bytes_total() )?; writeln!(f, "type0: fs2c {} c2ta {}", s.fs2c0, s.c2ta0)?; + writeln!( + f, + "ta_prev: barriers {} ring_ordered {}", + s.ta_prev, s.ta_order + )?; writeln!(f, "fs_ring: dep {} order {}", s.fs_dep, s.fs_order)?; write!(f, "horizon:")?; for n in s.hz.iter() { diff --git a/tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py b/tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py index 362bccb879773..78742ab48be11 100644 --- a/tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py +++ b/tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py @@ -42,6 +42,8 @@ def item(declaration): assert 'DRM_ASAHI_FEATURE_INDEPENDENT_QUEUES' in gpu_src max_queues_line = next(line for line in hw_src.splitlines() if 'const MAX_QUEUES:' in line) flights_line = next(line for line in hw_src.splitlines() if 'const FLIGHTS:' in line) +heavy_limits = [line.strip() for line in hw_src.splitlines() if 'const COMPUTE_HEAVY_' in line] +assert len(heavy_limits) == 2, heavy_limits assert 'const COMPUTE_SLOTS: usize = COMPUTE_UNITS;' in hw_src assert 'const HORIZON_JOBS: u32 = COMPUTE_UNITS as u32;' in hw_src prefix_render_fn = item('fn prefix_render(') @@ -54,6 +56,18 @@ def item(declaration): ), 'render_bar must be hoisted ahead of barrier emission' assert prefix_render_fn.count('render_bar,') == 5, prefix_render_fn assert 'p.prev_barrier.write(0, &prev)?;' in prefix_render_fn +# The TA->TA barrier is posted exactly when the plan asks for it and the TA ring's order +# does not already imply it, decided after every InitBM producer is known. +assert 'if plan.ta_prev_wait && !ta_ordered {' in prefix_render_fn +assert ( + prefix_render_fn.index('let producer_initbm = pf.initbm') + < prefix_render_fn.index('let ta_ordered = ta_ring_orders_prev(cross_vm_prev, producer_initbm);') + < prefix_render_fn.index('if plan.ta_prev_wait && !ta_ordered {') + < prefix_render_fn.index('p.prev_barrier.write(0, &prev)?;') +), 'prev_barrier must follow the ring-order decision' +# Barrier stats are staged on `Prefix` and committed only on TA producer publication. +assert 'stats.ta_prev' not in prefix_render_fn and 'stats.ta_order' not in prefix_render_fn +assert 'pf.ta_order += 1;' in prefix_render_fn and 'pf.ta_prev += 1;' in prefix_render_fn # The VM mark waits for visibility: an unpublished prefix never marks its VM. assert 'note_msaa_render' not in prefix_render_fn assert 'f.msaa |= cmd.is_multisampled();' in prefix_render_fn @@ -224,7 +238,7 @@ def item(declaration): // containment branch below decides whether the unit becomes claimable again. pub fn validate_compute_descriptor(refs:&ComputeRefs,_old:&[u8;160],_before:u64)->Result<(),()>{if refs.invalid{Err(())}else{Ok(())}} } -mod hw { pub mod sizes { pub const FLIGHTS:usize=32; pub const COMPUTE_PIPES:usize=8; pub const MAX_VM_COMPUTE_PIPES:usize=2; pub const COMPUTE_UNITS:usize=24; pub const PIPE1_COMPUTE_START:usize=6; pub const COMPUTE_SLOTS:usize=24; pub const RENDER_SLOTS:usize=48; pub const COALESCE_MAX_CMDS:usize=6; pub const COALESCE_WINDOW_US:u32=18; pub const COALESCE_WINDOW_NS:u64=18_000; pub const COMPUTE_HEAVY_EMA_US:u32=200; pub const COMPUTE_HEAVY_INFLIGHT_NS:u64=180_000; } } +mod hw { pub mod sizes { pub const FLIGHTS:usize=32; pub const COMPUTE_PIPES:usize=8; pub const MAX_VM_COMPUTE_PIPES:usize=2; pub const COMPUTE_UNITS:usize=24; pub const PIPE1_COMPUTE_START:usize=6; pub const COMPUTE_SLOTS:usize=24; pub const RENDER_SLOTS:usize=48; pub const COALESCE_MAX_CMDS:usize=6; pub const COALESCE_WINDOW_US:u32=18; pub const COALESCE_WINDOW_NS:u64=18_000; __HEAVY_LIMITS__ } } mod command {pub const RENDER:usize=0;pub const COMPUTE:usize=1;} thread_local!{static CLOCK:std::cell::Cell=const{std::cell::Cell::new(0)};} fn now_ns()->u64{CLOCK.with(|clock|clock.get())} @@ -819,6 +833,7 @@ def item(declaration): #[derive(Copy, Clone, Debug, PartialEq, Eq)] __RENDER_BARRIER_PLAN__ __PLAN_RENDER_BARRIERS__ + __TA_RING_ORDERS_PREV__ __SCS_COMPUTE_CONFLICT__ __COMPUTE_UMA_CONFLICT__ __MSAA_RENDER_CONFLICT__ @@ -1847,6 +1862,15 @@ def item(declaration): } ); } + #[test]fn ta_ring_order_replaces_only_the_same_vm_ta_barrier(){ + // A same-VM predecessor with no InitBM on either side: the plan's TA->TA wait is + // left to the TA ring's order (case 2 above still plans it). + assert!(ta_ring_orders_prev(false, false)); + // Another VM's predecessor, or an InitBM producer or consumer, keeps prev_barrier. + assert!(!ta_ring_orders_prev(true, false)); + assert!(!ta_ring_orders_prev(false, true)); + assert!(!ta_ring_orders_prev(true, true)); + } #[test]fn two_pipe_concurrent_compute_dispatch_and_fw_timestamp_safety(){ let vm1=Arc::new(Vm{id:1,status:Status(AtomicU32::new(0)),slot:1,msaa:AtomicBool::new(false)}); let vm2=Arc::new(Vm{id:2,status:Status(AtomicU32::new(0)),slot:2,msaa:AtomicBool::new(false)}); @@ -1877,17 +1901,23 @@ def item(declaration): cstamp:[0x100;16],r_ta_stamp:[0;16],r_fs_stamp:[0;16],fs_target:0,initbm:false, has_timestamps:false,doomed:false,recovery_suspect:false, }); - // Cold-start heavy probe: sole single-command compute flight becomes heavy at >= 180 us. - assert!(!host.compute_queue_is_heavy(&q1, 1_179_999)); - assert!(host.compute_queue_is_heavy(&q1, 1_180_000)); + // Cold-start heavy probe: sole single-command compute flight becomes heavy at >= 140 us. + assert!(!host.compute_queue_is_heavy(&q1, 1_139_999)); + assert!(host.compute_queue_is_heavy(&q1, 1_140_000)); // Folded multi-command light flight does not trigger the cold-start probe. host.engine.flights[0].computes = 3; assert!(!host.compute_queue_is_heavy(&q1, 2_000_000)); host.engine.flights[0].computes = 1; - // Per-queue retired hardware CDM EWMA transitions cleanly at 200 us. + // The retired EWMA crosses over at the probe's 140 us, after the probe has expired. + q1.note_compute_us(139); + assert!(!host.compute_queue_is_heavy(&q1, 1_050_000)); + q1.note_compute_us(141); + assert!(host.compute_queue_is_heavy(&q1, 1_050_000)); + q1.compute_ewma_us.store(0, Ordering::Relaxed); + // The EWMA follows subsequent changes in the stream. q1.note_compute_us(30); assert!(!host.compute_queue_is_heavy(&q1, 1_050_000)); - q1.note_compute_us(500); + q1.note_compute_us(300); assert!(host.compute_queue_is_heavy(&q1, 1_050_000)); q1.note_compute_us(20); assert!(!host.compute_queue_is_heavy(&q1, 1_050_000)); @@ -2948,7 +2978,7 @@ def item(declaration): h.engine.pending = vec![mk_job(&vm1, &q1, false, 3, [None, Some(2)])]; assert_eq!(h.defer_busy_coalesce(400_000), None); - // Heavy compute queue (EWMA >= 200 us) bypasses busy coalescing so 2-pipe fanout runs immediately. + // Heavy compute queue (EWMA >= 140 us) bypasses busy coalescing so 2-pipe fanout runs immediately. h.engine.pending = vec![mk_job(&vm1, &q1, false, 3, [None, None])]; q1.note_compute_us(500); assert_eq!(h.defer_busy_coalesce(420_000), None); @@ -3044,7 +3074,11 @@ def item(declaration): group: Group(vec![]), msaa: false, compute_uma_mask: 0, pb: Some(Pb), pb_slot: 0 } } __MSAA_RENDER_CONFLICT__ - struct Prefix { draw: u64, ta_head: u32, fs_head: u32, renders: u32 } + #[derive(Default)] + struct Prefix { + draw: u64, ta_head: u32, fs_head: u32, renders: u32, + ta_prev: u64, ta_order: u64, fs_dep: u64, fs_order: u64, + } struct Cfg { num_clusters: u32, gpu_generation: u32 } struct Slots { pass_busy: u64, publish_fails: bool } impl Slots { @@ -3056,11 +3090,29 @@ def item(declaration): fn publish(&mut self, _c: &mut Claims) -> Result { if self.publish_fails { Err(EIO) } else { Ok(()) } } } struct Pools; impl Pools { fn hold_alloc(&mut self, _k: usize, _vm: &Arc, _a: u32, _l: u32) -> Result { Ok(()) } } - struct Engine { flights: Vec, pending: Vec> } - struct Host { cfg: Cfg, slots: Slots, pools: Pools, engine: Engine, prefixed: Vec<(u32, u32)> } + mod qstate { pub const WRITE: usize = 0; } + struct QState { fail: bool } + impl QState { + fn w32(&self, _off: usize, _v: u32) -> Result { + if self.fail { Err(EIO) } else { Ok(()) } + } + } + struct RenderGraph { qstate: [QState; 2] } + struct Graph { render: RenderGraph } + #[derive(Default)] + struct RenderStats { + publications: [u64; 2], ta_prev: u64, ta_order: u64, fs_dep: u64, fs_order: u64, + } + fn publish_producer(q: &QState, head: u32, count: &mut u64) -> Result { + q.w32(qstate::WRITE, head)?; + *count += 1; + Ok(()) + } + struct Engine { flights: Vec, pending: Vec>, stats: RenderStats } + struct Host { cfg: Cfg, slots: Slots, pools: Pools, graph: Graph, engine: Engine, prefixed: Vec<(u32, u32)>, recovery: bool } impl Host { __MSAA_MEMBER_ALLOWED__ - fn recovery_pending(&self) -> Result { Ok(false) } + fn recovery_pending(&self) -> Result { Ok(self.recovery) } fn wait_compute_stamps_for(&self, _j: &Arc, _t: Option) -> Result { Ok(()) } fn wait_stamp_for_with(&self, _j: &Arc, _c: usize, _t: Option, _f: Option<&Flight>) -> Result { Ok(()) } #[allow(clippy::too_many_arguments)] @@ -3077,7 +3129,7 @@ def item(declaration): fn fold(&mut self, job: &Arc, f: &mut Flight, more: usize) -> Result { let index = 0u32; let mut end = 1u32; - let mut prefix = Prefix { draw: 1, ta_head: 0, fs_head: 0, renders: 1 }; + let mut prefix = Prefix { draw: 1, renders: 1, ..Prefix::default() }; let (ta_read, fs_read) = (0u32, 0u32); let (behind, class_behind) = (true, true); let stage_prefix = kernel::uapi::drm_asahi_render_flags_DRM_ASAHI_RENDER_STAGE_PREFIXES; @@ -3094,10 +3146,23 @@ def item(declaration): if fail_after { return Err(EIO); } Ok(()) } + fn publish_render_producers(&mut self, job: &Arc, f: &mut Flight, prefix: &Prefix, visible: &mut bool) -> Result { + let render = true; + __PUBLICATION_PROLOGUE__ + __RENDER_PRODUCER_PUBLICATION__ + Ok(()) + } } fn host(flights: Vec, pending: Vec>) -> Host { - Host { cfg: Cfg { num_clusters: 1, gpu_generation: 16 }, slots: Slots { pass_busy: 1, publish_fails: false }, pools: Pools, - engine: Engine { flights, pending }, prefixed: vec![] } + Host { + cfg: Cfg { num_clusters: 1, gpu_generation: 16 }, + slots: Slots { pass_busy: 1, publish_fails: false }, + pools: Pools, + graph: Graph { render: RenderGraph { qstate: [QState { fail: false }, QState { fail: false }] } }, + engine: Engine { flights, pending, stats: RenderStats::default() }, + prefixed: vec![], + recovery: false, + } } #[test] fn same_submit_fold_splits_before_a_multisampled_member_beside_another_vm() { let (vm1, vm2, q1, q2) = (vm(1), vm(2), Arc::new(Queue), Arc::new(Queue)); @@ -3178,6 +3243,36 @@ def item(declaration): assert!(visible && !v3.renders_msaa()); let _ = (EAGAIN, EINVAL); } + #[test] fn render_barrier_stats_commit_only_on_ta_producer_publication() { + let q = Arc::new(Queue); + let v = vm(1); + let j = job(1, &v, &q, 1, &[LIGHT]); + let prefix = Prefix { + draw: 1, ta_head: 4, fs_head: 5, renders: 1, + ta_prev: 2, ta_order: 3, fs_dep: 4, fs_order: 5, + }; + // Rejected by recovery_pending (-EAGAIN) before visibility: staged counts are discarded. + let mut h = host(vec![], vec![]); + h.recovery = true; + let (mut f, mut visible) = (flight(&j, 1), false); + assert_eq!(h.publish_render_producers(&j, &mut f, &prefix, &mut visible), Err(EAGAIN)); + assert!(!visible && h.engine.stats.ta_prev == 0 && h.engine.stats.ta_order == 0); + assert_eq!((h.engine.stats.fs_dep, h.engine.stats.fs_order), (0, 0)); + // TA producer publication fails: counts do not advance. + let mut h = host(vec![], vec![]); + h.graph.render.qstate[0].fail = true; + let (mut f, mut visible) = (flight(&j, 1), false); + assert_eq!(h.publish_render_producers(&j, &mut f, &prefix, &mut visible), Err(EIO)); + assert!(visible && h.engine.stats.ta_prev == 0 && h.engine.stats.ta_order == 0); + assert_eq!((h.engine.stats.fs_dep, h.engine.stats.fs_order), (0, 0)); + // TA producer publishes cleanly: staged counts commit alongside publications[1]. + let mut h = host(vec![], vec![]); + let (mut f, mut visible) = (flight(&j, 1), false); + assert_eq!(h.publish_render_producers(&j, &mut f, &prefix, &mut visible), Ok(())); + assert!(visible && h.engine.stats.publications[1] == 1); + assert_eq!((h.engine.stats.ta_prev, h.engine.stats.ta_order), (2, 3)); + assert_eq!((h.engine.stats.fs_dep, h.engine.stats.fs_order), (4, 5)); + } } __FS_RING_ORDERS_PREV__ @@ -3202,12 +3297,18 @@ def item(declaration): _prologue_end = source.index(' let publication = (|| -> Result {', _prologue_start) _prologue = source[_prologue_start:_prologue_end] assert '*visible = true;' in _prologue and 'job.vm.note_msaa_render();' in _prologue +_ta_pub_start = source.index(' publish_producer(\n &self.graph.render.qstate[0],', _prologue_end) +_ta_pub_end = source.index(' } else {', _ta_pub_start) +_ta_pub = source[_ta_pub_start:_ta_pub_end] +assert 'self.engine.stats.ta_prev += prefix.ta_prev;' in _ta_pub +assert 'self.engine.stats.ta_order += prefix.ta_order;' in _ta_pub _scope_start = harness.index('mod msaa_fold_scope {') _scope = harness[_scope_start:] for token, text in { '__SAME_SUBMIT_FOLD__': _same_fold, '__HORIZON_FOLD__': _horizon_fold, '__PUBLICATION_PROLOGUE__': _prologue, + '__RENDER_PRODUCER_PUBLICATION__': _ta_pub, '__IS_MULTISAMPLED__': item_in(command_src, 'pub(crate) fn is_multisampled('), '__RENDERS_MSAA__': item_in(vm_src, 'pub(crate) fn renders_msaa('), '__NOTE_MSAA_RENDER__': item_in(vm_src, 'pub(crate) fn note_msaa_render('), @@ -3223,6 +3324,7 @@ def item(declaration): harness = harness.replace('__USAGE__', str(production.parent.parent / 'usage.rs')) harness = harness.replace('__FLIGHTS_LINE__', flights_line.strip()) harness = harness.replace('__MAX_QUEUES_LINE__', max_queues_line.strip()) +harness = harness.replace('__HEAVY_LIMITS__', ' '.join(heavy_limits)) harness = harness.replace('__QUEUE_LIMITS_FN__', item_in(params_src, 'pub(crate) fn queue_limits()')) harness = harness.replace('__GPU_QUEUE_LIMITS_FN__', gpu_limits_fn) harness = harness.replace('__QUEUE_CREDIT_STRUCT__', item_in(queue_src, 'struct QueueCredit {')) @@ -3300,6 +3402,7 @@ def item(declaration): '__CROSS_ENGINE_BARRIER_TYPE__': 'const fn cross_engine_barrier_type(', '__RENDER_BARRIER_PLAN__': 'struct RenderBarrierPlan {', '__PLAN_RENDER_BARRIERS__': 'fn plan_render_barriers(', + '__TA_RING_ORDERS_PREV__': 'fn ta_ring_orders_prev(', '__FS_RING_ORDERS_PREV__': 'fn fs_ring_orders_prev(', }.items(): harness = harness.replace(token, item(declaration).replace("super::command::", "crate::command::").replace("super::recovery::", "crate::recovery::").replace("super::hw::", "crate::hw::").replace("super::resources::", "crate::resources::").replace("super::queue::QueueState", "crate::Queue").replace("super::vm::VmState", "crate::Vm").replace("super::fence::", "crate::fence::")) @@ -3314,9 +3417,11 @@ def item(declaration): (output/'publication.log').write_text(log) if result.returncode: raise SystemExit(result.returncode) +passed_match = re.search(r'test result: ok\. (\d+) passed; 0 failed;', log) +assert passed_match, f'could not parse test count from:\n{log}' (output/'publication.json').write_text(json.dumps({ 'passed': True, - 'tests': int(re.search(r'^test result: ok\. (\d+) passed;', log, re.MULTILINE)[1]), + 'tests': int(passed_match.group(1)), 'cpu_only': True, 'hardware_execution': False, 'scope': 'Verbatim production publication wrapper, selection, error isolation and descriptor-error containment branch; wire encoder, descriptor failure injection and transport replaced by CPU recorders.', 'source_sha256': sha(production),