Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions ci/builders/mac_unopt.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,20 @@
"use_rbe": true
},
"gn": [
"--runtime-mode",
"debug",
"--unoptimized",
"--no-lto",
"--prebuilt-dart-sdk",
"--force-mac-arm64",
"--mac-cpu",
"arm64",
"--rbe",
"--no-goma",
"--xcode-symlinks"
"--runtime-mode",
"debug",
"--unoptimized",
"--no-lto",
"--prebuilt-dart-sdk",
"--force-mac-arm64",
"--enable-impeller-vulkan",
"--enable-impeller-opengles",
Comment on lines +134 to +135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to do this here, but unless there are issues I'm not aware of we should remove these flags. its too dangerous that we have a "by default don't test our impeller backends" setting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean: These flags are true by default, and disabled explicitly when building for release to omit the unneeded backends?

"--use-glfw-swiftshader",
"--mac-cpu",
"arm64",
"--rbe",
"--no-goma",
"--xcode-symlinks"
],
"name": "host_debug_unopt_arm64",
"ninja": {
Expand All @@ -157,7 +160,7 @@
"--variant",
"host_debug_unopt_arm64",
"--type",
"dart,dart-host,engine",
"dart,dart-host,engine,impeller-golden",
"--engine-capture-core-dump"
]
}
Expand Down
50 changes: 27 additions & 23 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,30 @@ def find_executable_path(path):
raise Exception('Executable %s does not exist!' % path)


def metal_validation_env(build_dir):
extra_env = {
# pylint: disable=line-too-long
# See https://developer.apple.com/documentation/metal/diagnosing_metal_programming_issues_early?language=objc
'MTL_SHADER_VALIDATION': '1', # Enables all shader validation tests.
'MTL_SHADER_VALIDATION_GLOBAL_MEMORY':
'1', # Validates accesses to device and constant memory.
'MTL_SHADER_VALIDATION_THREADGROUP_MEMORY': '1', # Validates accesses to threadgroup memory.
'MTL_SHADER_VALIDATION_TEXTURE_USAGE': '1', # Validates that texture references are not nil.
# Note: built from //third_party/swiftshader
'VK_ICD_FILENAMES': os.path.join(build_dir, 'vk_swiftshader_icd.json'),
# Note: built from //third_party/vulkan_validation_layers:vulkan_gen_json_files
# and //third_party/vulkan_validation_layers.
'VK_LAYER_PATH': os.path.join(build_dir, 'vulkan-data'),
'VK_INSTANCE_LAYERS': 'VK_LAYER_KHRONOS_validation',
}
if is_aarm64():
extra_env.update({
'METAL_DEBUG_ERROR_MODE': '0', # Enables metal validation.
'METAL_DEVICE_WRAPPER_TYPE': '1', # Enables metal validation.
})
return extra_env


def build_engine_executable_command(
build_dir, executable_name, flags=None, coverage=False, gtest=False
):
Expand Down Expand Up @@ -474,28 +498,7 @@ def make_test(name, flags=None, extra_env=None):
shuffle_flags,
coverage=coverage
)
extra_env = {
# pylint: disable=line-too-long
# See https://developer.apple.com/documentation/metal/diagnosing_metal_programming_issues_early?language=objc
'MTL_SHADER_VALIDATION': '1', # Enables all shader validation tests.
'MTL_SHADER_VALIDATION_GLOBAL_MEMORY':
'1', # Validates accesses to device and constant memory.
'MTL_SHADER_VALIDATION_THREADGROUP_MEMORY':
'1', # Validates accesses to threadgroup memory.
'MTL_SHADER_VALIDATION_TEXTURE_USAGE':
'1', # Validates that texture references are not nil.
# Note: built from //third_party/swiftshader
'VK_ICD_FILENAMES': os.path.join(build_dir, 'vk_swiftshader_icd.json'),
# Note: built from //third_party/vulkan_validation_layers:vulkan_gen_json_files
# and //third_party/vulkan_validation_layers.
'VK_LAYER_PATH': os.path.join(build_dir, 'vulkan-data'),
'VK_INSTANCE_LAYERS': 'VK_LAYER_KHRONOS_validation',
}
if is_aarm64():
extra_env.update({
'METAL_DEBUG_ERROR_MODE': '0', # Enables metal validation.
'METAL_DEVICE_WRAPPER_TYPE': '1', # Enables metal validation.
})
extra_env = metal_validation_env(build_dir)
mac_impeller_unittests_flags = shuffle_flags + [
'--enable_vulkan_validation',
'--gtest_filter=-*OpenGLES' # These are covered in the golden tests.
Expand Down Expand Up @@ -1036,7 +1039,8 @@ def run_impeller_golden_tests(build_dir: str):
harvester_path: Path = Path(SCRIPT_DIR).parent.joinpath('tools'
).joinpath('golden_tests_harvester')
with tempfile.TemporaryDirectory(prefix='impeller_golden') as temp_dir:
run_cmd([tests_path, f'--working_dir={temp_dir}'], cwd=build_dir)
extra_env = extra_env = metal_validation_env(build_dir)
run_cmd([tests_path, f'--working_dir={temp_dir}'], cwd=build_dir, env=extra_env)
dart_bin = os.path.join(build_dir, 'dart-sdk', 'bin', 'dart')
golden_path = os.path.join('testing', 'impeller_golden_tests_output.txt')
script_path = os.path.join('tools', 'dir_contents_diff', 'bin', 'dir_contents_diff.dart')
Expand Down