diff --git a/.github/openclaw/qualification/upstream-async/AsyncStackTrace.cpp b/.github/openclaw/qualification/upstream-async/AsyncStackTrace.cpp new file mode 100644 index 0000000000000..40343fdd9de39 --- /dev/null +++ b/.github/openclaw/qualification/upstream-async/AsyncStackTrace.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2026 Vincent Koc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace TestWebKitAPI { + +TEST(JavaScriptCore_AsyncStackTrace, SuspendedFrameUsesResumeInstruction) +{ + auto context = JSGlobalContextCreate(nullptr); + ASSERT_NE(context, nullptr); + auto releaseContext = makeScopeExit([&] { + JSC::JSLockHolder locker(toJS(context)); + JSGlobalContextRelease(context); + }); + + auto* globalObject = toJS(context); + auto& vm = globalObject->vm(); + JSC::JSLockHolder locker(vm); + + ASSERT_TRUE(JSC::Options::useAsyncStackTrace()); + ASSERT_FALSE(JSC::Options::runsCompiledImage()); + + auto script = JSStringCreateWithUTF8CString(R"JS( + globalThis.pending = new Promise(() => {}); + globalThis.operation = (async function paused() { + await globalThis.pending; + })(); + globalThis.pending; + )JS"); + ASSERT_NE(script, nullptr); + JSValueRef exception = nullptr; + auto result = JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception); + JSStringRelease(script); + ASSERT_EQ(exception, nullptr); + ASSERT_NE(result, nullptr); + + JSC::DeferGCForAWhile deferGC(vm); + auto* promise = dynamicDowncast(toJS(globalObject, result)); + ASSERT_NE(promise, nullptr); + ASSERT_EQ(promise->status(), JSC::JSPromise::Status::Pending); + + auto* generator = dynamicDowncast(promise->asyncStackTraceContext()); + ASSERT_NE(generator, nullptr); + ASSERT_EQ(generator->state(), 1); + + WTF::Vector frames; + JSC::Interpreter::appendAsyncStackFrame(vm, globalObject, frames, generator); + ASSERT_EQ(frames.size(), 1u); + + const auto& frame = frames[0]; + auto* codeBlock = frame.codeBlock(); + ASSERT_NE(codeBlock, nullptr); + ASSERT_TRUE(frame.hasBytecodeIndex()); + ASSERT_EQ(codeBlock->numberOfUnlinkedSwitchJumpTables(), 1u); + + unsigned switchOffset = 0; + unsigned switchCount = 0; + for (const auto& instruction : codeBlock->instructions()) { + if (instruction->opcodeID() == JSC::op_switch_imm) { + switchOffset = instruction.offset(); + ++switchCount; + } + } + ASSERT_EQ(switchCount, 1u); + ASSERT_GT(switchOffset, 0u); + + auto relativeOffset = codeBlock->unlinkedSwitchJumpTable(0).offsetForValue(generator->state()); + ASSERT_GT(relativeOffset, 0); + unsigned resumeOffset = switchOffset + static_cast(relativeOffset); + bool isResumeInstruction = false; + for (const auto& instruction : codeBlock->instructions()) { + if (instruction.offset() == resumeOffset) { + isResumeInstruction = true; + break; + } + } + ASSERT_TRUE(isResumeInstruction); + + EXPECT_EQ(frame.bytecodeIndex().offset(), resumeOffset) + << "switch offset: " << switchOffset << ", relative target: " << relativeOffset; +} + +} // namespace TestWebKitAPI diff --git a/.github/openclaw/qualification/upstream-async/build-adapter.patch b/.github/openclaw/qualification/upstream-async/build-adapter.patch new file mode 100644 index 0000000000000..79d435eafff33 --- /dev/null +++ b/.github/openclaw/qualification/upstream-async/build-adapter.patch @@ -0,0 +1,51 @@ +diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt +--- a/Source/JavaScriptCore/CMakeLists.txt ++++ b/Source/JavaScriptCore/CMakeLists.txt +@@ -2447,6 +2447,15 @@ + + WEBKIT_FRAMEWORK(JavaScriptCore) + ++# A static JavaScriptCore leaves the table of built-ins to the program that links it. Compiled once, for all of them. ++if (ENABLE_STATIC_JSC) ++ add_library(aot-builtin-table-obj OBJECT EXCLUDE_FROM_ALL ${JavaScriptCore_AOT_BUILTIN_TABLE_DATA_SOURCES}) ++ target_include_directories(aot-builtin-table-obj PRIVATE $) ++ target_compile_definitions(aot-builtin-table-obj PRIVATE $) ++ target_compile_options(aot-builtin-table-obj PRIVATE $) ++ add_dependencies(aot-builtin-table-obj JavaScriptCore) ++endif () ++ + if (USE_APPLE_INTERNAL_SDK) + WEBKIT_TARGET_USE_PGO(JavaScriptCore PROFILE JavaScriptCore) + endif () +diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt +--- a/Source/JavaScriptCore/shell/CMakeLists.txt ++++ b/Source/JavaScriptCore/shell/CMakeLists.txt +@@ -3,13 +3,7 @@ + list(TRANSFORM JavaScriptCore_AOT_TEST_SOURCES PREPEND ../ OUTPUT_VARIABLE aotTestSources) + list(APPEND aotTestSources ${JavaScriptCore_AOT_SCHEMA_GENERATED_TEST_SOURCES}) + +-# A static JavaScriptCore leaves the table of built-ins to the program that links it. Compiled once, for all of them. + if (ENABLE_STATIC_JSC) +- add_library(aot-builtin-table-obj OBJECT ${JavaScriptCore_AOT_BUILTIN_TABLE_DATA_SOURCES}) +- target_include_directories(aot-builtin-table-obj PRIVATE $) +- target_compile_definitions(aot-builtin-table-obj PRIVATE $) +- target_compile_options(aot-builtin-table-obj PRIVATE $) +- add_dependencies(aot-builtin-table-obj JavaScriptCore) + set(aotBuiltinTableObjects $) + list(APPEND aotProgramSources ${aotBuiltinTableObjects}) + endif () +diff --git a/Tools/TestWebKitAPI/PlatformJSCOnly.cmake b/Tools/TestWebKitAPI/PlatformJSCOnly.cmake +--- a/Tools/TestWebKitAPI/PlatformJSCOnly.cmake ++++ b/Tools/TestWebKitAPI/PlatformJSCOnly.cmake +@@ -10,3 +10,11 @@ + GLib::Gio + ) + endif () ++ ++get_directory_property(TestJavaScriptCore_AOT_PROGRAM_SOURCES ++ DIRECTORY "${JAVASCRIPTCORE_DIR}" DEFINITION JavaScriptCore_AOT_PROGRAM_SOURCES) ++list(TRANSFORM TestJavaScriptCore_AOT_PROGRAM_SOURCES PREPEND "${JAVASCRIPTCORE_DIR}/") ++list(APPEND TestJavaScriptCore_SOURCES ${TestJavaScriptCore_AOT_PROGRAM_SOURCES}) ++if (ENABLE_STATIC_JSC) ++ list(APPEND TestJavaScriptCore_SOURCES $) ++endif () diff --git a/.github/openclaw/qualification/upstream-async/qualify.py b/.github/openclaw/qualification/upstream-async/qualify.py new file mode 100644 index 0000000000000..d8dd0758d9a6a --- /dev/null +++ b/.github/openclaw/qualification/upstream-async/qualify.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python3 +"""Paired async-frame proof with the same measured API build adapter.""" +import hashlib +import json +import os +from pathlib import Path +import re +import signal +import subprocess +import time +from xml.etree import ElementTree + +INPUTS = Path(__file__).resolve().parent +SOURCE = Path('upstream').resolve() +BUILD = Path(os.environ['RUNNER_TEMP']) / 'upstream-async-build' +OUT = Path(os.environ['RUNNER_TEMP']) / 'upstream-async-proof' +OUT.mkdir(exist_ok=True) +SPEC = json.loads((INPUTS / 'source-adapter.json').read_text()) +BASE = 'e66916298091dd12469076fd854e135b03fb16ff' +HEAD = '540ee746090a24a8d9df95cba19fd489307fb06b' +ADAPTER = '31b03fa17b3a9133d5240d593fa464b5825a2e33' +FIXTURE = 'Tools/TestWebKitAPI/Tests/JavaScriptCore/AsyncStackTrace.cpp' +REGISTRATION = 'Tools/TestWebKitAPI/CMakeLists.txt' +CASE = 'SuspendedFrameUsesResumeInstruction' +RECORD = {'pipeline': os.environ['PIPELINE_SHA'], 'base': BASE, 'head': HEAD, + 'shared_build_adapter': ADAPTER, 'passed': False, 'steps': {}, 'arms': {}} +DEADLINE = time.monotonic() + 9000 + + +def sha(path): + with path.open('rb') as stream: + return hashlib.file_digest(stream, 'sha256').hexdigest() + + +def save(): + (OUT / 'proof.json').write_text(json.dumps(RECORD, indent=2) + '\n') + + +def run(name, argv, seconds=120, expected=0): + record = {'command': argv, 'returncode': None, 'timed_out': False} + RECORD['steps'][name] = record + save() + with (OUT / (name + '.log')).open('x') as log: + process = subprocess.Popen(argv, cwd=SOURCE, stdout=log, stderr=subprocess.STDOUT, + stdin=subprocess.DEVNULL, start_new_session=True) + try: + process.wait(timeout=min(seconds, max(0, DEADLINE - time.monotonic()))) + except subprocess.TimeoutExpired: + record['timed_out'] = True + raise + finally: + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + record['returncode'] = process.returncode + save() + assert process.returncode == expected and not record['timed_out'], name + + +def git(*args): + return subprocess.check_output(['git', *args], cwd=SOURCE, timeout=120).decode().strip() + + +def identity(path, expected): + data = path.read_bytes() + assert hashlib.sha256(data).hexdigest() == expected['sha256'], str(path) + assert hashlib.sha1(b'blob ' + str(len(data)).encode() + b'\0' + data).hexdigest() == expected['blob'] + + +def state(pin, adapted): + assert git('rev-parse', 'HEAD') == pin + assert git('write-tree') == git('rev-parse', 'HEAD^{tree}'), 'index drift' + expected = set(SPEC['files']) if adapted else set() + if pin == BASE and adapted: + expected.add(REGISTRATION) + assert set(git('diff', '--name-only', 'HEAD').splitlines()) == expected + for name, entry in SPEC['files'].items(): + identity(SOURCE / name, entry['after' if adapted else 'before']) + assert git('ls-files', '-s', '--', name).split()[0] == entry['mode'] + identity(SOURCE / SPEC['production']['path'], SPEC['production']['before' if pin == BASE else 'after']) + assert set(git('ls-files', '--others', '--exclude-standard').splitlines()) == ({FIXTURE} if pin == BASE and adapted else set()) + identity(SOURCE / REGISTRATION, SPEC['registration']['after' if pin == HEAD or adapted else 'before']) + if pin == HEAD: + identity(SOURCE / SPEC['stress_fixture']['path'], SPEC['stress_fixture']) + else: + assert not (SOURCE / SPEC['stress_fixture']['path']).exists() + if pin == HEAD or adapted: + identity(SOURCE / FIXTURE, SPEC['fixture']) + else: + assert not (SOURCE / FIXTURE).exists() + + +def admit(path, red): + assert path.stat().st_size <= 16 * 1024**2 + cases = list(ElementTree.parse(path).iter('testcase')) + assert len(cases) == 1 + case = cases[0] + assert (case.get('classname'), case.get('name')) == ('JavaScriptCore_AsyncStackTrace', CASE) + assert case.get('status') == 'run' and case.get('result') == 'completed' + assert case.find('error') is None and case.find('skipped') is None + failures = case.findall('failure') + if not red: + assert not failures + return + assert len(failures) == 1 + failure = failures[0] + message = failure.get('message', '') + match = re.search(r'Expected equality of these values:\s+frame\.bytecodeIndex\(\)\.offset\(\)\s+Which is: (\d+)\s+resumeOffset\s+Which is: (\d+)\s+switch offset: (\d+), relative target: (\d+)', message) + assert match is not None, message + actual, expected, switch, relative = map(int, match.groups()) + assert switch > 0 and relative > 0 and actual == relative and expected == switch + relative + text = message + '\n' + ''.join(failure.itertext()) + assert re.search(r'AsyncStackTrace\.cpp:' + str(SPEC['expected_failure_line']) + r'\b', text), text + + +def stress(binary): + fixture = SPEC['stress_fixture'] + identity(SOURCE / fixture['path'], fixture) + before = sha(binary) + results = Path(os.environ['RUNNER_TEMP']) / 'upstream-async-stress-results' + prefix = 'stress/error-stack-async-relative-resume-target.js.' + try: + run('head-jsc-stress', ['Tools/Scripts/run-jsc-stress-tests', 'JSTests/stress', + '--jsc', str(binary), '--filter', '^' + re.escape(prefix), + '--report-execution-time', '--no-retry', '--child-processes', '1', + '--output-dir', str(results)], seconds=600) + finally: + saved = {} + for name in ['results', 'passed', 'failed', 'noresult', 'flaky']: + path = results / name + assert not path.is_symlink() + if path.exists(): + assert path.is_file() and path.stat().st_size <= 1024**2 + saved[name] = path.read_text(encoding='ascii').splitlines() + else: + saved[name] = None + (OUT / 'stress-results.json').write_text(json.dumps(saved, indent=2) + '\n') + rows = saved['results'] + assert rows and saved['passed'] + names = [] + for row in rows: + match = re.fullmatch(r'(.+): PASS', row) + assert match and match[1].startswith(prefix), row + names.append(match[1]) + assert len(names) == len(set(names)) and len(saved['passed']) == len(set(saved['passed'])) + assert set(saved['passed']) == set(names) + assert all(not saved[name] for name in ['failed', 'noresult', 'flaky']) + log = (OUT / 'head-jsc-stress.log').read_text() + timings = re.findall(r'^PASS: ([^\r\n]+) ([0-9]+)ms$', log, re.MULTILINE) + assert len(timings) == len(names) and len({name for name, _ in timings}) == len(names) + assert {name for name, _ in timings} == set(names) + assert all(0 <= int(ms) < 200 for _, ms in timings), timings + assert sha(binary) == before + identity(SOURCE / fixture['path'], fixture) + RECORD['stress'] = {'source': HEAD, 'fixture_sha256': fixture['sha256'], + 'binary_sha256': before, + 'cases': [{'name': name, 'milliseconds': int(ms)} for name, ms in timings]} + save() + + +assert (SPEC['base'], SPEC['head'], SPEC['build_adapter']) == (BASE, HEAD, ADAPTER) +assert sha(INPUTS / 'build-adapter.patch') == SPEC['build_patch_sha256'] +identity(INPUTS / 'AsyncStackTrace.cpp', SPEC['fixture']) +RECORD.update(source_adapter_sha256=sha(INPUTS / 'source-adapter.json'), + build_patch_sha256=SPEC['build_patch_sha256'], fixture_sha256=SPEC['fixture']['sha256']) +state(BASE, False) +run('fetch-head', ['git', '-c', 'gc.auto=0', '-c', 'maintenance.auto=false', 'fetch', '--no-tags', + '--no-prune', '--no-auto-maintenance', 'origin', HEAD]) +assert set(git('diff', '--name-only', BASE, HEAD).splitlines()) == { + SPEC['production']['path'], REGISTRATION, FIXTURE, + 'JSTests/stress/error-stack-async-relative-resume-target.js'} +baseline_binary = None +for arm, pin in [('base', BASE), ('head', HEAD)]: + if arm == 'head': + run('checkout-head', ['git', 'checkout', '--detach', HEAD]) + state(pin, False) + run(arm + '-adapter-check', ['git', 'apply', '--check', str(INPUTS / 'build-adapter.patch')]) + run(arm + '-adapter', ['git', 'apply', str(INPUTS / 'build-adapter.patch')]) + if arm == 'base': + (SOURCE / FIXTURE).write_bytes((INPUTS / 'AsyncStackTrace.cpp').read_bytes()) + registration = SOURCE / REGISTRATION + text = registration.read_text() + marker = ' set(TestJavaScriptCore_LIBRARIES\n' + assert text.count(marker) == 1 + registration.write_text(text.replace(marker, SPEC['static_registration'] + marker)) + state(pin, True) + adapted_inputs = {name: sha(SOURCE / name) for name in [*SPEC['files'], FIXTURE, REGISTRATION]} + if arm == 'base': + paired_inputs = adapted_inputs + else: + assert paired_inputs == adapted_inputs, 'paired build/test overlays differ' + run(arm + '-configure', ['cmake', '-S', str(SOURCE), '-B', str(BUILD), *SPEC['configure']], 600) + run(arm + '-build', ['cmake', '--build', str(BUILD), '--target', 'TestJavaScriptCore', '-j4'], 4500 if arm == 'base' else 1200) + binary = BUILD / 'bin/TestWebKitAPI/TestJavaScriptCore' + before = sha(binary) + xml = OUT / (arm + '-async-frame.xml') + run(arm + '-async-frame', ['env', 'JSC_useAsyncStackTrace=true', str(binary), + '--gtest_filter=JavaScriptCore_AsyncStackTrace.' + CASE, + '--gtest_output=xml:' + str(xml)], expected=1 if arm == 'base' else 0) + admit(xml, red=arm == 'base') + assert sha(binary) == before + state(pin, True) + if arm == 'head': + run('head-build-jsc', ['cmake', '--build', str(BUILD), '--target', 'jsc', '-j4'], 1200) + stress(BUILD / 'bin/jsc') + state(pin, True) + RECORD['arms'][arm] = {'source': pin, 'binary_sha256': before, 'case': CASE, + 'cmake_cache_sha256': sha(BUILD / 'CMakeCache.txt'), 'adapted_inputs': adapted_inputs} + run(arm + '-restore', ['git', 'restore', '--source=' + pin, '--worktree', '--', *SPEC['files'], REGISTRATION]) + if arm == 'base': + (SOURCE / FIXTURE).unlink() + baseline_binary = before + state(pin, False) + save() +assert RECORD['arms']['head']['binary_sha256'] != baseline_binary +RECORD.update(passed=True, qualification='959 runtime proof with shared 963 build adapter') +save() diff --git a/.github/openclaw/qualification/upstream-async/source-adapter.json b/.github/openclaw/qualification/upstream-async/source-adapter.json new file mode 100644 index 0000000000000..a97ffe9a90e8a --- /dev/null +++ b/.github/openclaw/qualification/upstream-async/source-adapter.json @@ -0,0 +1,92 @@ +{ + "base": "e66916298091dd12469076fd854e135b03fb16ff", + "head": "540ee746090a24a8d9df95cba19fd489307fb06b", + "build_adapter": "31b03fa17b3a9133d5240d593fa464b5825a2e33", + "build_patch_sha256": "133ca9e02fb4a4468b2b67e5b394de10189b2f9e80373f94c4be800e9d0127e9", + "files": { + "Source/JavaScriptCore/CMakeLists.txt": { + "before": { + "sha256": "d078629c3f9d836547bac77b825bebc628737e98cfe0950265803a9e2984da43", + "blob": "e494e54647762bb924fd59e86a4c3394202264fe" + }, + "after": { + "sha256": "e056db85d8191e4acb378a3ac8c9b64419a3ccffdf73cd61adbb2ea3d63fe610", + "blob": "f006de8331a8004df768646789420d4d202fb5db" + }, + "mode": "100644" + }, + "Source/JavaScriptCore/shell/CMakeLists.txt": { + "before": { + "sha256": "304742d8d2bc099f63a9b3e3d402da8d372fbe20ddce76343100a288eae48e2d", + "blob": "c98c2f57bc0309b792ad448855c1596940ed2137" + }, + "after": { + "sha256": "c0dfcefdbd4a8df56c833e067193a7cd4363dbeb8ffd6854e8ac1a54dd13319a", + "blob": "5f37e68d2b0b384cbcfba64dec0f574790c6d6fb" + }, + "mode": "100644" + }, + "Tools/TestWebKitAPI/PlatformJSCOnly.cmake": { + "before": { + "sha256": "5162644e9b92741f37bab0d40ed0ea2b5e3a97af22e335a010f476f391300f53", + "blob": "4abc96e1832cd3688f025695df63e98522702ea0" + }, + "after": { + "sha256": "f795559d56d68425415a10c749340d513df89ce437707cce61ccdaec19109ad0", + "blob": "ba2beda1bd013116456226d6c09f0f7b34c4cd4d" + }, + "mode": "100644" + } + }, + "fixture": { + "sha256": "fdd809f40f171b69a6db64c4486feedb06834ee7f17145d68031d9579d93fe33", + "blob": "40343fdd9de395f88ea8fc6e129da84d115fa5bf" + }, + "registration": { + "before": { + "sha256": "1e35901914c0bb859aba14f2294e9a027c07afd62047b6f9e4199f322bd32efc", + "blob": "01ea15a0d6d806c0d28d15d4c1c32e1bfceae9cd" + }, + "after": { + "sha256": "c9583ccb34bf7fba52940da50764711e89d53debd985e1767eabb69331bfc840", + "blob": "dcda0812cb045667292ad40deb0046b5ea13a8b3" + } + }, + "configure": [ + "-G", + "Ninja", + "-DPORT=JSCOnly", + "-DCMAKE_BUILD_TYPE=Release", + "-DDEVELOPER_MODE=ON", + "-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF", + "-DENABLE_STATIC_JSC=ON", + "-DUSE_BUN_JSC_ADDITIONS=ON", + "-DUSE_BUN_EVENT_LOOP=ON", + "-DUSE_MIMALLOC=ON", + "-DUSE_EXTERNAL_MIMALLOC=OFF", + "-DENABLE_FTL_JIT=ON", + "-DENABLE_BUN_SKIP_FAILING_ASSERTIONS=ON", + "-DALLOW_LINE_AND_COLUMN_NUMBER_IN_BUILTINS=ON", + "-DENABLE_REMOTE_INSPECTOR=ON", + "-DCMAKE_C_COMPILER=clang-23", + "-DCMAKE_CXX_COMPILER=clang++-23" + ], + "expected_failure_line": 120, + "static_registration": " if (ENABLE_STATIC_JSC)\n list(APPEND TestJavaScriptCore_SOURCES Tests/JavaScriptCore/AsyncStackTrace.cpp)\n endif ()\n\n", + "production": { + "path": "Source/JavaScriptCore/interpreter/Interpreter.cpp", + "before": { + "sha256": "5b6c4114ee3b39fff20ea15e544858788612e947681071946001e600ab30acd5", + "blob": "294d69065ceea6f7cb04c26812e380ffc76dfb27" + }, + "after": { + "sha256": "8a31a54e6bf6d543d002a6c6688381783f502f559343125481b2568a10b4c55b", + "blob": "b71ffd70b8420c2593bc0c1f8ff63892327cbd29" + } + }, + "stress_fixture": { + "path": "JSTests/stress/error-stack-async-relative-resume-target.js", + "sha256": "014ebbeecbd94287c126a356c18ded2a44b667c338a452927d78b3e658dd9235", + "blob": "18f52dd37073b9fd9facd9ab86145126efb35120" + } +} diff --git a/.github/workflows/openclaw-upstream-async.yml b/.github/workflows/openclaw-upstream-async.yml new file mode 100644 index 0000000000000..25938d14c673a --- /dev/null +++ b/.github/workflows/openclaw-upstream-async.yml @@ -0,0 +1,79 @@ +name: OpenClaw upstream async frame proof +on: + pull_request: + branches: [claude/sync-webkit-upstream-20261014] + paths: + - .github/workflows/openclaw-upstream-async.yml + - .github/openclaw/qualification/upstream-async/** + workflow_dispatch: +permissions: + contents: read +concurrency: + group: openclaw-upstream-async-${{ github.ref }} + cancel-in-progress: true +jobs: + native-async-frame: + if: >- + github.repository == 'openclaw/WebKit' && + (github.event.pull_request.head.ref || github.ref_name) == 'claude/upstream-async-proof-20261031' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + runs-on: ubuntu-24.04-arm + timeout-minutes: 180 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + path: controls + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + sparse-checkout: .github/openclaw/qualification/upstream-async + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + ref: e66916298091dd12469076fd854e135b03fb16ff + path: upstream + persist-credentials: false + sparse-checkout-cone-mode: false + sparse-checkout: | + /* + !/LayoutTests/ + !/JSTests/* + /JSTests/stress/ + !/JSTests/stress/* + /JSTests/stress/error-stack-async-relative-resume-target.js + !/PerformanceTests/ + !/Websites/ + !/ManualTests/ + !/WebDriverTests/ + - name: Install the existing native ARM64 toolchain + run: | + test "$(uname -m)" = aarch64 + curl -fsSL --retry 5 https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null + echo 'deb https://apt.llvm.org/noble/ llvm-toolchain-noble-23 main' | sudo tee /etc/apt/sources.list.d/llvm.list + sudo apt-get update -qq + sudo apt-get install -y --no-install-recommends cmake ninja-build clang-23 lld-23 libicu-dev ruby ruby-highline libjson-pp-perl + - name: Prove the suspended-frame offset failure and the exact async fix + env: + PIPELINE_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: python3 controls/.github/openclaw/qualification/upstream-async/qualify.py + - name: Bound and record the evidence + id: evidence + if: always() + run: | + python3 - <<'PY' + import hashlib, json, os, stat + from pathlib import Path + out = Path(os.environ['RUNNER_TEMP']) / 'upstream-async-proof' + out.mkdir(exist_ok=True) + files = sorted(out.iterdir()) + assert len(files) <= 32 and all(stat.S_ISREG(p.lstat().st_mode) for p in files) + assert sum(p.stat().st_size for p in files) <= 64 * 1024**2 + def sha(path): + with path.open('rb') as stream: return hashlib.file_digest(stream, 'sha256').hexdigest() + (out / 'archive-manifest.json').write_text(json.dumps({p.name: {'bytes': p.stat().st_size, 'sha256': sha(p)} for p in files}, indent=2) + '\n') + PY + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a + if: always() && steps.evidence.outcome == 'success' + with: + name: upstream-async-frame-proof + path: ${{ runner.temp }}/upstream-async-proof/ + if-no-files-found: error + retention-days: 7