Zen 4 factorial measurement: four-way hardware interaction and a uProf counter-access question

Zen 4 factorial measurement: four-way hardware interaction and a uProf counter-access question

I’m a researcher at Metatron Dynamics working on a relational mathematics framework (ABR/ABRCE) applied to compute-substrate characterization. I’ve been running a structured hardware measurement study on an AMD Ryzen 5 7600X using AMD uProf and have reached a measurement boundary where input from AMD engineers would be particularly useful.

The measured result

I ran a 16-node factorial experiment across four declared factors on Zen 4:

  • A — Access pattern: sequential vs. scrambled

  • D — Dependency structure: independent vs. chain-8

  • S — Working-set size: S0 ≈ 4 MB vs. S1 ≈ 32 MB

  • B — Branch pattern: branch-free vs. data-dependent branching

Each node was measured under uProf assess_ext on a Ryzen 5 7600X / DDR5-5600 / Windows 11 system.

The resulting four-way interaction is:

I_{A,D,S,B} = 1.937

The value was independently reproduced through three paths through the 4-cube.

Within this declared experiment, the measured effect of changing one factor depends substantially on the states of the other factors. Access pattern, dependency structure, working-set size, and branching therefore cannot be treated as independent contributors to the measured hardware response in this domain.

Importantly, this result does not depend on resolving the remaining microarchitectural questions below. Those concern explanation of the measured behavior, not establishment of the interaction itself.

Following the interaction into assembly

To investigate one part of the result, I isolated a pointer-chase workload (chain-only) and emitted the release assembly.

The hot loop (.LBB13_3) contains nine instructions and two branches. It includes an exact-address stack store/load pair at 40(%rsp), with a bounds-check sequence (cmpq / jae) between the store and subsequent load.

The assembly therefore establishes the instruction structure associated with a store-to-load-forwarding candidate.

It does not establish the timing contribution of store-to-load forwarding, the intervening bounds check, or their microarchitectural interaction. Those remain open measurement questions.

Where the instrumentation stops

The chain-only loop contains two distinct load types per iteration:

  1. A load from 40(%rsp) associated with the stack recurrence / STLF candidate.

  2. A load from chain[current], the pointer chase, which may be serviced at different levels of the memory hierarchy depending on the state.

The available uProf assess_ext measurement aggregates relevant demand fills through ls_dmnd_fills_from_sys. I therefore cannot use that aggregate to assign refills independently to the two load types.

The events I would like to measure are:

  • ls_stlf — PMCx035

  • ls_bad_status2.stli_other — PMCx024, UMask 0x02

Neither appears in the uProf predefined event set exposed on this Ryzen 5 7600X configuration, and attempts to specify the raw event codes through AMDuProfCLI are rejected. Data Fabric counters likewise do not appear to be exposed through uProf on this desktop Ryzen configuration.

That leaves a fairly precise instrumentation boundary:

OC-DC-1: load-type-specific refill disaggregation cannot currently be established with the counters available to this experiment.

OC-STLI-1: STLI_OTHER changed from approximately 0 to 75.8 PTI between the chained+values and chain-only measurements, but its timing relation to CPI remains undeclared.

Questions for AMD engineers

1. Is there a supported method for collecting ls_stlf and ls_bad_status2.stli_other on Ryzen 7000 under Windows, either through AMD uProf or another AMD-accessible profiling interface?

2. If these events are not externally accessible on this platform, is there another counter or measurement method AMD would recommend for distinguishing the stack-recurrence behavior from the pointer-chase demand fills?

If those measurements require AMD-internal instrumentation, then I think we’ve reached a useful handoff point: the experiment provides a measured four-factor interaction of 1.937 on Zen 4 silicon, the unresolved relation has been localized to a specific measurement boundary, and the additional counters needed to investigate it are known.

More broadly, this experiment has been an interesting demonstration of something we’re exploring with relational characterization: rather than attempting to model the processor as an undifferentiated collection of every available counter, we expand the declared measurement domain when an observable result requires another relation to be resolved.

The CPU is complex enough that this discipline has become extremely useful.

The complete experiment—including the execution record, factorial measurements, assembly declaration, open-condition register, and processor relation ledger—is available here:

I’d be very interested in technical criticism of either the experiment or the interpretation, and especially in guidance from AMD engineers familiar with Zen 4 performance-monitoring event exposure.

@Robin_Macomber Hello, just quick question, have you done or have idea about ROCm Certification Programme Module2_V3? If you already had it then great if not, then I suggest you to take a look the (1) ROCm Orientation Setup & Containers: Learn the foundations of GPU computing and why GPUs excel at AI and HPC workloads. Explore the AMD ROCm software stack and HIP for portable GPU programming across AMD. (2) Instinct Architecture CDNA/RDNA & MI400 Roadmap: Explore AMD Instinct GPU hardware, from compute units and matrix engines to the memory hierarchy. Learn how GPU kernels map from threads and wavefronts to SIMD hardware. (3) ROCm Libraries PyTorch & AI Frameworks. (4) HIP Programming & Porting CUDA and (5) Performance Optimization & Profiling. Try Radeon 7900/7800/7700 *PRO W7900/W7800 use Architecture model RDNA 3 OR RDNA 4. For LLVM target use gfx1100/1101. Thanks

Hello, to address your questions 1) both events are collectible, just not through uProf on Windows. They’re named events in perf’s AMD tables on Linux. ls_stlf is event 0x35 and ls_bad_status2.stli_other is 0x24 with umask 0x02, exactly the codes you listed. So perf stat -e ls_stlf,ls_bad_status2.stli_other should work if you boot Linux on the same box. Nothing AMD internal is needed here, it’s a uProf exposure gap rather than a silicon one.
2) For that I’d reach for IBS rather than counters. Instruction Based Sampling tags individual ops and reports the data source for each sampled load, so you get attribution per instruction instead of one aggregate. That’s the tool built for exactly your OC-DC-1, and uProf does have IBS modes, so you may not have to leave Windows for it.

@Robin_Macomber I am truly apologies by unknowingly or not intentionally called you disrespectful as per your statements. It was a bit rush for me and I wanted to help you but not to hurt or disrespectful. Once again i am sorry to call you Hello and i will make sure it’s not happen again. Thank you for your understanding and consideration.

Its all good Abul thank you for trying to help I appreciate it :slight_smile:

@Robin_Macomber appreciated it.