[Chore] (docs, MobileGL, scripts, tools, .github): use US spelling in identifiers and file names

This commit is contained in:
BZLZHH
2026-10-31 20:06:22 +08:00
parent 4f50bedde0
commit 6d3b00e820
180 changed files with 1070 additions and 1073 deletions
+3 -3
View File
@@ -506,9 +506,9 @@ def self_test_parser():
depths = [e[0] for e in entries]
if depths != [1, 2, 3]:
problems.append("depths misparsed: {}".format(depths))
normalised = entries[-1][1] if entries else None
if normalised != "MobileGL/MG_State/GLState/SamplerState/SamplerObject.h":
problems.append("`../` spelling did not normalize: {}".format(normalised))
normalized = entries[-1][1] if entries else None
if normalized != "MobileGL/MG_State/GLState/SamplerState/SamplerObject.h":
problems.append("`../` spelling did not normalize: {}".format(normalized))
elif not find_violations(entries, PROBES[0]["Forbidden"], []):
problems.append("normalized path did not match the value-header forbidden list")
if problems:
+2 -2
View File
@@ -83,7 +83,7 @@ PACKAGES = ('clang-20', 'lld-20', 'libc++-20-dev', 'libc++abi-20-dev', 'libvulka
'libegl1-mesa-dev', 'libgles2-mesa-dev')
def normaliser(build_dir, deps_dir=None):
def normalizer(build_dir, deps_dir=None):
roots = [(str(Path(build_dir)), '@BUILD@'), (str(Path(build_dir).resolve()), '@BUILD@')]
if deps_dir:
roots += [(str(Path(deps_dir)), '@DEPS@'), (str(Path(deps_dir).resolve()), '@DEPS@')]
@@ -244,7 +244,7 @@ def read_image():
def fingerprint(build_dir, deps_dir=None):
build = Path(build_dir)
norm = normaliser(build, deps_dir)
norm = normalizer(build, deps_dir)
result = {
'cache': read_cache(build, norm),
'compile': read_compile(build, norm),
+1 -1
View File
@@ -32,7 +32,7 @@
"ApplyThreadJoinTimeout",
"ApplyThreadNotRunning",
"ArchiveEmpty",
"ArtefactsMissing",
"ArtifactsMissing",
"BackendDeviceLost",
"BarrierTimeout",
"BarrierViolation",
+3 -3
View File
@@ -29,7 +29,7 @@ P7 PACKAGE L ADDS THE SAME QUESTION FOR MAGMA, IN TWO TIERS, AND THE NORMALIZATI
DIFFERENT ON PURPOSE. The Espryt half above strips the sub-lane tails `F1.` and `Ct.` because
they name neither the case nor the arm. The Magma half must NOT: `RunAhead.Credit1.` and
`RunAhead.Credit3.` are two entries of the same case, differing in the credit the lane pins, and
a normaliser that dropped the tail would fold them together and then report an equal-sized set
a normalizer that dropped the tail would fold them together and then report an equal-sized set
that had silently lost one. So there the arm - and only the arm, the SECOND dotted segment - is
what comes off.
"""
@@ -95,7 +95,7 @@ MAGMA_INPROC_ONLY = ("MagmaRunAheadScenario.", "MagmaWireCacheScenario.", "Descr
# MEASURED (a temporary fatal in each of the three readers): all five knob=1 entries died on
# split and on spawn and ALL FIVE PASSED on tcp.
#
# These are TAILS, not scenarios - the normaliser above keeps the sub-lane tail for the Magma
# These are TAILS, not scenarios - the normalizer above keeps the sub-lane tail for the Magma
# tier on purpose, so `.MsResolve1.` names the knob entry and `.MsResolve0.` (the default, which
# does keep its tcp entry) is untouched.
#
@@ -233,7 +233,7 @@ def compare_arms(build_dir, tier, labels, inproc_only=(), no_tcp=(), only_on=Non
names = lane_names(build_dir, label) - FIXTURE_ENTRIES
sets[arm] = arm_keys(names)
print(f"{tier}: {label} has {len(names)} case entrie(s), "
f"{len(sets[arm])} after normalisation")
f"{len(sets[arm])} after normalization")
if len(names) != len(sets[arm]):
print(f"::error::{label}: {len(names) - len(sets[arm])} entry name(s) do not parse "
f"as <Backend>.<Arm>.<case>, so this comparison silently drops them: "
+4 -4
View File
@@ -7,11 +7,11 @@
# SPDX-License-Identifier: LGPL-3.0-only
# End of Source File Header
"""P8-SE: PipeCatalogueTest's unmigrated-emulation list IS the set of call sites in the tree.
"""P8-SE: PipeCatalogTest's unmigrated-emulation list IS the set of call sites in the tree.
THE QUESTION. `MGPipeUnmigratedEmulation("<name>")` (MG_Pipe/PipeApply.h) names one emulation
that reaches into client memory; a split server aborts on it, a monolith arm runs past it. The
test `PipeCatalogue.EveryUnmigratedEmulationIsNamedOnce` (MG_Test/Pipe/PipeCatalogueTest.cpp)
test `PipeCatalog.EveryUnmigratedEmulationIsNamedOnce` (MG_Test/Pipe/PipeCatalogTest.cpp)
pins the LIST of names, and nothing compared that list with the tree: it drifted twice without a
red (P8-B found a name the list never had; P8-SE a name whose only call site no transport could
reach). This asserts, every one an error:
@@ -34,7 +34,7 @@ import re
import sys
import tempfile
LIST_FILE = Path("MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp")
LIST_FILE = Path("MobileGL/MG_Test/Pipe/PipeCatalogTest.cpp")
TEST_NAME = "EveryUnmigratedEmulationIsNamedOnce"
SOURCE_ROOT = Path("MobileGL")
EXCLUDED = (Path("MobileGL/MG_Test"), Path("MobileGL/MG_IntegrationTest"))
@@ -161,7 +161,7 @@ def run(root):
def self_test():
"""Each rule reds on a synthetic tree and a matching tree is green."""
listing = """
TEST(PipeCatalogue, EveryUnmigratedEmulationIsNamedOnce) {
TEST(PipeCatalog, EveryUnmigratedEmulationIsNamedOnce) {
// "commented-out-name" is not in the list
const char* const kNames[] = {
%s
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -669,7 +669,7 @@ def expand_macros(masked, expandable, rounds=4):
return text
def unmodelled_sites(body, relative, pasting):
def unmodeled_sites(body, relative, pasting):
"""The preprocessor constructs in `body` this script does NOT model, as taint reasons:
a token paste it could not expand, and a call to a pasting macro it refused."""
sites = set()
@@ -954,14 +954,14 @@ def state_bodies():
body = expanded[start:end]
bodies.setdefault(fn, []).append(body)
signatures.setdefault(fn, []).append(params)
sites = unmodelled_sites(body, relative, pasting)
sites = unmodeled_sites(body, relative, pasting)
if sites:
taints.setdefault(fn, set())
taints[fn] |= sites
return bodies, signatures, taints, paths
def writers_outside(analysed):
def writers_outside(analyzed):
"""{MEM token: a file OUTSIDE the analyzed roots that writes it}.
The absence claim is only as good as the set of writers the analysis reads. Every .h/.cpp
@@ -976,7 +976,7 @@ def writers_outside(analysed):
This scan is textual and file-wide: it sees a direct member write and a member-rooted
one, not a write through a reference or a mutating call. It is the containment check for
code the analysis does not read, and that is the limit of what it can say."""
seen = set(analysed)
seen = set(analyzed)
out = {}
for path in source_files(MOBILEGL_ROOT):
if path in seen:
@@ -1541,7 +1541,7 @@ void Fixture::WriteWholeMember(const RenderStateParameters& fresh) {
"""
def analyse_snippet(text):
def analyze_snippet(text):
"""{function name: (tokens, taints)} for a synthetic source text, through the same
extractor the real tree goes through (no macros: the text has none)."""
masked = mask_comments_and_strings(text)
@@ -1710,7 +1710,7 @@ def self_test(scanned, bits, publishers, movers, moved, outside=None, undecided_
# shutter reads", said about a body that writes m_parameters through a range-for
# reference; the collapse that followed was every setter "supporting" the patch
# bit because the shutter resolved to the whole struct.
snippet = analyse_snippet(SELF_TEST_BODIES)
snippet = analyze_snippet(SELF_TEST_BODIES)
patch_shutter = {"MEM:m_parameters", "FIELD:m_parameters.PatchVertices",
"FIELD:m_parameters.PatchDefaultOuterLevel",
"FIELD:m_parameters.PatchDefaultInnerLevel"}
@@ -1912,9 +1912,9 @@ def main():
publishers = render_state_publishers()
if not publishers:
sys.exit("could not derive any RenderState setter out of %s" % RENDER_STATE_PATH)
bodies, signatures, taints, analysed = state_bodies()
bodies, signatures, taints, analyzed = state_bodies()
reach, own_taints = written_tokens(bodies, signatures, taints)
outside = writers_outside(analysed)
outside = writers_outside(analyzed)
aggregates = aggregate_tokens(bodies, reach)
moved = {name: expand_aggregates(tokens, aggregates) for name, tokens in reach.items()}
readers = shutter_readers()
@@ -1969,7 +1969,7 @@ def main():
"written outside those roots and any absence claim over one is undecided; a "
"mutating call on a member-rooted lvalue and a call resolved by name both only "
"WIDEN what a mutator is credited with, and a FIELD token is not scoped to a type"
% (sum(len(v) for v in bodies.values()), len(analysed),
% (sum(len(v) for v in bodies.values()), len(analyzed),
" + ".join(os.path.relpath(root, REPO_ROOT).replace(os.sep, "/")
for root in STATE_ROOTS),
len(own_taints),
+3 -3
View File
@@ -239,7 +239,7 @@ INTERRUPTED=""
note_interrupt() { [ -n "$INTERRUPTED" ] || INTERRUPTED=$1; }
# 128 + signal number is how a shell reports a child that died on a signal; nothing this script
# runs exits above 128 for any other reason (ctest uses 8 for failing tests).
child_was_signalled() { [ "${1:-0}" -ge 128 ]; }
child_was_signaled() { [ "${1:-0}" -ge 128 ]; }
trap 'note_interrupt INT; repair; trap - INT; kill -INT $$' INT
trap 'note_interrupt TERM; repair; trap - TERM; kill -TERM $$' TERM
# The EXIT trap covers the paths that leave through an early `exit` with a header still patched
@@ -381,7 +381,7 @@ PY
say "[$tag] rebuilding with the dropped field"
cmake --build "$BUILD_DIR" -j "$(nproc)" </dev/null > "$LOG_DIR/build-after-$tag.log" 2>&1
buildRc=$?
if child_was_signalled "$buildRc" || [ -n "$INTERRUPTED" ]; then
if child_was_signaled "$buildRc" || [ -n "$INTERRUPTED" ]; then
note_interrupt "exit $buildRc"
say "[$tag] INTERRUPTED during the rebuild ($INTERRUPTED). Repairing the tree and stopping:"
say "a run that carried on here would report a verdict about a control that never ran."
@@ -408,7 +408,7 @@ PY
ctest --test-dir "$BUILD_DIR" -R "$test" --no-tests=error --output-on-failure </dev/null \
> "$LOG_DIR/ctest-after-$tag.log" 2>&1
ctestRc=$?
if child_was_signalled "$ctestRc" || [ -n "$INTERRUPTED" ]; then
if child_was_signaled "$ctestRc" || [ -n "$INTERRUPTED" ]; then
note_interrupt "exit $ctestRc"
say "[$tag] INTERRUPTED while running $test ($INTERRUPTED). A suite that was killed is not a"
say "suite that went red: repairing the tree and stopping rather than scoring the control."
+2 -2
View File
@@ -134,7 +134,7 @@ def parent_scope(prefix):
return body[:cut + 2] if cut >= 0 else ""
def normalise(name, strip_scopes, rename_map):
def normalize(name, strip_scopes, rename_map):
"""Textual folding of the demangled name: this is what makes a de-nesting a rename."""
for scope in strip_scopes:
name = name.replace(scope, parent_scope(scope))
@@ -158,7 +158,7 @@ def build_side(path, nm_tool, size_tool, cxxfilt, strip_scopes, rename_map, cann
demangled = demangle(raw.keys(), cxxfilt)
table = {}
for mangled, (kind, size) in raw.items():
key = normalise(demangled.get(mangled, mangled), strip_scopes, rename_map)
key = normalize(demangled.get(mangled, mangled), strip_scopes, rename_map)
table.setdefault(key, []).append({"mangled": mangled, "type": kind,
"size": size or 0,
"demangled": demangled.get(mangled, mangled)})