Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tests/startup_memory_srv_diag_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
r"mips=10 layout=0x0 flags=0x0 calls=1")
TOKENS = r"x2w-draw token texture nulls: total 1 in 1 pipelines; ([0-9a-f]{16})=1 other=0"
WRITES = r"x2w-d3d12 memory SRV writes \(slot 70\): calls 1, distinct entries 1 \(untracked 0\)"
# The direct-draw and clear censuses that share the report (#3482); only their prefix is fixed here.
CLEAR_CENSUS = r"x2w-render clear (census|rtv)[: ].*"
WRITTEN = (r"x2w-d3d12 memory SRV written 1: dest=0x[0-9a-f]+ address=0x[0-9a-f]+ "
r"res\{dim=3 fmt=61 size=2x2x1 mips=1 layout=0x0 flags=0x0 align=0 samples=1/0\} "
r"view\{dim=4 fmt=61 map=0x1688 mostmip=0 mips=1 plane=0 clamp=0\}")
Expand Down Expand Up @@ -72,8 +74,8 @@ def check(directory, consumer, backend, control=False):
raise AssertionError(f"column 1 row {y}: {right.hex()}, expected the R8 texel")

lines = census_block(result.stdout)
if len(lines) != 4:
raise AssertionError("census report is not four lines:\n" + "\n".join(lines))
if len(lines) < 4:
raise AssertionError("census report has fewer than four lines:\n" + "\n".join(lines))
if not re.fullmatch(REFUSALS, lines[0]):
raise AssertionError(f"refusal counts\n line {lines[0]}\n expected {REFUSALS}")
if not re.fullmatch(SHAPE, lines[1]):
Expand All @@ -83,6 +85,11 @@ def check(directory, consumer, backend, control=False):
raise AssertionError(f"token nulls\n line {lines[2]}\n expected {TOKENS}")
if not re.fullmatch(WRITES, lines[3]):
raise AssertionError(f"slot 70 writes\n line {lines[3]}\n expected {WRITES}")
# The report also carries the direct-draw and clear censuses (#3482); they are not this check's
# subject, but nothing else may appear in the block.
for line in lines[4:]:
if not re.fullmatch(CLEAR_CENSUS, line):
raise AssertionError(f"unexpected census line\n line {line}\n expected {CLEAR_CENSUS}")

log = trap_log.read_text(errors="replace").splitlines()
slot70 = [line for line in log if "Device::slot70" in line]
Expand Down
Loading