Skip to content

Commit 5ceaa2f

Browse files
committed
Leave threads unknown when a table gives only a core count
parse_cores_threads("16") returned (16, 16). The Atom and Xeon list pages have a bare "Cores" column, so Hyper-Threaded parts (Tunnel Creek, Centerton, Broadwell-EX...) came out with half their real thread count. Return (16, None) so such rows stay drafts instead of guessing.
1 parent 8d9a798 commit 5ceaa2f

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎app/ingest/normalize.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,18 @@ def parse_int(text: str) -> int | None:
121121

122122

123123
def parse_cores_threads(text: str) -> tuple[int | None, int | None]:
124-
"""``"8 / 16"`` → ``(8, 16)``; ``"16"`` → ``(16, 16)`` (assumes SMT)."""
124+
"""``"8 / 16"`` → ``(8, 16)``; ``"16"`` → ``(16, None)``.
125+
126+
A bare core count says nothing about SMT, so threads stay unknown rather
127+
than guessed (Atom/Xeon tables list "Cores" only; many of those parts have HT).
128+
"""
125129
if not text:
126130
return (None, None)
127131
nums = re.findall(r"\d+", text)
128132
if not nums:
129133
return (None, None)
130134
if len(nums) == 1:
131-
cores = int(nums[0])
132-
return (cores, cores)
135+
return (int(nums[0]), None)
133136
return (int(nums[0]), int(nums[1]))
134137

135138

‎tests/unit/test_ingest_normalize.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_parse_cache_mb(text: str, expected: float | None) -> None:
8686
"text,expected",
8787
[
8888
("8 / 16", (8, 16)),
89-
("16", (16, 16)),
89+
("16", (16, None)),
9090
("24/32", (24, 32)),
9191
("", (None, None)),
9292
],

0 commit comments

Comments
 (0)