Skip to content

Commit 0d5e204

Browse files
committed
fix(verify): a missing GPU core count is a gap, not a contradiction
`vendor_core_field` failed whenever cuda_cores (nvidia) or stream_processors (amd/intel) was absent. Both are gpu RICH_FIELDS, so `completeness` already scores that absence — charging it again under `consistency` billed one gap twice, under a name that claims the record disagrees with itself. It also misread early hardware: the flagged records include the NV1, RIVA 128, RIVA TNT and GeForce 256, all of which predate the unified shader. A CUDA core count is inapplicable there, not missing. Of the 281 records carrying the flag, 279 have neither field set and 2 genuinely file the count under the other vendor's field. Only that second case is a contradiction, so only it still fails; an absence is now "na". Refs #1
1 parent b510556 commit 0d5e204

2 files changed

Lines changed: 39 additions & 8 deletions

File tree

app/verify/signals.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,30 @@ def gpu_signals(rec: dict[str, Any], now_year: int) -> list[Signal]:
132132
_cmp_ge("boost_ge_base", rec.get("boost_clock_mhz"), rec.get("base_clock_mhz"), hard=True),
133133
_release_not_future(rec, now_year),
134134
]
135-
# Vendor core field present: nvidia -> cuda_cores, amd/intel -> stream_processors.
135+
# The core count belongs in the vendor's own field: nvidia -> cuda_cores,
136+
# amd/intel -> stream_processors. Carrying the OTHER vendor's field is a
137+
# contradiction and is flagged. Carrying NEITHER is not: it is an absence,
138+
# which `completeness` already scores (both fields are gpu RICH_FIELDS), and
139+
# scoring it here too charged the same gap twice under a name that claims the
140+
# record disagrees with itself. It also misread pre-unified-shader parts —
141+
# an NV1 or a RIVA 128 predates the concept of a CUDA core, so the field is
142+
# inapplicable rather than missing. Of 281 records flagged before this
143+
# change, 279 were plain gaps and 2 were real vendor mismatches.
136144
mfr = str(rec.get("manufacturer") or "").lower()
145+
cuda, stream = _num(rec.get("cuda_cores")), _num(rec.get("stream_processors"))
137146
if mfr == "nvidia":
138-
has_core = _num(rec.get("cuda_cores")) is not None
147+
own, foreign = cuda, stream
139148
elif mfr in {"amd", "intel"}:
140-
has_core = _num(rec.get("stream_processors")) is not None
149+
own, foreign = stream, cuda
141150
else:
142-
has_core = (
143-
_num(rec.get("cuda_cores")) is not None
144-
or _num(rec.get("stream_processors")) is not None
145-
)
146-
out.append(Signal("vendor_core_field", "pass" if has_core else "fail", hard=False))
151+
own, foreign = (cuda if cuda is not None else stream), None
152+
if own is not None:
153+
result = "pass"
154+
elif foreign is not None:
155+
result = "fail" # the count is filed under the wrong vendor's field
156+
else:
157+
result = "na"
158+
out.append(Signal("vendor_core_field", result, hard=False))
147159
# RT / Tensor cores only plausible on post-2018 (Turing / RDNA2) parts.
148160
y = _year_of(rec.get("release_date"))
149161
rt = _num(rec.get("rt_cores"))

tests/verify/test_signals.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,22 @@ def test_real_soc_date_is_compared_exactly():
103103
def test_soc_process_nm_era():
104104
rec = {"process_nm": 5.0, "release_date": "2010-01-01", "gpu_name": "x"}
105105
assert _named(signals.soc_signals(rec, NOW), "process_nm_era").result == "fail"
106+
107+
108+
def test_missing_core_count_is_not_a_contradiction():
109+
"""An absent core count is a gap `completeness` already scores — and on a
110+
pre-unified-shader part the field does not apply at all."""
111+
riva = {"manufacturer": "nvidia", "name": "RIVA 128", "release_date": "1997-08-25"}
112+
assert _named(signals.gpu_signals(riva, NOW), "vendor_core_field").result == "na"
113+
114+
115+
def test_core_count_under_the_wrong_vendor_field_fails():
116+
rec = {"manufacturer": "amd", "cuda_cores": 2048, "release_date": "2020-01-01"}
117+
assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "fail"
118+
rec = {"manufacturer": "nvidia", "stream_processors": 2048, "release_date": "2020-01-01"}
119+
assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "fail"
120+
121+
122+
def test_core_count_in_the_right_field_passes():
123+
rec = {"manufacturer": "amd", "stream_processors": 2048, "release_date": "2020-01-01"}
124+
assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "pass"

0 commit comments

Comments
 (0)