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

This commit is contained in:
BZLZHH committed 2026-10-31 20:06:22 +08:00
1 parent 4f50bedde0
commit 6d3b00e820
180 files changed
+1070 -1073

No files matched your search

@@ -1051,7 +1051,7 @@ void main() {}
// Whitespace between '#' and the keyword is legal in GLSL, and a shader carrying several
// extension directives must have exactly the one retargeted.
TEST(RetargetTextureBufferExtensionTest, SpacedDirectiveIsRewrittenAndNeighboursAreLeftAlone) {
TEST(RetargetTextureBufferExtensionTest, SpacedDirectiveIsRewrittenAndNeighborsAreLeftAlone) {
const String source = R"(#version 310 es
# extension GL_EXT_texture_buffer : require
#extension GL_EXT_shader_io_blocks : require
@@ -1475,7 +1475,7 @@ TEST(PassthroughTessControlEsslTest, RequestsTheExtensionBelowEs32) {
EXPECT_TRUE(Contains(out, "#extension GL_EXT_tessellation_shader : require")) << out;
}
TEST(PassthroughTessControlEsslTest, MirrorsTheNeighboursPerVertexBlocks) {
TEST(PassthroughTessControlEsslTest, MirrorsTheNeighborsPerVertexBlocks) {
const String inMembers = " highp vec4 gl_Position; highp float gl_PointSize; ";
const String outMembers = " highp vec4 gl_Position; ";
const String out = BuildPassthroughTessControlEssl(320, 4, inMembers, outMembers, kDefaultOuter, kDefaultInner);
+1 -1
View File
@@ -278,7 +278,7 @@ TEST_F(BufferTest, AcquireMemoryRangeWithExplicit) {
// subtracting the offset the caller asked for - i.e. it sits at the offset's own alignment phase.
// KHR-GLxx.map_buffer_alignment.functional asserts exactly these two, at offset 63, for 24
// storage-flag combinations across 14 targets, and failed identically on both test devices.
TEST_F(BufferTest, MappedPointersHonourTheAdvertisedMapBufferAlignment) {
TEST_F(BufferTest, MappedPointersHonorTheAdvertisedMapBufferAlignment) {
GLint advertisedAlignment = 0;
MobileGL::MG_Impl::GLImpl::GetIntegerv(GL_MIN_MAP_BUFFER_ALIGNMENT, &advertisedAlignment);
ASSERT_EQ(advertisedAlignment, static_cast<GLint>(MobileGL::MG_State::GLState::MIN_MAP_BUFFER_ALIGNMENT))
+1 -1
View File
@@ -99,7 +99,7 @@ add_subdirectory(VertexArray)
add_subdirectory(Program)
add_subdirectory(Query)
add_subdirectory(Pipeline)
# The MGPipe catalogue arithmetic: no GL context and no driver, just the .def, the seven
# The MGPipe catalog arithmetic: no GL context and no driver, just the .def, the seven
# generated files and the payload layouts.
add_subdirectory(Pipe)
# The P0.5 interface-purity gate: a python walk of #include lines, so it registers with no
@@ -1324,7 +1324,7 @@ TEST_F(FramebufferTest, PolygonOffsetFallsBackToTheUnclampedEntryPointWithoutThe
EXPECT_EQ(MG_Impl::GLImpl::GetError(), GL_NO_ERROR);
}
TEST_F(FramebufferTest, ApplicationAlphaMaskOffIsStillHonouredOnANativeDrawBuffer) {
TEST_F(FramebufferTest, ApplicationAlphaMaskOffIsStillHonoredOnANativeDrawBuffer) {
// The doctoring only ever REMOVES alpha writes on a widened buffer; it must never add them
// back on a buffer the application masked itself, and must never touch a native one.
ScopedRenderStateDriverStubs driver;
@@ -1513,7 +1513,7 @@ TEST_F(FramebufferTest, FramebufferTextureRejectsTheDefaultFramebuffer) {
DrainPendingGlErrors();
}
TEST_F(FramebufferTest, FramebufferTextureRejectsAColourAttachmentPastTheLimit) {
TEST_F(FramebufferTest, FramebufferTextureRejectsAColorAttachmentPastTheLimit) {
GLuint framebuffer = 0;
GLuint texture = 0;
MG_Impl::GLImpl::CreateFramebuffers(1, &framebuffer);
+10 -10
View File
@@ -9,11 +9,11 @@
cmake_minimum_required(VERSION 3.14)
add_executable(
PipeCatalogueTest
PipeCatalogueTest.cpp
PipeCatalogTest
PipeCatalogTest.cpp
)
target_include_directories(PipeCatalogueTest PRIVATE
target_include_directories(PipeCatalogTest PRIVATE
${MGL_ROOT}/include
${MGL_ROOT}/MobileGL
${MGL_ROOT}/MobileGL/MG_Pipe
@@ -23,13 +23,13 @@ target_include_directories(PipeCatalogueTest PRIVATE
)
target_link_libraries(
PipeCatalogueTest PRIVATE
PipeCatalogTest PRIVATE
MobileGLTestMain
${LINK_LIBRARIES}
)
if (MSVC)
target_compile_options(PipeCatalogueTest PRIVATE /Zc:preprocessor)
target_compile_options(PipeCatalogTest PRIVATE /Zc:preprocessor)
endif()
# P13 W5: the record arm's fail / latch seam, in both library shapes (with and without MG_Remote).
@@ -237,20 +237,20 @@ if (MSVC)
endif()
include(GoogleTest)
gtest_discover_tests(PipeCatalogueTest DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit)
gtest_discover_tests(PipeCatalogTest DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit)
# This source scanner must inspect the configured checkout, including in out-of-tree builds.
# Apply the override after GoogleTest's deferred discovery, and only to this one test.
# CTestTestfile scripts run with no policy settings, so IN_LIST (CMP0057) is not available here
# on CMake 3.x: use list(FIND) instead.
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/PipeCatalogueSourceRoot.cmake" CONTENT
"list(FIND PipeCatalogueTest_TESTS \"PipeCatalogue.FrontendNeverTakesAnApplierAddress\" _mglSourceRootTest)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/PipeCatalogSourceRoot.cmake" CONTENT
"list(FIND PipeCatalogTest_TESTS \"PipeCatalog.FrontendNeverTakesAnApplierAddress\" _mglSourceRootTest)
if(NOT _mglSourceRootTest EQUAL -1)
set_tests_properties(PipeCatalogue.FrontendNeverTakesAnApplierAddress PROPERTIES
set_tests_properties(PipeCatalog.FrontendNeverTakesAnApplierAddress PROPERTIES
WORKING_DIRECTORY [==[${MGL_ROOT}]==])
endif()
")
set_property(DIRECTORY APPEND PROPERTY TEST_INCLUDE_FILES
"${CMAKE_CURRENT_BINARY_DIR}/PipeCatalogueSourceRoot.cmake")
"${CMAKE_CURRENT_BINARY_DIR}/PipeCatalogSourceRoot.cmake")
gtest_discover_tests(FieldOwnershipTest DISCOVERY_TIMEOUT 30 PROPERTIES LABELS unit)
foreach(pipeTest ResourceEmitTest VertexInputEmitTest
+1 -1
View File
@@ -108,7 +108,7 @@ namespace {
// off the PROBE and the handle reuse, not the records - otherwise it would measure a
// different design rather than this one without content addressing.
TEST_F(CsoCacheTest, ContentAddressingOffMintsEveryTime) {
MG_Config::Features.PipePush |= kMGPipeBehaviourNoCsoContentAddressing;
MG_Config::Features.PipePush |= kMGPipeBehaviorNoCsoContentAddressing;
MGPipeCsoCache cache;
Uint64 bytes = 0;
const RenderStateParameters params = PipelineState(3);
+1 -1
View File
@@ -514,7 +514,7 @@ TEST_F(FieldOwnershipTest, AServerStampMakesRecordSuppliedFieldsFreshAndWithdraw
// whatever the serial says - but it tests "never filled" FIRST, so the stamp's withdrawal
// (FilledGen = 0) wins over kMGPipeInputFieldSticky without a line of the generated file
// changing. Before this, the seven most dangerous fields were exempt by construction.
TEST_F(FieldOwnershipTest, TheStickyExemptionIsCancelledByTheServerStamp) {
TEST_F(FieldOwnershipTest, TheStickyExemptionIsCanceledByTheServerStamp) {
MGPipeValidateForVerb(MGPipeVerb::Clear); // the CLIENT fills and stamps all 63, sticky included
EXPECT_TRUE(MGPipeInputFieldIsFresh(gPipeInputs->FilledState(), MGPipeInputField::RecordError));
MGPipeServerStampVerbBoundary(MGPipeVerb::Clear);
@@ -1,4 +1,4 @@
// MobileGL - MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp
// MobileGL - MobileGL/MG_Test/Pipe/PipeCatalogTest.cpp
// Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt
@@ -36,7 +36,7 @@
using namespace MobileGL;
using namespace MobileGL::MG_Pipe;
TEST(PipeCatalogue, FrontendNeverTakesAnApplierAddress) {
TEST(PipeCatalog, FrontendNeverTakesAnApplierAddress) {
namespace fs = std::filesystem;
auto base = fs::current_path();
while (!fs::is_directory(base / "MobileGL/MG_Impl") && base != base.root_path())
@@ -86,20 +86,20 @@ namespace {
// The catalog's own spelling of an opcode, for a failure message. The wire codec has one
// of these and MG_Pipe may not reach it (MG_Remote is above this layer), so the table is
// expanded from the catalog here rather than a name being duplicated per EXPECT.
#define MGP_CATALOGUE_NAME_ROW(Name, Payload, Class, Flags, Wait) #Name,
constexpr const char* kCatalogueOpNames[] = {"<kInvalid>", MGP_CALL_LIST(MGP_CATALOGUE_NAME_ROW)};
#undef MGP_CATALOGUE_NAME_ROW
static_assert(sizeof(kCatalogueOpNames) / sizeof(kCatalogueOpNames[0]) == static_cast<SizeT>(MGPWireOp::kOpCount),
#define MGP_CATALOG_NAME_ROW(Name, Payload, Class, Flags, Wait) #Name,
constexpr const char* kCatalogOpNames[] = {"<kInvalid>", MGP_CALL_LIST(MGP_CATALOG_NAME_ROW)};
#undef MGP_CATALOG_NAME_ROW
static_assert(sizeof(kCatalogOpNames) / sizeof(kCatalogOpNames[0]) == static_cast<SizeT>(MGPWireOp::kOpCount),
"the diagnostic name table and the opcode space disagree");
const char* WireOpNameForDiag(MGPWireOp op) {
const SizeT index = static_cast<SizeT>(op);
return index < static_cast<SizeT>(MGPWireOp::kOpCount) ? kCatalogueOpNames[index] : "<opcode out of range>";
return index < static_cast<SizeT>(MGPWireOp::kOpCount) ? kCatalogOpNames[index] : "<opcode out of range>";
}
} // namespace
// The handle is the whole object model. Eight bytes, a register pair, no padding.
TEST(PipeCatalogue, HandleIsEightBytes) {
TEST(PipeCatalog, HandleIsEightBytes) {
static_assert(sizeof(MGPipeHandle) == 8);
static_assert(alignof(MGPipeHandle) == 4);
static_assert(std::is_trivially_copyable_v<MGPipeHandle>);
@@ -116,14 +116,14 @@ TEST(PipeCatalogue, HandleIsEightBytes) {
// The catalog, the number documented in its header, and the two generated tables are one
// fact stated three times. This is the test that notices when they stop being.
TEST(PipeCatalogue, EntryCountMatchesTheDocumentedCount) {
TEST(PipeCatalog, EntryCountMatchesTheDocumentedCount) {
static_assert(kExpandedCallCount == MGP_CALL_LIST_DOCUMENTED_COUNT);
static_assert(kExpandedCallCount == kMGPipeCallCount);
EXPECT_EQ(kExpandedCallCount, static_cast<SizeT>(MGP_CALL_LIST_DOCUMENTED_COUNT));
EXPECT_EQ(kMGPipeCallCount, kExpandedCallCount);
}
TEST(PipeCatalogue, GeneratedTablesHoldTheWholeCatalogue) {
TEST(PipeCatalog, GeneratedTablesHoldTheWholeCatalog) {
static_assert(ClassCount<kScreen>() == kMGPipeScreenCallCount);
static_assert(ClassCount<kScreen>() + ClassCount<kCtxCso>() + ClassCount<kCtxState>() + ClassCount<kCtxObject>() +
ClassCount<kCtxVerb>() + ClassCount<kCtxQuery>() ==
@@ -176,7 +176,7 @@ TEST(PipeCatalogue, GeneratedTablesHoldTheWholeCatalogue) {
// renaming a case is a removal even when the new name is better: it is indistinguishable, from
// the gate's side, from a case that was deleted. So this case stays, asserting the half that is
// still true, and the new half below is an ADDED name.
TEST(PipeCatalogue, UninstalledTablesAreAllNull) {
TEST(PipeCatalog, UninstalledTablesAreAllNull) {
const void* const* screen = reinterpret_cast<const void* const*>(&gMGPipeScreen);
const void* const* context = reinterpret_cast<const void* const*>(&gMGPipeContext);
MGPipeInstallMonolithTables();
@@ -209,7 +209,7 @@ TEST(PipeCatalogue, UninstalledTablesAreAllNull) {
(void)context;
}
TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
TEST(PipeCatalog, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
const void* const* screen = reinterpret_cast<const void* const*>(&gMGPipeScreen);
const void* const* context = reinterpret_cast<const void* const*>(&gMGPipeContext);
SizeT installed = 0;
@@ -300,7 +300,7 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
// the type's absence - nothing in the tree can name it any more). What is left to pin is the
// RETIRED ROW: op 46 keeps its number, because opcodes only ever grow, and its record keeps its
// layout so a decoder can bounds-check what it then declines.
TEST(PipeCatalogue, ResidualBlockSizeIsPinned) {
TEST(PipeCatalog, ResidualBlockSizeIsPinned) {
EXPECT_EQ(static_cast<Uint32>(MGPWireOp::SetResidualValueState), 46u);
EXPECT_EQ(sizeof(MGPResidualValueState), 32u);
}
@@ -309,7 +309,7 @@ TEST(PipeCatalogue, ResidualBlockSizeIsPinned) {
// of that header's static assertions, so the numbers show up in ctest output on every
// platform - including one where a static assertion is skipped. Every number here is also
// what MGL_RESIDUAL_BLOCK_SIZE (MGPipeTypes.h) and the Espryt offsetof spans depend on.
TEST(PipeCatalogue, ValueTypeLayoutsArePinned) {
TEST(PipeCatalog, ValueTypeLayoutsArePinned) {
EXPECT_EQ(sizeof(PixelStoreParameters), 28u);
EXPECT_EQ(sizeof(PerBufferBlendState), 28u);
EXPECT_EQ(sizeof(StencilFaceState), 28u);
@@ -334,7 +334,7 @@ TEST(PipeCatalogue, ValueTypeLayoutsArePinned) {
// What it now pins is the other half of the same statement: the carrier is one capability
// word, at offset 0, and the members it used to carry are gone rather than merely moved -
// which is exactly what "MGL_RESIDUAL_BLOCK_SIZE only ever goes down" has to mean.
TEST(PipeCatalogue, ResidualBlockIsExactlyItsTwoValueStructsPlusPatchTail) {
TEST(PipeCatalog, ResidualBlockIsExactlyItsTwoValueStructsPlusPatchTail) {
// P13 W3c deleted the last capability word, so the carrier is gone altogether; the members
// it used to carry are pinned on the carriers that took them over.
// The three carriers that took the retired members over.
@@ -347,7 +347,7 @@ TEST(PipeCatalogue, ResidualBlockIsExactlyItsTwoValueStructsPlusPatchTail) {
// compiler catches only where somebody asked it to. MGP_ASSERT_POD already pins both sizes in
// MGPipeTypes.h; what is pinned HERE is the SHAPE the two edits were made for, because that is
// what a later phase would silently undo.
TEST(PipeCatalogue, TextureParamsNameTheirBuiltinSamplerAndFramebufferStateNamesItsTarget) {
TEST(PipeCatalog, TextureParamsNameTheirBuiltinSamplerAndFramebufferStateNamesItsTarget) {
// 32 -> 40: the CSO handle carrying the SamplerParameters of the SamplerObject every
// ITextureObject owns, plus the second resync bit. Naming the CSO rather than widening
// this payload with a filter/wrap/border block is what keeps ONE authority for one value -
@@ -401,7 +401,7 @@ TEST(PipeCatalogue, TextureParamsNameTheirBuiltinSamplerAndFramebufferStateNames
// minting - EVERY TextureTarget has a row, checked at compile time by a table with no
// `default:` arm, so adding a target is a build break rather than a descriptor that silently
// describes the wrong kind of storage.
TEST(PipeCatalogue, EveryTextureTargetMapsToItsOwnResourceTarget) {
TEST(PipeCatalog, EveryTextureTargetMapsToItsOwnResourceTarget) {
// The compile-time half is MGPipeEveryTextureTargetIsMapped's static_assert; this is the
// same walk at runtime, so the case names the offender instead of the build naming a line.
for (SizeT i = 0; i < static_cast<SizeT>(TextureTarget::TextureTargetCount); ++i) {
@@ -436,7 +436,7 @@ TEST(PipeCatalogue, EveryTextureTargetMapsToItsOwnResourceTarget) {
// == 0, so a texture record carrying the bare upload enumerator would be indistinguishable
// from a buffer record exactly when its owner is a 1D texture, and that texture's upload
// would be dispatched into the buffer path. Nothing else in the tree would have said so.
TEST(PipeCatalogue, SubDataTargetPacksAResourceTargetAndAnUploadTarget) {
TEST(PipeCatalog, SubDataTargetPacksAResourceTargetAndAnUploadTarget) {
// Both halves must fit their byte, or the encoding is not an encoding.
static_assert(static_cast<Uint32>(MGPipeResourceTarget::Count) <= 0x100u);
static_assert(static_cast<Uint32>(TextureUploadTarget::TextureUploadTargetCount) <= 0x100u);
@@ -506,7 +506,7 @@ TEST(PipeCatalogue, SubDataTargetPacksAResourceTargetAndAnUploadTarget) {
// All three were UNSTATED in the contract and were being re-invented on both sides of the
// boundary - which is the way a wire field acquires two meanings. The values themselves are
// unremarkable; what this case pins is that there is exactly one spelling of each.
TEST(PipeCatalogue, SurfaceNamesItsKindItsTextureTargetAndItsDepthStencilAspect) {
TEST(PipeCatalog, SurfaceNamesItsKindItsTextureTargetAndItsDepthStencilAspect) {
// MGPipeKind is REUSED rather than a second three-value enum minted beside the field.
EXPECT_EQ(kMGPipeSurfaceKindNone, static_cast<Uint8>(MGPipeKind::None));
EXPECT_EQ(kMGPipeSurfaceKindTexture, static_cast<Uint8>(MGPipeKind::Texture));
@@ -569,7 +569,7 @@ TEST(PipeCatalogue, SurfaceNamesItsKindItsTextureTargetAndItsDepthStencilAspect)
}
// G3's opcode numbering is the wire protocol. Position in PipeCalls.def, 1-based, no holes.
TEST(PipeCatalogue, WireOpcodesAreThePositionsInTheCatalogue) {
TEST(PipeCatalog, WireOpcodesAreThePositionsInTheCatalog) {
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::GetCaps), 1);
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::kOpCount), kMGPipeCallCount + 1);
EXPECT_EQ(sizeof(MGPWireRecHeader), 8u);
@@ -583,7 +583,7 @@ TEST(PipeCatalogue, WireOpcodesAreThePositionsInTheCatalogue) {
// Records are append-only. The three carriers added after the first cut - for the live
// GLFunctionsTable entries GetGpuTimestampNs, QueryCounterTimestamp and WaitSync - sit at
// the END of the list, after SetSwapInterval, so no opcode the first cut assigned has moved.
TEST(PipeCatalogue, LateArrivalsAreAppendedWithoutRenumbering) {
TEST(PipeCatalog, LateArrivalsAreAppendedWithoutRenumbering) {
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::SetSwapInterval), 68);
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::QueryTimestamp), 69);
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::QueryCounter), 70);
@@ -741,7 +741,7 @@ TEST(PipeCatalogue, LateArrivalsAreAppendedWithoutRenumbering) {
// It matters because the column is not decoration: on a run-ahead server kWaitNone is a promise
// that the record's apply reads NOTHING of the client's (rule F), and a row demoted to it by
// accident is a torn read that renders wrong rather than aborting.
TEST(PipeCatalogue, EveryRowCarriesTheWaitClassTheContractGivesIt) {
TEST(PipeCatalog, EveryRowCarriesTheWaitClassTheContractGivesIt) {
// kWaitPresent: present alone, paced by the credit taken BEFORE the encode (§2.4).
EXPECT_EQ(MGPipeWaitClassFor(MGPWireOp::Present), kWaitPresent);
@@ -871,7 +871,7 @@ TEST(PipeCatalogue, EveryRowCarriesTheWaitClassTheContractGivesIt) {
// A well-formed record passes the applier's bounds gate. P0 has no applier, so "accepted"
// is reported as "not applied" rather than "fatal".
TEST(PipeCatalogue, ApplierAcceptsAWellFormedRecord) {
TEST(PipeCatalog, ApplierAcceptsAWellFormedRecord) {
MGPWireRec_Present record{};
record.Header.Op = static_cast<Uint16>(MGPWireOp::Present);
record.Header.Size = sizeof(record);
@@ -881,7 +881,7 @@ TEST(PipeCatalogue, ApplierAcceptsAWellFormedRecord) {
// G4 reports the FIRST differing field by name, and compares field by field so that
// padding cannot produce a difference that does not exist.
TEST(PipeCatalogue, VerifyComparatorNamesTheDifferingField) {
TEST(PipeCatalog, VerifyComparatorNamesTheDifferingField) {
MGPDrawInfo a{};
MGPDrawInfo b{};
const char* field = nullptr;
@@ -909,7 +909,7 @@ TEST(PipeCatalogue, VerifyComparatorNamesTheDifferingField) {
// G6's join over the backend read inventory. P0 allows unmapped rows; from P5 the gate is
// zero, so the numbers are asserted here to make a regression visible the day it happens.
TEST(PipeCatalogue, CoverageAccountsForEveryInventoryRow) {
TEST(PipeCatalog, CoverageAccountsForEveryInventoryRow) {
EXPECT_EQ(kMGPipeInventoryReadPoints, 477u);
EXPECT_EQ(kMGPipeInventoryUnmapped, 0u);
EXPECT_EQ(kMGPipeInventoryMappedToCall + kMGPipeInventoryClientResolved + kMGPipeInventoryReverseChannel +
@@ -920,7 +920,7 @@ TEST(PipeCatalogue, CoverageAccountsForEveryInventoryRow) {
// G5's field ids come from the same accessor list as the coverage table, and every field
// starts un-filled: reading one before its verb fills it is the poison's whole job.
TEST(PipeCatalogue, PipeInputFieldsStartUnfilled) {
TEST(PipeCatalog, PipeInputFieldsStartUnfilled) {
EXPECT_EQ(kMGPipeInputFieldCount, 63u);
MGPipeFilledState state{};
// Before the first fill the serial is 0 as well: 0 == 0 must not read as fresh, on the
@@ -940,7 +940,7 @@ TEST(PipeCatalogue, PipeInputFieldsStartUnfilled) {
// G5b: the verb enum is GLFunctionsTable's member list (71 entries), every class has verbs,
// and the seven sticky fields ride in every class mask (P1 brief D7).
TEST(PipeCatalogue, VerbTableIsTheFunctionTable) {
TEST(PipeCatalog, VerbTableIsTheFunctionTable) {
EXPECT_EQ(kMGPipeVerbCount, 71u);
EXPECT_EQ(kMGPipeVerbClassCount, 9u);
SizeT perClass[kMGPipeVerbClassCount] = {};
@@ -970,7 +970,7 @@ TEST(PipeCatalogue, VerbTableIsTheFunctionTable) {
// The sticky set is exactly the seven forwarded, argument-keyed accessors (P1 brief D6); no
// version or generation accessor is among them.
TEST(PipeCatalogue, StickyFieldsAreExactlyTheSeven) {
TEST(PipeCatalog, StickyFieldsAreExactlyTheSeven) {
const char* const expected[] = {
"GetBufferBindingPointCount", "GetProgramObject", "GetTextureObject", "HasOpenTransformFeedbackSpan",
"InvalidateCompileEnv", "ValidateProgramName", "RecordError"};
@@ -993,7 +993,7 @@ TEST(PipeCatalogue, StickyFieldsAreExactlyTheSeven) {
// G4 compares floating point BY BITS (P1 brief D8): a NaN equals itself, a negative zero
// does not equal a positive one, and a vector type inside an Array inside a value struct is
// reached field by field - the differing member of the residual block is named.
TEST(PipeCatalogue, FloatVectorsCompareBitwise) {
TEST(PipeCatalog, FloatVectorsCompareBitwise) {
const Float nan = std::numeric_limits<Float>::quiet_NaN();
const FloatVec4 a{nan, 1.f, 2.f, 3.f};
const FloatVec4 b{nan, 1.f, 2.f, 3.f};
@@ -1043,7 +1043,7 @@ TEST(PipeCatalogue, FloatVectorsCompareBitwise) {
// the client's CSO cache confirms a hash hit with a memcmp over the same bytes, so a codec or
// a cache that read the padding would mint a fresh CSO per call and the verify lane would
// abort at random.
TEST(PipeCatalogue, SixValueStructsHaveFieldLists) {
TEST(PipeCatalog, SixValueStructsHaveFieldLists) {
// 72 through P5; P5b appended five call payloads (the contract: MGPImageBind,
// MGPPatchParameter, MGPStreamOutputBind, MGPStorageBlockBinding, MGPCopyFromFramebuffer),
// each with its own field list, so the comparator sees every one of them: 77. P5c appended
@@ -1118,7 +1118,7 @@ TEST(PipeCatalogue, SixValueStructsHaveFieldLists) {
}
// G7 pins the member list the pipeline/dynamic split is derived from.
TEST(PipeCatalogue, PipelineSubsetMembersArePinned) {
TEST(PipeCatalog, PipelineSubsetMembersArePinned) {
// 44 as of P2, in DECLARATION order. It grew from the 24 members
// ComputePipelineStateHash used to hash because the chunk table's rule is "a byte is
// pipeline state iff a setter that calls BumpVersions() writes it", and that is a strict
@@ -1144,7 +1144,7 @@ TEST(PipeCatalogue, PipelineSubsetMembersArePinned) {
// THE CASE NAME STAYS "…HasTenCallbacks" DELIBERATELY. G2/G14 say the ctest name set only ever
// grows, so renaming this would delete a name the gate is watching; the count it asserts is what
// has to be right, and the comment is where the number lives.
TEST(PipeCatalogue, ReverseChannelHasTenCallbacks) {
TEST(PipeCatalog, ReverseChannelHasTenCallbacks) {
EXPECT_EQ(kMGPipeCallbackCount, 7u);
EXPECT_EQ(sizeof(MGPipeCallbacks), kMGPipeCallbackCount * sizeof(void (*)()));
}
@@ -1152,7 +1152,7 @@ TEST(PipeCatalogue, ReverseChannelHasTenCallbacks) {
// The one shape that changes with the transport. In a monolith it resolves to the pointer
// it was given; with no transport installed a segment-backed span resolves to nothing
// rather than to garbage.
TEST(PipeCatalogue, HostSpanResolvesTheMonolithPointer) {
TEST(PipeCatalog, HostSpanResolvesTheMonolithPointer) {
static_assert(sizeof(MGHostSpan) == 32);
const Uint8 bytes[8] = {0, 1, 2, 3, 4, 5, 6, 7};
MGHostSpan span{};
@@ -1171,7 +1171,7 @@ TEST(PipeCatalogue, HostSpanResolvesTheMonolithPointer) {
// D-B8: a bound buffer range carries no inline host span. The named-UBO bytes are an
// optional second var-tail announced by HostSpanCount, so the SSBO, atomic-counter and XFB
// ranges - the majority - pay nothing for a payload whose shape is not frozen yet.
TEST(PipeCatalogue, BufferRangeCarriesNoInlineHostSpan) {
TEST(PipeCatalog, BufferRangeCarriesNoInlineHostSpan) {
static_assert(sizeof(MGPBufferRange) == 24);
// P5e (sb, ID-104): 32 -> 40. WritableMask was ONE Uint32 against an 84-point window, so
// it could describe only the first 32 points and a storage buffer bound at point 32 or
@@ -1220,7 +1220,7 @@ TEST(PipeCatalogue, BufferRangeCarriesNoInlineHostSpan) {
// The buffer half of resource_subdata has no level and no box of its own: [offset, size)
// rides in UnionBox.X / UnionBox.W, and only through the two helpers, which also say where
// one record stops and the emitter has to split.
TEST(PipeCatalogue, SubDataBufferRangeRidesInTheUnionBox) {
TEST(PipeCatalog, SubDataBufferRangeRidesInTheUnionBox) {
MGPSubData record{};
record.Level = 3;
record.RegionCount = 2;
@@ -1256,7 +1256,7 @@ TEST(PipeCatalogue, SubDataBufferRangeRidesInTheUnionBox) {
// baseInstance-only divergence through under MOBILEGL_PIPE_VERIFY - which is the one gate
// that would otherwise have seen the suppression bug the ContentHash rule exists to prevent.
// So the field list is pinned the only way it can be: by making the comparator name it.
TEST(PipeCatalogue, VertexBufferSetCarriesAnExplicitBaseInstance) {
TEST(PipeCatalog, VertexBufferSetCarriesAnExplicitBaseInstance) {
static_assert(sizeof(MGPVertexBuffers) == 24);
static_assert(sizeof(MGPVertexBuffer) == 32); // the per-entry struct did NOT change
EXPECT_EQ(sizeof(MGPVertexBuffers), 24u);
@@ -1285,7 +1285,7 @@ TEST(PipeCatalogue, VertexBufferSetCarriesAnExplicitBaseInstance) {
// of, so their sizes are the blob's stride and the applier's bounds arithmetic; and IsLong is
// carried SEPARATELY from Type, because a GL_DOUBLE format converted to float and a long
// format that keeps all 64 bits are different requests that a backend has to tell apart.
TEST(PipeCatalogue, VertexWireViewsAreFlatAndCarryIsLongSeparately) {
TEST(PipeCatalog, VertexWireViewsAreFlatAndCarryIsLongSeparately) {
static_assert(sizeof(MGPVertexAttribWire) == 24);
static_assert(sizeof(MGPVertexBindingPointWire) == 16);
EXPECT_EQ(sizeof(MGPVertexAttribWire), 24u);
@@ -1322,7 +1322,7 @@ TEST(PipeCatalogue, VertexWireViewsAreFlatAndCarryIsLongSeparately) {
// This is the negative control for a future flag that over-acks: in monolith the ack is a
// no-op, so the mistake cannot be shipped from here, and the phase where it would bite
// inherits this pin rather than the guess.
TEST(PipeCatalogue, ResourceRespecifyAcksOnlyImmutableStorage) {
TEST(PipeCatalog, ResourceRespecifyAcksOnlyImmutableStorage) {
Uint32 flags = 0;
#define MGP_FLAGS_OF_RESOURCE_RESPECIFY(Name, Payload, Class, Flags, Wait) \
if (std::strcmp(#Name, "ResourceRespecify") == 0) flags = static_cast<Uint32>(Flags);
@@ -1447,7 +1447,7 @@ TEST(PipeCatalogue, ResourceRespecifyAcksOnlyImmutableStorage) {
// say WHICH one was lost. P8-SE: scripts/ci/unmigrated_emulation_sites.py holds this list against
// the `MGPipeUnmigratedEmulation("...")` call sites in the tree - equal sets, one site per name -
// because nothing did before and the list drifted twice unseen (P8-B, and P8-SE's dead name).
TEST(PipeCatalogue, EveryUnmigratedEmulationIsNamedOnce) {
TEST(PipeCatalog, EveryUnmigratedEmulationIsNamedOnce) {
// Every one of these is an emulation that reads or writes CLIENT memory a split server
// would not have: a CPU shadow mirror, a CPU mipmap fallback and a shadow-conversion
// readback.
@@ -1496,7 +1496,7 @@ TEST(PipeCatalogue, EveryUnmigratedEmulationIsNamedOnce) {
//
// This case pins both halves: a leaked COMPOSITE moves the band's marks and not the ordinary
// one, and an ordinary leak still moves the ordinary mark with a composite outstanding.
TEST(PipeCatalogue, TheCompositeShaderBandIsCountedApartFromTheOrdinarySpace) {
TEST(PipeCatalog, TheCompositeShaderBandIsCountedApartFromTheOrdinarySpace) {
MGPipeSlotAllocator slots;
const Uint32 ordinaryBefore = slots.HighWater(MGPipeKind::ShaderCso);
+1 -1
View File
@@ -285,7 +285,7 @@ TEST(ProgramEmit, ACreateStoresTheDescriptorAndARelinkCountsUpAndDropsTheBlockKe
// The three refusals a create can produce: no artifacts at all behind seven undeclared blobs, a
// default uniform block no program can have, and a slot outside the record table's bound.
TEST(ProgramEmit, ACreateWithNoArtefactsAnOversizedBlockOrACorruptSlotIsRefusedNamingTheProgram) {
TEST(ProgramEmit, ACreateWithNoArtifactsAnOversizedBlockOrACorruptSlotIsRefusedNamingTheProgram) {
ApplierGuard guard;
const LinkArtifacts link;
const SpirvArtifacts spirv;
+1 -1
View File
@@ -1701,7 +1701,7 @@ namespace {
// Neither branch may fall through to a table it was not named. A target or a kind outside
// the catalog would otherwise land in whichever table the code happened to reach first,
// and destroy a live object of a kind the call was never about.
TEST(ResourceEmit, AResourceTargetOrKindTheCatalogueDoesNotNameIsRefusedRatherThanRouted) {
TEST(ResourceEmit, AResourceTargetOrKindTheCatalogDoesNotNameIsRefusedRatherThanRouted) {
ApplierGuard guard;
const MGPipeHandle res{5, 1};
@@ -276,7 +276,7 @@ namespace {
// bounded by GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, which is a DEVICE number and is exactly
// what ruling 10 says the client must not pre-clamp the WIRE to. The wire-field half - that
// the mask reaches point 83 at all - is driven through the applier below, where the window
// is 84 by construction, and pinned again in PipeCatalogueTest.
// is 84 by construction, and pinned again in PipeCatalogTest.
TEST(ShaderBufferEmit, OnlyTheWritableClassesSetAMaskAndItReachesTheLastPoint) {
EmitterScope scope;
GLint storageBindings = 0;
+3 -3
View File
@@ -2395,11 +2395,11 @@ TEST(TextureEmit, ASubDataRecordWhoseResourceTargetNamesNoTextureIsRefusedRather
// And so is a value at or above the catalog, and so is the buffer target arriving with a
// non-zero upload-target half - which the whole-field buffer test above cannot see.
MGPSubData pastTheCatalogue = renderbuffer;
pastTheCatalogue.Target = static_cast<Uint16>(MGPipeResourceTarget::Count);
MGPSubData pastTheCatalog = renderbuffer;
pastTheCatalog.Target = static_cast<Uint16>(MGPipeResourceTarget::Count);
ExpectRefusedNaming("resource_subdata {slot=9, gen=1}: the record's resource target names no texture "
"to upload into",
[&pastTheCatalogue, &texels]() { MGPipeApplyResourceSubData(pastTheCatalogue, texels); });
[&pastTheCatalog, &texels]() { MGPipeApplyResourceSubData(pastTheCatalog, texels); });
MGPSubData packedBuffer = renderbuffer;
packedBuffer.Target = static_cast<Uint16>(0x0100u | kMGPipeResourceTargetBuffer);
+2 -2
View File
@@ -43,8 +43,8 @@ using namespace MobileGL::MG_Pipe;
namespace {
// The subsystem bitmask the tracker dispatches on is allocated in every build.
TEST(Tracker, SubsystemBitsDoNotOverlapTheBehaviourBit) {
EXPECT_EQ(kMGPipeSubsystemsMigratedAtP2 & kMGPipeBehaviourNoCsoContentAddressing, 0ull);
TEST(Tracker, SubsystemBitsDoNotOverlapTheBehaviorBit) {
EXPECT_EQ(kMGPipeSubsystemsMigratedAtP2 & kMGPipeBehaviorNoCsoContentAddressing, 0ull);
}
// A composite shutter is only as good as its mix: a collision is a missed fire. The pairs
@@ -647,7 +647,7 @@ TEST(PipelineQuirkTest, WireDepthResolveProbeKnobReplacesTheMeasurementNotTheVer
EXPECT_EQ(ParseWireDepthResolveProbeKnob(""), WireDepthResolveProbeKnob::Measure);
EXPECT_EQ(ParseWireDepthResolveProbeKnob("bug"), WireDepthResolveProbeKnob::ForceBug);
EXPECT_EQ(ParseWireDepthResolveProbeKnob("clean"), WireDepthResolveProbeKnob::ForceClean);
EXPECT_EQ(ParseWireDepthResolveProbeKnob("0x5143"), WireDepthResolveProbeKnob::Unrecognised);
EXPECT_EQ(ParseWireDepthResolveProbeKnob("0x5143"), WireDepthResolveProbeKnob::Unrecognized);
Int measured = 0;
const auto measure = [&] {
++measured;
@@ -662,7 +662,7 @@ TEST(PipelineQuirkTest, WireDepthResolveProbeKnobReplacesTheMeasurementNotTheVer
EXPECT_EQ(clean.verdict, WireDepthResolveProbeVerdict::Clean);
EXPECT_FALSE(clean.preferShader);
EXPECT_EQ(measured, 0) << "a forced verdict must not also run the device probe";
const auto other = ChooseWireDepthResolveArm(WireDepthResolveProbeKnob::Unrecognised, true, measure);
const auto other = ChooseWireDepthResolveArm(WireDepthResolveProbeKnob::Unrecognized, true, measure);
EXPECT_EQ(measured, 1) << "an unrecognized value runs the probe as if the knob were unset";
EXPECT_FALSE(other.measurement.fromKnob);
EXPECT_EQ(other.verdict, WireDepthResolveProbeVerdict::Clean);
@@ -344,7 +344,7 @@ void main() { fragColor = vec4(1.0); }
// LINK_STATUS read has published phase A (m_pendingLink is null), CancelLink() can only reach
// the SPIR-V job - which is exactly the shape StopAndDrain produces for a phase B queued
// behind an already-complete phase A.
TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInsteadOfFaulting) {
TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCanceledDegradesInsteadOfFaulting) {
const AsyncModeScope async(true);
const SingleWorkerScope oneWorker;
constexpr int kPrograms = 12;
@@ -353,7 +353,7 @@ TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInste
Vector<String> sources;
const Vector<GLuint> programs = LinkBatch(kPrograms, kFirst, sources);
int cancelled = 0;
int canceled = 0;
for (int i = 0; i < kPrograms; ++i) {
const GLuint program = programs[static_cast<SizeT>(i)];
const String n = std::to_string(kFirst + i);
@@ -363,7 +363,7 @@ TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInste
if (object->IsSpirvComplete()) continue; // already published; not the state under test
object->CancelLink(); // phase A is published, so this reaches only the SPIR-V job
++cancelled;
++canceled;
// ---- the contract: linked, fully queryable, not drawable ----
EXPECT_TRUE(object->GetLinkStatus()) << "a canceled phase B must not retract LINK_STATUS";
@@ -420,7 +420,7 @@ TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInste
EXPECT_EQ(GetError(), GL_NO_ERROR);
}
EXPECT_GT(cancelled, 0) << "no phase B was ever canceled; this case proved nothing";
EXPECT_GT(canceled, 0) << "no phase B was ever canceled; this case proved nothing";
}
// The mirror image: with async off the state is not reachable at all, because both bodies run
@@ -117,25 +117,25 @@ namespace {
LinkArtifacts MakeLinkArtifacts() {
LinkArtifacts link{};
link.uniformReflection = {MakeReflection("uColour", 0), MakeReflection("uMatrix", 1)};
link.uniformReflection = {MakeReflection("uColor", 0), MakeReflection("uMatrix", 1)};
link.blockReflection = {MakeReflection("Block", -1)};
link.pipeInputReflection = {MakeReflection("inPosition", 0)};
link.pipeOutputReflection = {MakeReflection("outColour", 0)};
link.pipeOutputReflection = {MakeReflection("outColor", 0)};
link.lastStageIsFragment = true;
link.computeLocalSize = {8u, 4u, 2u};
link.uniformIndexByName = {{"uColour", 0}, {"uMatrix", 1}};
link.uniformIndexByName = {{"uColor", 0}, {"uMatrix", 1}};
link.attribs = {"inPosition", "inNormal"};
link.attribTypes = {GL_FLOAT_VEC3, GL_FLOAT_VEC3};
link.linkedFragDataLocation = {{"outColour", 0u}};
link.linkedFragDataIndex = {{"outColour", 1u}};
link.linkedFragDataLocation = {{"outColor", 0u}};
link.linkedFragDataIndex = {{"outColor", 1u}};
link.glUniformIndexToTProgram = {0, 1};
link.tProgramUniformIndexToGl = {0, 1};
link.glBlockIndexToTProgram = {0};
link.tProgramBlockIndexToGl = {-1};
link.glUniformBlockIndexToBlock = {0};
link.blockIndexToGlUniformBlock = {0};
link.linkedExplicitUniformLocations = {{"uColour", 3}};
link.uniformLocations = {{"uColour", 0u}, {"uMatrix", 4u}};
link.linkedExplicitUniformLocations = {{"uColor", 3}};
link.uniformLocations = {{"uColor", 0u}, {"uMatrix", 4u}};
link.writtenUniformLocationBits = {0x5ull};
link.writtenUniformIndexBits = {0x3ull};
link.writtenUniformIndices = {0u, 1u};
@@ -178,7 +178,7 @@ namespace {
// scalars and two vectors. The codec has a hand-written arm for it because
// ProgramArtifacts.h gives it no VisitFields table.
glslang::TIntermediate::TUniformInitializer initializer;
initializer.name = "uInitialised";
initializer.name = "uInitialized";
initializer.basicType = glslang::EbtInt;
initializer.vectorSize = 2;
initializer.matrixCols = 0;
@@ -252,7 +252,7 @@ TEST(ProgramArtifactsCodec, RoundTripsAFullyPopulatedArchive) {
// The four reflection vectors, with their TypeFacts.
ASSERT_EQ(decodedLink.uniformReflection.size(), 2u);
EXPECT_EQ(decodedLink.uniformReflection[0].name, "uColour");
EXPECT_EQ(decodedLink.uniformReflection[0].name, "uColor");
EXPECT_EQ(decodedLink.uniformReflection[1].location, 1);
EXPECT_EQ(decodedLink.uniformReflection[0].arrayStride, 16);
EXPECT_EQ(decodedLink.uniformReflection[0].stages, 0x3u);
@@ -285,7 +285,7 @@ TEST(ProgramArtifactsCodec, RoundTripsAFullyPopulatedArchive) {
// The glslang-typed aggregate, through the codec's one hand-written arm.
ASSERT_EQ(decodedLink.uniformInitialValues.size(), 1u);
EXPECT_EQ(decodedLink.uniformInitialValues[0].name, "uInitialised");
EXPECT_EQ(decodedLink.uniformInitialValues[0].name, "uInitialized");
EXPECT_EQ(decodedLink.uniformInitialValues[0].basicType, glslang::EbtInt);
EXPECT_EQ(decodedLink.uniformInitialValues[0].arraySize, 3);
ASSERT_EQ(decodedLink.uniformInitialValues[0].intValues.size(), 6u);
+8 -8
View File
@@ -359,10 +359,10 @@ TEST_F(ProgramTest, ImageUniformLayoutBindingInitializesImageUnit) {
char infoLog[1024] = "";
const char* csSrc = R"(#version 460 core
layout(local_size_x = 1) in;
layout(binding = 4, rgba8) uniform writeonly image2D colourTexOut;
layout(binding = 4, rgba8) uniform writeonly image2D colorTexOut;
void main() {
imageStore(colourTexOut, ivec2(0), vec4(1.0));
imageStore(colorTexOut, ivec2(0), vec4(1.0));
}
)";
@@ -382,7 +382,7 @@ void main() {
GetProgramInfoLog(program, sizeof(infoLog), nullptr, infoLog);
ASSERT_EQ(linkStatus, GL_TRUE) << infoLog;
const GLint location = GetUniformLocation(program, "colourTexOut");
const GLint location = GetUniformLocation(program, "colorTexOut");
ASSERT_GE(location, 0);
auto programObject = MobileGL::MG_State::pGLContext->GetProgramObject(program);
ASSERT_NE(programObject, nullptr);
@@ -544,7 +544,7 @@ void main() {
ASSERT_NE(programObject, nullptr);
// ---- the reference: the old consumer's algorithm, run here over the real modules ----
const auto normalise = [](const SpvReflectDescriptorBinding& binding) {
const auto normalize = [](const SpvReflectDescriptorBinding& binding) {
const char* raw = binding.name;
if (binding.type_description != nullptr && binding.type_description->type_name != nullptr) {
raw = binding.type_description->type_name;
@@ -571,8 +571,8 @@ void main() {
}
std::sort(bindings.begin(), bindings.end(),
[&](const SpvReflectDescriptorBinding* lhs, const SpvReflectDescriptorBinding* rhs) {
const String lhsName = lhs ? normalise(*lhs) : String();
const String rhsName = rhs ? normalise(*rhs) : String();
const String lhsName = lhs ? normalize(*lhs) : String();
const String rhsName = rhs ? normalize(*rhs) : String();
if (lhsName != rhsName) return lhsName < rhsName;
return lhs->binding < rhs->binding;
});
@@ -580,7 +580,7 @@ void main() {
if (binding == nullptr || binding->descriptor_type != SPV_REFLECT_DESCRIPTOR_TYPE_STORAGE_BUFFER) {
continue;
}
const String name = normalise(*binding);
const String name = normalize(*binding);
if (name.empty()) continue;
if (std::find(reference.begin(), reference.end(), name) != reference.end()) continue;
reference.push_back(name);
@@ -3956,7 +3956,7 @@ void main() { fragColor = vec4(1.0); }
// link gets to judge: a bare `layout(location = MAX)` is already a compile error inside glslang
// ("location is too large"), while an array's base compiles fine and only its last element passes
// the ceiling (...uniform-loc-negative-link-max-num-of-locations).
TEST_F(ProgramTest, ExplicitUniformLocationsHonourMaxUniformLocations) {
TEST_F(ProgramTest, ExplicitUniformLocationsHonorMaxUniformLocations) {
GLint maxLocations = 0;
GetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &maxLocations);
ASSERT_GE(maxLocations, 1024) << "GL 4.3 requires at least 1024 uniform locations";
+1 -1
View File
@@ -4788,7 +4788,7 @@ void main() { v = gl_NumSamples; }
}
}
TEST_F(ProgramUtilTest, NumSamplesShimHonoursTheVersionAndExtensionGate) {
TEST_F(ProgramUtilTest, NumSamplesShimHonorsTheVersionAndExtensionGate) {
using namespace MG_Util::ShaderTranspiler;
struct Case {
@@ -454,7 +454,7 @@ TEST_F(ShaderCompileAdoptionTest, DeletingOneSharerLeavesTheOtherIntact) {
// but JobNode::Cancel on a Running node only sets the cancellation-REQUEST flag; the state
// stays Running until the worker's body returns and JobNode::Run forces the final transition
// to Canceled (see JobNode::Run's tail: it takes Canceled instead of Complete whenever
// m_cancelled is set, regardless of how the body finished). FindAdoptable must refuse a node
// m_canceled is set, regardless of how the body finished). FindAdoptable must refuse a node
// in that in-between state - not just one already settled as Canceled - or C inherits a
// doomed node and glGetShaderiv reports GL_FALSE with an empty info log for valid source.
TEST_F(ShaderCompileAdoptionTest, RunningCancelRequestedNodeIsNotAdopted) {
@@ -489,7 +489,7 @@ TEST_F(ShaderCompileAdoptionTest, RunningCancelRequestedNodeIsNotAdopted) {
<< "the node already settled; the race window closed before the assertions below "
"could observe it - widen MakeVeryHeavySource's loop count";
ASSERT_TRUE(node->IsCancellationRequested());
ASSERT_FALSE(node->IsCancelled()) << "the window this test targets does not exist here";
ASSERT_FALSE(node->IsCanceled()) << "the window this test targets does not exist here";
// A brand-new shader name, byte-identical source, nothing wrong with it.
const GLuint c = CreateShader(GL_FRAGMENT_SHADER);
@@ -856,7 +856,7 @@ TEST(ShaderCompileAdoptionMapTest, EnvFingerprintMismatchIsNotAdopted) {
// A node that settled as Canceled published nothing, so adopting it would hand the new
// object a compile that can only ever report GL_FALSE. It must be a miss, and the dead entry
// must be pruned where it is found rather than waiting for the amortized sweep.
TEST(ShaderCompileAdoptionMapTest, CancelledNodeIsNotAdoptedAndIsPruned) {
TEST(ShaderCompileAdoptionMapTest, CanceledNodeIsNotAdoptedAndIsPruned) {
const auto& env = MG_Util::ShaderTranspiler::GetDefaultCompileEnv();
ShaderCompileAdoptionMap map;
const String text = "#version 460\nvoid main() {}\n";
@@ -864,7 +864,7 @@ TEST(ShaderCompileAdoptionMapTest, CancelledNodeIsNotAdoptedAndIsPruned) {
map.Register(node);
// Never posted, so this settles the node as Canceled right here.
node->Cancel();
ASSERT_TRUE(node->IsCancelled());
ASSERT_TRUE(node->IsCanceled());
ASSERT_EQ(map.GetEntryCount(), 1u);
EXPECT_EQ(map.FindAdoptable(ShaderStage::Fragment, ShaderPreprocessCache::HashSource(text), text, env->fingerprint),
@@ -1056,7 +1056,7 @@ TEST(DriverBugProbes, VertexInputLocationCeilingSaysWhenTheAttributeIsUnreachabl
// ===================== LAYERED BLIT DESTINATION =====================
TEST(DriverBugProbes, LayeredBlitDestinationIsCleanWhenTheLayerIsHonoured) {
TEST(DriverBugProbes, LayeredBlitDestinationIsCleanWhenTheLayerIsHonored) {
ResetFakeDriver();
const MG_External::GLESFunctionsTable gl = MakeFakeGLESFunctions();
EXPECT_FALSE(ProbeBlitIgnoresDestinationArrayLayer(gl));
@@ -511,7 +511,7 @@ TEST(PrimitivesGeneratedNoXfbProbeTeardownTest, AFenceTimeoutLeaksEverythingAndR
// The control: a driver that signals normally gets the ordinary teardown - idle
// wait, every object destroyed, no timeout flag - so the case above is testing the
// timeout branch and not a probe that never cleans up at all.
TEST(PrimitivesGeneratedNoXfbProbeTeardownTest, ASignalledFenceTearsDownNormally) {
TEST(PrimitivesGeneratedNoXfbProbeTeardownTest, ASignaledFenceTearsDownNormally) {
PrimitivesGeneratedNoXfbProbeContext context = FakeProbeContext();
g_fake.fenceWaitResult = VK_SUCCESS;
g_fake.streamGenerated = 1; // healthy: the capture-less draws are counted
@@ -431,7 +431,7 @@ TEST_F(DemoteFloat64Test, TheSharedChainKeepsFloat64WhenTheBackendConsumesIt) {
// The exception the vertex path needs, at the level ProgramSpirvTask asks it: no backend here can
// FETCH 64 bits, so a stage that declares a Float64 input is demoted whole even where the rest of
// its doubles could have survived.
TEST_F(DemoteFloat64Test, AFloat64VertexInputIsRecognisedAndOnlyOnAVertexStage) {
TEST_F(DemoteFloat64Test, AFloat64VertexInputIsRecognizedAndOnlyOnAVertexStage) {
const Vector<Uint32> vertexWithDoubleInput = CompileToSpirv(GL_VERTEX_SHADER, kWideVertexSource);
ASSERT_FALSE(vertexWithDoubleInput.empty());
EXPECT_TRUE(ShaderCompiler::ModuleDeclaresFloat64VertexInput(vertexWithDoubleInput));
@@ -796,7 +796,7 @@ TEST_F(DemoteFloat64Test, AComparisonAgainstZeroIsStillRewritten) {
<< "the rewrite must still fire for a genuine comparison against zero";
}
TEST_F(DemoteFloat64Test, TheThirtyTwoBitBehaviourIsUnchanged) {
TEST_F(DemoteFloat64Test, TheThirtyTwoBitBehaviorIsUnchanged) {
EXPECT_FALSE(RewritesToAnAbsoluteValueTest(CompareAgainst("float", "1.0")))
<< "a float compared against 1.0 must not be rewritten";
EXPECT_TRUE(RewritesToAnAbsoluteValueTest(CompareAgainst("float", "0.0")))
@@ -118,7 +118,7 @@ void main() { color = vec4(gl_FragCoord.x, gl_FragCoord.y, gl_FragCoord.z, gl_Fr
}
// A module without the mode is left alone.
TEST(LowerPixelCenterInteger, LeavesDefaultCentredModulesUnchanged) {
TEST(LowerPixelCenterInteger, LeavesDefaultCenteredModulesUnchanged) {
MobileGL::Initialize();
const Vector<Uint32> input = CompileFragment(R"(#version 330 core
out vec4 color;
+3 -3
View File
@@ -196,7 +196,7 @@ namespace {
EXPECT_STREQ(bufferLabel, "the buffer");
}
TEST_F(DebugTest, AnUnlabelledObjectAnswersWithAnEmptyString) {
TEST_F(DebugTest, AnUnlabeledObjectAnswersWithAnEmptyString) {
const GLuint texture = GenTexture();
MG_Impl::GLImpl::BindTexture(GL_TEXTURE_2D, texture);
DrainPendingGlErrors();
@@ -223,12 +223,12 @@ namespace {
EXPECT_STREQ(buffer, "abc");
}
TEST_F(DebugTest, LabellingSomethingThatDoesNotExistIsInvalidValue) {
TEST_F(DebugTest, LabelingSomethingThatDoesNotExistIsInvalidValue) {
MG_Impl::GLImpl::ObjectLabel(GL_TEXTURE, 0xFFFFFFFFu, -1, "nothing");
ExpectSingleGlError(GL_INVALID_VALUE);
}
TEST_F(DebugTest, LabellingANonObjectTypeIsInvalidEnum) {
TEST_F(DebugTest, LabelingANonObjectTypeIsInvalidEnum) {
const GLuint texture = GenTexture();
MG_Impl::GLImpl::BindTexture(GL_TEXTURE_2D, texture);
DrainPendingGlErrors();
+1 -1
View File
@@ -7010,7 +7010,7 @@ TEST(EtcDecoder, DecodesTheConformanceSuitesEtc2RgbImage) {
// The EAC half: a block whose multiplier is 0 still moves every texel by the bare modifier, and a
// base of 128 with modifier index 4 (+2 in table 0) reads 130 in the alpha channel; the color half
// is an individual-mode block of one flat color (all-zero indices: +2 on 0x88 = 138).
TEST(EtcDecoder, DecodesAnEacAlphaBlockAndAnIndividualModeColourBlock) {
TEST(EtcDecoder, DecodesAnEacAlphaBlockAndAnIndividualModeColorBlock) {
Uint8 block[16] = {};
block[0] = 128; // alpha base
block[1] = 0x10; // multiplier 1, table 0
+19 -19
View File
@@ -34,17 +34,17 @@ namespace {
explicit TestJob(std::function<void(TestJob&)> body = {}) : m_body(Move(body)) {}
std::atomic<Uint> ran{0};
std::atomic<Bool> observedCancelledInBody{false};
std::atomic<Bool> observedCancelledStateInBody{false};
std::atomic<Bool> observedCanceledInBody{false};
std::atomic<Bool> observedCanceledStateInBody{false};
protected:
void RunBody() override {
ran.fetch_add(1, std::memory_order_acq_rel);
if (m_body) m_body(*this);
observedCancelledInBody.store(IsCancellationRequested(), std::memory_order_release);
observedCanceledInBody.store(IsCancellationRequested(), std::memory_order_release);
// A running body sees the request, not the outcome: the node is still Running
// until it returns, which is exactly the cooperative contract.
observedCancelledStateInBody.store(IsCancelled(), std::memory_order_release);
observedCanceledStateInBody.store(IsCanceled(), std::memory_order_release);
}
private:
@@ -174,7 +174,7 @@ TEST(JobNodeSubmit, PostedJobRunsOnAPoolThreadAndWaitJoinsIt) {
EXPECT_TRUE(job->IsTerminal());
EXPECT_TRUE(job->IsComplete());
EXPECT_FALSE(job->IsCancelled());
EXPECT_FALSE(job->IsCanceled());
EXPECT_EQ(job->ran.load(), 1u);
EXPECT_TRUE(sawPoolThread.load());
// The joining thread is not a pool thread - the assert inside Wait() depends on it.
@@ -364,7 +364,7 @@ TEST(JobNodeCancel, CancelBeforeAnyDispatchSettlesTheNodeAndSkipsTheBody) {
auto job = MakeShared<TestJob>();
job->Cancel();
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
EXPECT_TRUE(job->IsTerminal());
EXPECT_FALSE(job->IsComplete());
@@ -372,10 +372,10 @@ TEST(JobNodeCancel, CancelBeforeAnyDispatchSettlesTheNodeAndSkipsTheBody) {
pool.Post(job);
job->Wait();
EXPECT_EQ(job->ran.load(), 0u);
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
}
TEST(JobNodeCancel, CancelWhileTheBodyIsRunningLetsItFinishAndReportsCancelled) {
TEST(JobNodeCancel, CancelWhileTheBodyIsRunningLetsItFinishAndReportsCanceled) {
ShaderCompilePool pool(kTestThreads);
Gate gate;
@@ -396,10 +396,10 @@ TEST(JobNodeCancel, CancelWhileTheBodyIsRunningLetsItFinishAndReportsCancelled)
job->Wait();
EXPECT_EQ(job->ran.load(), 1u);
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
EXPECT_FALSE(job->IsComplete());
EXPECT_TRUE(job->observedCancelledInBody.load());
EXPECT_FALSE(job->observedCancelledStateInBody.load());
EXPECT_TRUE(job->observedCanceledInBody.load());
EXPECT_FALSE(job->observedCanceledStateInBody.load());
}
TEST(JobNodeCancel, CancelAfterCompletionDoesNotUndoTheResult) {
@@ -413,7 +413,7 @@ TEST(JobNodeCancel, CancelAfterCompletionDoesNotUndoTheResult) {
// The request is recorded, but a settled result is never retroactively undone.
EXPECT_TRUE(job->IsCancellationRequested());
EXPECT_TRUE(job->IsComplete());
EXPECT_FALSE(job->IsCancelled());
EXPECT_FALSE(job->IsCanceled());
EXPECT_EQ(job->ran.load(), 1u);
}
@@ -426,7 +426,7 @@ TEST(JobNodeCancel, CancelReleasesContinuationsSoDependentsAreNotStranded) {
EXPECT_EQ(fired.load(), 1u);
job->Wait(); // must not hang: a canceled pending node is terminal
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
}
// ---------------------------------------------------------------------------------------
@@ -443,7 +443,7 @@ TEST(JobNodeException, AnExceptionEscapingABodyCancelsTheJobInsteadOfTerminating
job->Wait();
EXPECT_TRUE(job->IsTerminal());
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
EXPECT_FALSE(job->IsComplete());
ASSERT_EQ(job->diagnostics.logLines.size(), 1u);
EXPECT_NE(job->diagnostics.logLines[0].text.find("boom"), String::npos);
@@ -456,7 +456,7 @@ TEST(JobNodeException, ANonStandardExceptionIsContainedToo) {
pool.Post(job);
job->Wait();
EXPECT_TRUE(job->IsCancelled());
EXPECT_TRUE(job->IsCanceled());
ASSERT_EQ(job->diagnostics.logLines.size(), 1u);
}
@@ -492,15 +492,15 @@ TEST(ShaderCompilePoolDrain, StopAndDrainWithAThousandQueuedJobsLeavesNoneRunnin
// Every node is terminal, so nothing can be waiting on a worker that will never come.
Uint complete = 0;
Uint cancelled = 0;
Uint canceled = 0;
for (const auto& job : jobs) {
ASSERT_TRUE(job->IsTerminal());
if (job->IsComplete()) ++complete;
if (job->IsCancelled()) ++cancelled;
if (job->IsCanceled()) ++canceled;
EXPECT_LE(job->ran.load(), 1u);
}
EXPECT_EQ(complete + cancelled, kJobs);
EXPECT_GT(cancelled, 0u); // the drain really did abandon queued work rather than run it
EXPECT_EQ(complete + canceled, kJobs);
EXPECT_GT(canceled, 0u); // the drain really did abandon queued work rather than run it
}
TEST(ShaderCompilePoolDrain, StopAndDrainWaitsForARunningBodyToReturn) {
+2 -2
View File
@@ -347,7 +347,7 @@ namespace {
PS::AdvanceSummaryWindow();
// And it obeys the file's LABEL rule, not a rule of its own: the new window has no
// Present in it, so the bracket is relabelled "bytes[" and `seg` carries the window
// Present in it, so the bracket is relabeled "bytes[" and `seg` carries the window
// TOTAL verbatim rather than a figure divided by a faked frame count. That is the same
// rule the bytes[] bracket follows and the same one the two window-total tests below
// pin; asserting "seg=0.00" here is what the first cut of this case did, and it was
@@ -488,7 +488,7 @@ namespace {
EXPECT_EQ(PS::FrameCount(), 0u);
EXPECT_NE(line.find("window=0"), String::npos) << line;
EXPECT_NE(line.find("draws/f=n/a"), String::npos) << line;
// The bracket is relabelled rather than divided: totals, and marked as totals.
// The bracket is relabeled rather than divided: totals, and marked as totals.
EXPECT_EQ(line.find("bytes/f["), String::npos) << line;
EXPECT_NE(line.find("bytes[buf=1404550"), String::npos) << line;
}
@@ -7,7 +7,7 @@
// End of Source File Header
// P11 B1 (CONTRACT-P11 B1): the apply thread's affinity and spin, selected per session from the
// peer's Hello dial mode and data plane, and the core reserved for a dialled-in shared-segment peer
// peer's Hello dial mode and data plane, and the core reserved for a dialed-in shared-segment peer
// on every topology shape that matters - the Redmi's (cpu0-5 performance, cpu6-7 prime: big 0xc0,
// prime 0xc0 of 0xff), a lone prime core beside other big cores, a lone prime core alone, symmetric
// machines, an unreadable topology.
@@ -40,13 +40,13 @@ TEST(ApplyThreadPolicy, AutoKeepsEveryBigCoreAndTheConfiguredSpinForAnInProcessO
for (const ApplyPeer peer : {ApplyPeer::InProcess, ApplyPeer::Forked}) {
const auto policy =
SelectApplyThreadPolicy("auto", false, kConfigured, peer, kShm, kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_TRUE(policy.recognised);
EXPECT_TRUE(policy.recognized);
EXPECT_EQ(policy.requestedMask, kRedmiBig) << ApplyPeerName(peer);
EXPECT_EQ(policy.spinUs, kConfigured) << ApplyPeerName(peer);
}
}
TEST(ApplyThreadPolicy, AutoKeepsEveryBigCoreForADialledInPeerOnTheStreamPlane) {
TEST(ApplyThreadPolicy, AutoKeepsEveryBigCoreForADialedInPeerOnTheStreamPlane) {
// tcp: an io thread feeds the apply thread; nothing changes for a TCP client.
const auto policy = SelectApplyThreadPolicy("auto", false, kConfigured, ApplyPeer::Connected, kStream, kRedmiBig,
kRedmiPrime, kRedmiOnline);
@@ -56,7 +56,7 @@ TEST(ApplyThreadPolicy, AutoKeepsEveryBigCoreForADialledInPeerOnTheStreamPlane)
TEST(ApplyThreadPolicy, SeveralPrimeCoresGiveTheApplyThreadTheLowestOfThem) {
const auto policy = Connected("auto", kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_TRUE(policy.recognised);
EXPECT_TRUE(policy.recognized);
EXPECT_EQ(policy.requestedMask, 0x40u)
<< "the LOWEST prime core: the scheduler puts a foreground client's GL thread on the highest";
EXPECT_EQ(policy.spinUs, kConnectedPeerSpinUs);
@@ -116,7 +116,7 @@ TEST(ApplyThreadPolicy, AnEmptyOrMissingAffinityIsAuto) {
}
}
TEST(ApplyThreadPolicy, AnExplicitSpinWinsForADialledInPeer) {
TEST(ApplyThreadPolicy, AnExplicitSpinWinsForADialedInPeer) {
const auto policy =
SelectApplyThreadPolicy("auto", true, 7, ApplyPeer::Connected, kShm, kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_EQ(policy.spinUs, 7u);
@@ -128,12 +128,12 @@ TEST(ApplyThreadPolicy, AnExplicitMaskOrOffWinsForEveryPeerAndPlaneAndReservesNo
for (const Bool plane : {kShm, kStream}) {
const auto off =
SelectApplyThreadPolicy("off", false, kConfigured, peer, plane, kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_TRUE(off.recognised);
EXPECT_TRUE(off.recognized);
EXPECT_EQ(off.requestedMask, 0u) << ApplyPeerName(peer);
EXPECT_EQ(off.spinUs, kConfigured) << "an operator's affinity keeps the configured spin";
const auto mask =
SelectApplyThreadPolicy("0x80", false, kConfigured, peer, plane, kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_TRUE(mask.recognised);
EXPECT_TRUE(mask.recognized);
EXPECT_EQ(mask.requestedMask, 0x80u) << ApplyPeerName(peer);
EXPECT_EQ(
SelectApplyThreadPolicy("12", false, kConfigured, peer, plane, kRedmiBig, kRedmiPrime, kRedmiOnline)
@@ -146,10 +146,10 @@ TEST(ApplyThreadPolicy, AnExplicitMaskOrOffWinsForEveryPeerAndPlaneAndReservesNo
EXPECT_EQ(ReservedApplyCoreForConfig("off", kRedmiBig, kRedmiPrime, kRedmiOnline), 0u);
}
TEST(ApplyThreadPolicy, UnrecognisedAffinityTextAppliesNothingAndSaysSo) {
TEST(ApplyThreadPolicy, UnrecognizedAffinityTextAppliesNothingAndSaysSo) {
for (const char* text : {"big", "0xzz", "auto ", "3cores"}) {
const auto policy = Connected(text, kRedmiBig, kRedmiPrime, kRedmiOnline);
EXPECT_FALSE(policy.recognised) << text;
EXPECT_FALSE(policy.recognized) << text;
EXPECT_EQ(policy.requestedMask, 0u) << text;
}
}
@@ -111,12 +111,12 @@ namespace {
};
// A<<24|B<<16|G<<8|R of the texel each thread draws.
Uint32 ColourOf(int index) {
Uint32 ColorOf(int index) {
return 0xFF000000u | (0x40u + 0x50u * static_cast<Uint32>(index % 3)) << 8 |
(0x20u + 0x30u * static_cast<Uint32>(index / 3));
}
// The clear color of a churn cycle (ReadbackRace): a different one per thread and cycle.
Uint32 ChurnColourOf(int index, int cycle) {
Uint32 ChurnColorOf(int index, int cycle) {
return 0xFF000000u | (0x10u * static_cast<Uint32>(index)) << 16 |
(static_cast<Uint32>(cycle * 7) & 0xFFu) << 8 | 0x80u;
}
@@ -151,7 +151,7 @@ namespace {
GLuint program = 0;
GLuint vertexArray = 0;
GLuint texture = 0;
Uint32 colour = 0;
Uint32 color = 0;
};
// The thread's program, vertex array and one-texel texture of its own color.
@@ -183,12 +183,12 @@ namespace {
if (!linked) glGetProgramInfoLog(drawing.program, sizeof(out->linkLog) - 1, nullptr, out->linkLog);
glGenVertexArrays(1, &drawing.vertexArray);
glGenTextures(1, &drawing.texture);
drawing.colour = ColourOf(index);
drawing.color = ColorOf(index);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, drawing.texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &drawing.colour);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &drawing.color);
return drawing;
}
@@ -218,7 +218,7 @@ namespace {
glDrawArrays(GL_TRIANGLES, 0, 3);
Uint32 pixel = 0x5A5A5A5Au;
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
Tally(out, frame, pixel, drawing.colour);
Tally(out, frame, pixel, drawing.color);
}
// The frames a thread draws: staggered, so the threads finish (and tear down) one after another
@@ -326,20 +326,19 @@ namespace {
GLuint texture = 0;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
const Uint32 texel = ChurnColourOf(index, cycle);
const Uint32 texel = ChurnColorOf(index, cycle);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &texel);
GLuint vertexArray = 0;
glGenVertexArrays(1, &vertexArray);
glBindVertexArray(vertexArray);
const Uint32 colour = ChurnColourOf(index, cycle);
const Uint32 color = ChurnColorOf(index, cycle);
glViewport(0, 0, 8, 8);
glClearColor(static_cast<float>(colour & 0xFFu) / 255.0f,
static_cast<float>((colour >> 8) & 0xFFu) / 255.0f,
static_cast<float>((colour >> 16) & 0xFFu) / 255.0f, 1.0f);
glClearColor(static_cast<float>(color & 0xFFu) / 255.0f, static_cast<float>((color >> 8) & 0xFFu) / 255.0f,
static_cast<float>((color >> 16) & 0xFFu) / 255.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
Uint32 pixel = 0x5A5A5A5Au;
glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
Tally(out, cycle, pixel, colour);
Tally(out, cycle, pixel, color);
if (cycle % 2 == 0) glDeleteTextures(1, &texture); // the odd ones die with the context
(void)eglMakeCurrent(rig->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
(void)eglDestroyContext(rig->dpy, context);
@@ -105,7 +105,7 @@ TEST(PersistentMapFaultOwnership, AKernelsUntaggedFaultAddressIsOwnedByATaggedSh
// The same row without needing the host to ignore a top byte at all: the predicate is fed a
// composed slot, so it runs everywhere and goes red everywhere the normalization is dropped.
// This is the case the gate rests on; the one above is the device's literal reproduction.
TEST(PersistentMapFaultOwnership, TheOwnershipRowNormalisesBothSidesBeforeItCompares) {
TEST(PersistentMapFaultOwnership, TheOwnershipRowNormalizesBothSidesBeforeItCompares) {
SizeT pageIndex = ~static_cast<SizeT>(0);
const uintptr_t base = PersistentMapTracker::UntagAddressForTest(kDeviceTaggedShadowBase);
// Untagged base against untagged fault: owned, on this host and on the device alike.
+2 -2
View File
@@ -777,7 +777,7 @@ TEST_F(PipeWireCodecTest, EveryPayloadByteCrossesIncludingTheOnesSpelledPad) {
//
// So this case asserts the whole payload byte for byte rather than the named fields: a
// test that compared only the members would go green through exactly that bug.
// IT NAMES NO PAD MEMBER, deliberately. The whole struct is stamped with a recognisable
// IT NAMES NO PAD MEMBER, deliberately. The whole struct is stamped with a recognizable
// byte first and only the fields the decoder validates are then written, so whatever is
// left - Pad0, Pad1, or the names a later phase gives them - still carries the stamp and a
// memcmp over the whole payload is the assertion. A case that named `Pad0` would stop
@@ -2097,7 +2097,7 @@ TEST_F(PipeWireCodecTest, TheStageMarkQueueStaysBoundedWithOneRecordAlwaysInFlig
// ---- M4: the reply slot is for kReplySlot rows only ----------------------------------------
TEST_F(PipeWireCodecTest, NoReplyIsWrittenForARowTheCatalogueGivesNoReplySlot) {
TEST_F(PipeWireCodecTest, NoReplyIsWrittenForARowTheCatalogGivesNoReplySlot) {
// s1 sizes ReplyPool from MGPipeCallFlagsFor, so a reply written for a record the pool
// reserved no slot for overwrites a waiter's answer - and because the slot header stamps
// the WRITER's seq for self-check, the waiter's check then fails for ever and the barrier
@@ -1024,7 +1024,7 @@ TEST(RemoteClientControls, TextureUploadsStopOwningAReplyOnTheWireArm) {
MG_State::pGLContext = MakeUnique<MG_State::GLState::GLContext>();
Uint8 pixels[4 * 4 * 4];
std::memset(pixels, 0x21, sizeof(pixels));
// THE CONTROL ROW, NAMED RATHER THAN TOTALLED, AND MEASURED ACROSS THE WHOLE SETUP. The
// THE CONTROL ROW, NAMED RATHER THAN TOTALED, AND MEASURED ACROSS THE WHOLE SETUP. The
// object's create is the one record an object always pays for (kWaitReply in
// PipeCalls.def), so ITS counter is the live control - and the baseline goes in before
// GenTextures, because which call publishes the twin (generate, bind or the storage
+6 -6
View File
@@ -394,7 +394,7 @@ TEST(RemoteEmitTable, TheSevenI1SlotsAreClassBAndAreNotTheFatalThunk) {
// rather than counted, so a table that flipped a DIFFERENT seven is red here and not only
// in the arithmetic. This case used to compare each slot against a slot that was still
// class C; since P10 B there is none left to compare against, so the class is decided
// behaviourally by EachI1SlotReachesRequireSessionUnderItsOwnName below and this case keeps
// behaviorally by EachI1SlotReachesRequireSessionUnderItsOwnName below and this case keeps
// the pointer facts that need no fork.
const MG_Backend::GlobalBackendFunctionsTable& table = RemoteEmitTable();
const void* const i1[] = {
@@ -1438,7 +1438,7 @@ TEST(RemoteReadback, ABandedScatterWritesExactlyTheBytesTheWholeScatterWrites) {
// =====================================================================================
TEST(PipeRouting, TheTablesAreInstalledWithoutAnybodyHavingRememberedTo) {
// The gate on the install MECHANISM rather than on the table contents (PipeCatalogueTest
// The gate on the install MECHANISM rather than on the table contents (PipeCatalogTest
// owns the partition). Nothing in this file calls an installer; the tables are installed
// because MG_Pipe/PipeRoute.h's inline variable is in this binary, which is the property
// that a static initializer inside PipeRoute.cpp did NOT have - the linker dropped that
@@ -1521,7 +1521,7 @@ TEST(PipeRouting, AnErrorStatusIsNotFoldedIntoAcceptedOrRefused) {
namespace {
// How many function-pointer cells of `a` differ from `b`, walked as a block of void* -
// the structs ARE their function pointers (PipeCatalogueTest static_asserts that shape). A
// the structs ARE their function pointers (PipeCatalogTest static_asserts that shape). A
// routed row that stayed on the monolith adapter reads EQUAL and is not counted, which is
// exactly the defect this measures.
template <class T>
@@ -1536,7 +1536,7 @@ namespace {
} // namespace
TEST(PipeRouting, TheInstalledClientArmIsWireAndNotMonolithAndEveryRoutedRowMoved) {
// WHAT B3 SAYS IS MISSING. PipeCatalogueTest installs and COUNTS the monolith table, so a
// WHAT B3 SAYS IS MISSING. PipeCatalogTest installs and COUNTS the monolith table, so a
// client row that was never overwritten stays non-null and still counts - deleting one
// `gMGPipe*.X = &Wire_X` assignment left every gate green (the cross-family verifier
// reproduced it: catalog 32/32, all lanes green). The only thing that catches it is
@@ -3171,13 +3171,13 @@ TEST(RemoteRunAhead, ARepublishedServerWindowExtentResizesTheServerOwnedSurfaceA
republish();
if (ClientSessionInstance().DrainPublishedEvents() < 1u) ::_exit(92);
if (query(EGL_WIDTH) != 2560 || query(EGL_HEIGHT) != 1600) ::_exit(93);
const IntVec3 colour =
const IntVec3 color =
static_cast<MG_State::GLState::TextureObject2D*>(defaultFramebuffer->colorAttachment.get())
->GetMipmapTexelSize(TextureUploadTarget::Texture2D, 0);
const IntVec3 depth =
static_cast<MG_State::GLState::TextureObject2D*>(defaultFramebuffer->depthAttachment.get())
->GetMipmapTexelSize(TextureUploadTarget::Texture2D, 0);
if (colour.x() != 2560 || colour.y() != 1600 || depth.x() != 2560 || depth.y() != 1600) ::_exit(94);
if (color.x() != 2560 || color.y() != 1600 || depth.x() != 2560 || depth.y() != 1600) ::_exit(94);
// A format-only event (a pbuffer's, a client-named window's) says nothing about the size.
s_info.Width = 0;
+1 -1
View File
@@ -45,7 +45,7 @@ namespace {
std::uint64_t Capacity() const { return m_capacity; }
bool Invariants() const { return RingCursorsValid(m_control, m_cursors, m_capacity); }
// Writes one record whose payload is `size` bytes of a recognisable
// Writes one record whose payload is `size` bytes of a recognizable
// pattern seeded by `seed`.
bool WriteRecord(std::uint16_t kind, std::uint64_t size, std::uint8_t seed) {
void* payload = m_producer.Reserve(kind, kRecNone, size);
@@ -41,7 +41,7 @@ namespace {
}
} // namespace
TEST(ServerContextLiveTest, OneSessionsReleaseDoesNotKillANeighboursContext) {
TEST(ServerContextLiveTest, OneSessionsReleaseDoesNotKillANeighborsContext) {
const MG_Pipe::PipeInputsThreadResolver previous = MG_Pipe::g_pipeInputsThreadResolver;
MG_Pipe::g_pipeInputsThreadResolver = &ResolveTestSessionBlock;
auto* kwinBlock = new MG_Pipe::PipeInputs();
+5 -5
View File
@@ -496,14 +496,14 @@ TEST(ServerDisplayTest, InterruptAndTheCancelPredicateEndAWaitByName) {
ServerWindowAcquire::Interrupted);
interrupter.join();
static std::atomic<bool> cancelled{false};
cancelled.store(false);
static std::atomic<bool> canceled{false};
canceled.store(false);
std::thread canceller([] {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
cancelled.store(true);
canceled.store(true);
});
const auto cancel = [](void*) -> Bool { return cancelled.load(); };
EXPECT_EQ(display.AcquireFor(0, 0, 5000, this, nullptr, cancel, nullptr, &lease), ServerWindowAcquire::Cancelled);
const auto cancel = [](void*) -> Bool { return canceled.load(); };
EXPECT_EQ(display.AcquireFor(0, 0, 5000, this, nullptr, cancel, nullptr, &lease), ServerWindowAcquire::Canceled);
canceller.join();
// And Uninstall: the display is gone, the waiter hears NoDisplay.
+6 -6
View File
@@ -3896,11 +3896,11 @@ namespace {
kSuspendLatched = 2, // the session latched, or the apply thread left
kSuspendBackend =
4, // the backend was not asked to suspend exactly once, on the apply thread, for the lost window
kSuspendState = 8, // the loop's counters / the display's lease and wait are not the suspended state
kSuspendRecords = 16, // presents after the loss were not applied (all of them, none reaching a window)
kSuspendResume = 32, // a new window did not resume the session on it, on the apply thread
kSuspendAgain = 64, // the resumed session did not suspend again on the next loss
kSuspendNotCancelled = 128, // the session's end left it waiting for a window
kSuspendState = 8, // the loop's counters / the display's lease and wait are not the suspended state
kSuspendRecords = 16, // presents after the loss were not applied (all of them, none reaching a window)
kSuspendResume = 32, // a new window did not resume the session on it, on the apply thread
kSuspendAgain = 64, // the resumed session did not suspend again on the next loss
kSuspendNotCanceled = 128, // the session's end left it waiting for a window
};
[[noreturn]] void SuspendResumeAndExit() {
@@ -3950,7 +3950,7 @@ namespace {
failed |= kSuspendAgain;
fixture.Stop();
if (display.SuspendedHolders() != 0) failed |= kSuspendNotCancelled;
if (display.SuspendedHolders() != 0) failed |= kSuspendNotCanceled;
std::fprintf(stderr, "[suspend] suspends=%d resumes=%d presents=%d (%d without a window) lost=%llu\n",
WindowBackendDouble::suspends.load(), WindowBackendDouble::resumes.load(),
WindowBackendDouble::presents.load(), WindowBackendDouble::presentsWithoutWindow.load(),
+1 -1
View File
@@ -1569,7 +1569,7 @@ TEST(ServerSpawnTest, AnFdPairTheBrokerConnectedBringsASharedSegmentSessionUp) {
EXPECT_LT(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - start).count(),
4000);
EXPECT_TRUE(Client::ClientSession::Active() != nullptr);
EXPECT_TRUE(Client::ClientSessionInstance().ConnectDial()) << "an fd: pair is a dialled-in (Connect) session";
EXPECT_TRUE(Client::ClientSessionInstance().ConnectDial()) << "an fd: pair is a dialed-in (Connect) session";
EXPECT_NE(::fcntl(control, F_GETFD) & FD_CLOEXEC, 0) << "an adopted descriptor must not leak into children";
Client::ClientSessionInstance().Stop();
int exitCode = -1;
@@ -127,7 +127,7 @@ TEST(SessionHandshakeTest, TheAbiFingerprintChangesWhenAnyOfItsInputsDoes) {
EXPECT_EQ(inputs.DynamicParamsSize, sizeof(MG_Backend::DynamicBackendParameters));
EXPECT_EQ(inputs.CapsSize, sizeof(MG_Pipe::MGPCaps));
EXPECT_EQ(inputs.MemberLayout, MG_Pipe::kMGPipeWireMemberLayoutDigest);
EXPECT_EQ(inputs.CatalogueLayout, MG_Pipe::kMGPipeWireCatalogueDigest);
EXPECT_EQ(inputs.CatalogLayout, MG_Pipe::kMGPipeWireCatalogDigest);
EXPECT_EQ(inputs.RenderStateLayout, MG_Pipe::WireRenderStateDigest());
EXPECT_EQ(inputs.ProgramArtifactsCodecVersion, MG_State::GLState::kProgramArtifactsCodecVersion);
EXPECT_EQ(inputs.ProgramArtifactsSchema, MG_State::GLState::ProgramArtifactsSchemaFingerprint());
@@ -147,7 +147,7 @@ TEST(SessionHandshakeTest, TheAbiFingerprintChangesWhenAnyOfItsInputsDoes) {
EXPECT_NE(production, perturbed([](auto& i) { ++i.DynamicParamsSize; })) << "DynamicParamsSize";
EXPECT_NE(production, perturbed([](auto& i) { ++i.CapsSize; })) << "CapsSize";
EXPECT_NE(production, perturbed([](auto& i) { ++i.MemberLayout; })) << "MemberLayout";
EXPECT_NE(production, perturbed([](auto& i) { ++i.CatalogueLayout; })) << "CatalogueLayout";
EXPECT_NE(production, perturbed([](auto& i) { ++i.CatalogLayout; })) << "CatalogLayout";
EXPECT_NE(production, perturbed([](auto& i) { ++i.RenderStateLayout; })) << "RenderStateLayout";
EXPECT_NE(production, perturbed([](auto& i) { ++i.FormatCapabilityTargets; })) << "FormatCapabilityTargets";
EXPECT_NE(production, perturbed([](auto& i) { ++i.FormatCapabilityFormats; })) << "FormatCapabilityFormats";
+3 -3
View File
@@ -504,7 +504,7 @@ TEST(SharedImageYuv, ThePlaneCopyFillsEveryDestinationLayout) {
// The conversion an import's hints select: BT.709 narrow-range codes of saturated colors decode
// to those colors, and the defaults are BT.601 narrow.
TEST(SharedImageYuv, TheConversionDecodesTheHintedColourSpace) {
TEST(SharedImageYuv, TheConversionDecodesTheHintedColorSpace) {
const auto decode = [](const SI::Yuv::Conversion& c, double y, double cb, double cr, double max) {
const double in[3] = {y / max - c.Offset[0], cb / max - c.Offset[1], cr / max - c.Offset[2]};
std::array<double, 3> rgb{};
@@ -529,9 +529,9 @@ TEST(SharedImageYuv, TheConversionDecodesTheHintedColourSpace) {
SI::Yuv::Hints full;
full.Range = SI::Yuv::kEglYuvFullRange;
const auto cFull = SI::Yuv::ConversionFor(full, 255.0);
const auto grey = decode(cFull, 128, 128, 128, 255.0);
const auto gray = decode(cFull, 128, 128, 128, 255.0);
for (int k = 0; k < 3; ++k)
EXPECT_NEAR(grey[k], 128.0 / 255.0, 0.005);
EXPECT_NEAR(gray[k], 128.0 / 255.0, 0.005);
EXPECT_EQ(SI::Yuv::Hints{}.EffectiveColorSpace(), SI::Yuv::kEglItuRec601);
EXPECT_FALSE(SI::Yuv::Hints{}.FullRange());
}
@@ -188,7 +188,7 @@ namespace {
EXPECT_FALSE(Upload(32768, 0x99));
EXPECT_TRUE(Client::ClientSession::DeviceLost());
EXPECT_EQ(MG_Impl::GLImpl::GetGraphicsResetStatus(), GL_UNKNOWN_CONTEXT_RESET);
EXPECT_TRUE(client.Encoder().Cancelled());
EXPECT_TRUE(client.Encoder().Canceled());
EXPECT_EQ(client.Encoder().EmitSeq(), 0u);
EXPECT_EQ(client.LastPublishedSeq(), 0u);
EXPECT_TRUE(StageIs(0x33));
+2 -2
View File
@@ -47,7 +47,7 @@ def cases():
site = '&MGPipeRouteResourceDestroy);'
return [
('B1-source', FILL, replace(site, '&MGPipeApplyResourceDestroy);'),
['PipeCatalogue.FrontendNeverTakesAnApplierAddress'], 'PipeCatalogueTest'),
['PipeCatalog.FrontendNeverTakesAnApplierAddress'], 'PipeCatalogTest'),
('B1-wire', FILL, replace(site, '&MGPipeApplyResourceDestroy);'),
[SUITE+'DeleteTexturesAdvancesTheWireOrdinal'], 'RemoteClientTest'),
('N2-five-verbs', EMIT, replace(' RequireClientTablesInstalled(slot);', ''),
@@ -126,7 +126,7 @@ def main():
for label, file, mutate, names, target in selected:
path = ROOT / file
original = path.read_bytes()
binary = ROOT / 'build-split/MobileGL/MG_Test' / ('Pipe' if target == 'PipeCatalogueTest' else 'Wire') / target
binary = ROOT / 'build-split/MobileGL/MG_Test' / ('Pipe' if target == 'PipeCatalogTest' else 'Wire') / target
build = ['cmake', '--build', 'build-split', '-j', '24', '--target', target]
run = [str(binary), '--gtest_filter='+':'.join(names)]
# ID-67: both replacement cases must execute green before/after this mutation.