From bcf90de8ba2ea087540a5f632656ef880ee46b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 9 Dec 2025 18:33:09 +0100 Subject: [PATCH 1/7] gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (#142455) Co-authored-by: Ken Jin --- .../next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst | 4 ++++ Tools/jit/_targets.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst diff --git a/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst b/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst new file mode 100644 index 00000000000000..4de16866f28851 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst @@ -0,0 +1,4 @@ +When calculating the digest of the JIT stencils input, sort the hashed files +by filenames before adding their content to the hasher. This ensures +deterministic hash input and hence deterministic hash, independent on +filesystem order. diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index adb8a8d8ecb8a1..f92f3eac13bde5 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -76,7 +76,7 @@ def _compute_digest(self) -> str: # Exclude cache files from digest computation to ensure reproducible builds. if dirpath.endswith("__pycache__"): continue - for filename in filenames: + for filename in sorted(filenames): hasher.update(pathlib.Path(dirpath, filename).read_bytes()) return hasher.hexdigest() From 09d6bf20b67f4d3001afac9d20886a6e9cbcc94f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:45:52 +0000 Subject: [PATCH 2/7] Tachyon: Fix unesecarry plural when there is a single file/sample (#142478) --- Lib/profiling/sampling/heatmap_collector.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/profiling/sampling/heatmap_collector.py b/Lib/profiling/sampling/heatmap_collector.py index e1454f0663a439..f705fbe3a32eb9 100644 --- a/Lib/profiling/sampling/heatmap_collector.py +++ b/Lib/profiling/sampling/heatmap_collector.py @@ -335,12 +335,14 @@ def render_hierarchical_html(self, trees: Dict[str, TreeNode]) -> str: icon = '▶' if is_collapsed else '▼' content_style = ' style="display: none;"' if is_collapsed else '' + file_word = "file" if tree.count == 1 else "files" + sample_word = "sample" if tree.samples == 1 else "samples" section_html = f'''
{icon} {type_names[module_type]} - ({tree.count} files, {tree.samples:,} samples) + ({tree.count} {file_word}, {tree.samples:,} {sample_word})
''' @@ -380,11 +382,14 @@ def _render_folder(self, node: TreeNode, name: str, level: int = 1) -> str: parts = [] # Render folder header (collapsed by default) + file_word = "file" if node.count == 1 else "files" + sample_word = "sample" if node.samples == 1 else "samples" parts.append(f'{indent}