From 0d5e20434c880696bfc0e31f496789478f0d08ed Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Fri, 7 Aug 2026 12:07:52 +0900 Subject: [PATCH] fix(verify): a missing GPU core count is a gap, not a contradiction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 --- app/verify/signals.py | 28 ++++++++++++++++++++-------- tests/verify/test_signals.py | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/app/verify/signals.py b/app/verify/signals.py index 7e29dd9..00b8316 100644 --- a/app/verify/signals.py +++ b/app/verify/signals.py @@ -132,18 +132,30 @@ def gpu_signals(rec: dict[str, Any], now_year: int) -> list[Signal]: _cmp_ge("boost_ge_base", rec.get("boost_clock_mhz"), rec.get("base_clock_mhz"), hard=True), _release_not_future(rec, now_year), ] - # Vendor core field present: nvidia -> cuda_cores, amd/intel -> stream_processors. + # The core count belongs in the vendor's own field: nvidia -> cuda_cores, + # amd/intel -> stream_processors. Carrying the OTHER vendor's field is a + # contradiction and is flagged. Carrying NEITHER is not: it is an absence, + # which `completeness` already scores (both fields are gpu RICH_FIELDS), and + # scoring it here too charged the same gap twice under a name that claims the + # record disagrees with itself. It also misread pre-unified-shader parts — + # an NV1 or a RIVA 128 predates the concept of a CUDA core, so the field is + # inapplicable rather than missing. Of 281 records flagged before this + # change, 279 were plain gaps and 2 were real vendor mismatches. mfr = str(rec.get("manufacturer") or "").lower() + cuda, stream = _num(rec.get("cuda_cores")), _num(rec.get("stream_processors")) if mfr == "nvidia": - has_core = _num(rec.get("cuda_cores")) is not None + own, foreign = cuda, stream elif mfr in {"amd", "intel"}: - has_core = _num(rec.get("stream_processors")) is not None + own, foreign = stream, cuda else: - has_core = ( - _num(rec.get("cuda_cores")) is not None - or _num(rec.get("stream_processors")) is not None - ) - out.append(Signal("vendor_core_field", "pass" if has_core else "fail", hard=False)) + own, foreign = (cuda if cuda is not None else stream), None + if own is not None: + result = "pass" + elif foreign is not None: + result = "fail" # the count is filed under the wrong vendor's field + else: + result = "na" + out.append(Signal("vendor_core_field", result, hard=False)) # RT / Tensor cores only plausible on post-2018 (Turing / RDNA2) parts. y = _year_of(rec.get("release_date")) rt = _num(rec.get("rt_cores")) diff --git a/tests/verify/test_signals.py b/tests/verify/test_signals.py index a601d6d..f20bd7a 100644 --- a/tests/verify/test_signals.py +++ b/tests/verify/test_signals.py @@ -103,3 +103,22 @@ def test_real_soc_date_is_compared_exactly(): def test_soc_process_nm_era(): rec = {"process_nm": 5.0, "release_date": "2010-01-01", "gpu_name": "x"} assert _named(signals.soc_signals(rec, NOW), "process_nm_era").result == "fail" + + +def test_missing_core_count_is_not_a_contradiction(): + """An absent core count is a gap `completeness` already scores — and on a + pre-unified-shader part the field does not apply at all.""" + riva = {"manufacturer": "nvidia", "name": "RIVA 128", "release_date": "1997-08-25"} + assert _named(signals.gpu_signals(riva, NOW), "vendor_core_field").result == "na" + + +def test_core_count_under_the_wrong_vendor_field_fails(): + rec = {"manufacturer": "amd", "cuda_cores": 2048, "release_date": "2020-01-01"} + assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "fail" + rec = {"manufacturer": "nvidia", "stream_processors": 2048, "release_date": "2020-01-01"} + assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "fail" + + +def test_core_count_in_the_right_field_passes(): + rec = {"manufacturer": "amd", "stream_processors": 2048, "release_date": "2020-01-01"} + assert _named(signals.gpu_signals(rec, NOW), "vendor_core_field").result == "pass"