Repository navigation
תיקון issue #5947 — קיצור חלונית המפרשים פותח וסוגר את החלונית כולה #640
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Performance probe tools | |
| on: | |
| pull_request: | |
| paths: | |
| - 'tool/perf_probe/**' | |
| - 'lib/core/diagnostics/**' | |
| - 'lib/plugins/services/plugin_webview_diagnostics.dart' | |
| - 'lib/plugins/services/webview_backend_observation.dart' | |
| - 'lib/plugins/view/plugin_webview_host.dart' | |
| - 'pubspec.yaml' | |
| - 'pubspec.lock' | |
| - 'test/core/diagnostics/**' | |
| - 'test/plugins/services/plugin_webview_diagnostics_test.dart' | |
| - 'test/plugins/services/webview_backend_observation_test.dart' | |
| - 'test/tool/perf_probe/webview_probe_metrics_test.dart' | |
| - 'test/tool/perf_probe/pdf_reader_probe*' | |
| - 'test/tool/perf_probe/pdf_reader_case_test.dart' | |
| - 'test/tool/perf_probe/pdf_case_fixture_test.dart' | |
| - 'test/tool/perf_probe/pdf_book_reader_probe*' | |
| - 'test/tool/perf_probe/perf_fixture_test.dart' | |
| - 'test/tool/perf_probe/report_test.dart' | |
| - 'test/tool/perf_probe/pdf_image_budget_test.dart' | |
| - 'test/tool/perf_probe/perf_recorder_test.dart' | |
| - 'test/tool/perf_probe/probe_binding_test.dart' | |
| - 'test/tool/perf_probe/probe_engine_test.dart' | |
| - 'test/tool/perf_probe/pdf_multi_window_test.dart' | |
| - 'integration_test/support/perf_pdf_multi_window.dart' | |
| - 'lib/core/windowing/**' | |
| - 'integration_test/support/webview_probe_fixture.dart' | |
| - 'integration_test/support/webview_probe_metrics.dart' | |
| - 'integration_test/support/webview_probe_window.dart' | |
| - 'integration_test/support/perf_recorder.dart' | |
| - 'integration_test/support/perf_resource_workload.dart' | |
| - 'integration_test/support/perf_framework_scheduler.dart' | |
| - 'integration_test/support/perf_fixture.dart' | |
| - 'integration_test/support/perf_pdf_reader.dart' | |
| - 'integration_test/support/perf_pdf_book_reader.dart' | |
| - 'integration_test/support/perf_probe_wait.dart' | |
| - 'lib/pdf_book/models/pdf_book_render_observation.dart' | |
| - 'lib/pdf_book/view/pdf_book_screen.dart' | |
| - 'integration_test/support/perf_pdf_image_budget.dart' | |
| - 'integration_test/perf_resource_probe_test.dart' | |
| - 'integration_test/webview_resource_probe_test.dart' | |
| - 'test_driver/webview_resource_probe.dart' | |
| - '.github/workflows/perf_probe.yml' | |
| workflow_dispatch: | |
| inputs: | |
| mode: | |
| description: Build mode (results are never compared across modes) | |
| type: choice | |
| options: [profile, release, debug] | |
| default: profile | |
| cache_state: | |
| description: Application data state (OS caches are not cleared) | |
| type: choice | |
| options: [cold, warm] | |
| default: cold | |
| launches: | |
| description: Measured process launches | |
| type: number | |
| default: 3 | |
| repetitions: | |
| description: Measured repetitions per action and launch | |
| type: number | |
| default: 5 | |
| scenario_set: | |
| description: Actions after startup (multi-window uses a fixed cold 10-page smoke) | |
| type: choice | |
| options: [all, pdf-reader, pdf-book-view, pdf-multi-window] | |
| default: all | |
| binding_mode: | |
| description: Scheduler identity (framework accepts PDF scenarios only) | |
| type: choice | |
| options: [integration, framework] | |
| default: integration | |
| pdf_page_count: | |
| description: Generated PDF size (real PDF inputs stay local) | |
| type: choice | |
| options: ['10', '100', '600', '1000', '10000'] | |
| default: '600' | |
| permissions: | |
| contents: read | |
| # A new push to a PR supersedes its previous run; a manual measurement is never cancelled. | |
| concurrency: | |
| group: perf-probe-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| gate: | |
| uses: ./.github/workflows/ci_gate.yml | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| contracts: | |
| name: Sampler contracts (no performance thresholds) | |
| needs: gate | |
| if: needs.gate.outputs.run == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - name: Validate process identity and invariant CSV formatting | |
| shell: pwsh | |
| run: ./tool/perf_probe/test_sample_resources.ps1 | |
| - name: Validate binding identity and native scheduling evidence | |
| shell: pwsh | |
| run: ./tool/perf_probe/test_probe_binding.ps1 | |
| - name: Validate the bundled Windows engine and patch identity | |
| shell: pwsh | |
| run: ./tool/perf_probe/test_probe_engine.ps1 | |
| - name: Validate backend correlation and comparison readiness | |
| shell: pwsh | |
| run: ./tool/perf_probe/test_webview_hosting_probe.ps1 | |
| - name: Validate WebView fixture state and bounded observers | |
| run: node --test tool/perf_probe/test_webview_probe_fixture.mjs | |
| - name: Validate POSIX process ownership, native units and PDF smoke evidence | |
| run: python3 -B -m unittest tool.perf_probe.test_perf_probe_posix -v | |
| webview: | |
| name: Live WebView2 resource scenario (profile) | |
| needs: gate | |
| if: needs.gate.outputs.run == 'true' | |
| runs-on: windows-2025 | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: ./.github/actions/setup-flutter | |
| with: | |
| flutter-version: 3.47.9 | |
| - name: Resolve pinned dependencies | |
| shell: pwsh | |
| run: | | |
| git config --global core.longpaths true | |
| flutter pub get --enforce-lockfile | |
| - name: Validate process coverage with the real Windows host sampler | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path '${{ runner.temp }}/webview-probe' | Out-Null | |
| flutter test --no-pub --reporter expanded ` | |
| test/core/diagnostics/process_tree_sampler_test.dart ` | |
| test/core/diagnostics/process_tree_coverage_test.dart ` | |
| test/core/diagnostics/frame_stats_overlay_test.dart ` | |
| test/plugins/services/plugin_webview_diagnostics_test.dart ` | |
| test/plugins/services/webview_backend_observation_test.dart ` | |
| test/tool/perf_probe/webview_probe_metrics_test.dart ` | |
| test/tool/perf_probe/pdf_image_budget_test.dart ` | |
| test/tool/perf_probe/perf_recorder_test.dart ` | |
| test/tool/perf_probe/probe_binding_test.dart ` | |
| test/tool/perf_probe/probe_engine_test.dart ` | |
| test/tool/perf_probe/pdf_multi_window_test.dart ` | |
| 2>&1 | Tee-Object -FilePath '${{ runner.temp }}/webview-probe/process-coverage-tests.log' | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Run the native scenario without performance thresholds | |
| shell: pwsh | |
| env: | |
| WEBVIEW_PROBE_REPORTS: ${{ runner.temp }}/webview-probe/host | |
| WEBVIEW_PROBE_DEVICE_OUTPUT: ${{ runner.temp }}/webview-probe/device | |
| FLUTTER_INAPPWEBVIEW_WINDOWS_FORCE_HWND: '0' | |
| run: | | |
| New-Item -ItemType Directory -Force -Path '${{ runner.temp }}/webview-probe' | Out-Null | |
| flutter drive --profile -d windows --no-pub ` | |
| --driver=test_driver/webview_resource_probe.dart ` | |
| --target=integration_test/webview_resource_probe_test.dart ` | |
| --dart-define=WEBVIEW_PROBE_FLUTTER_VERSION=3.47.9 ` | |
| --dart-define=WEBVIEW_PROBE_COMMIT=${{ github.sha }} ` | |
| --dart-define=WEBVIEW_PROBE_IDLE_MS=1000 ` | |
| 2>&1 | Tee-Object -FilePath '${{ runner.temp }}/webview-probe/run.log' | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Run forced HWND in a fresh native process | |
| if: ${{ !cancelled() }} | |
| shell: pwsh | |
| env: | |
| WEBVIEW_PROBE_REPORTS: ${{ runner.temp }}/webview-probe/host-hwnd | |
| WEBVIEW_PROBE_DEVICE_OUTPUT: ${{ runner.temp }}/webview-probe/device-hwnd | |
| FLUTTER_INAPPWEBVIEW_WINDOWS_FORCE_HWND: '1' | |
| run: | | |
| flutter drive --profile -d windows --no-pub ` | |
| --driver=test_driver/webview_resource_probe.dart ` | |
| --target=integration_test/webview_resource_probe_test.dart ` | |
| --dart-define=WEBVIEW_PROBE_FLUTTER_VERSION=3.47.9 ` | |
| --dart-define=WEBVIEW_PROBE_COMMIT=${{ github.sha }} ` | |
| --dart-define=WEBVIEW_PROBE_IDLE_MS=1000 ` | |
| 2>&1 | Tee-Object -FilePath '${{ runner.temp }}/webview-probe/run-hwnd.log' | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Preserve native observations and partial failures | |
| if: always() | |
| uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: webview-resource-probe-windows-profile | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| path: | | |
| ${{ runner.temp }}/webview-probe/run.log | |
| ${{ runner.temp }}/webview-probe/run-hwnd.log | |
| ${{ runner.temp }}/webview-probe/process-coverage-tests.log | |
| ${{ runner.temp }}/webview-probe/host/**/*.json | |
| ${{ runner.temp }}/webview-probe/device/**/phases.jsonl | |
| ${{ runner.temp }}/webview-probe/device/**/report.json | |
| ${{ runner.temp }}/webview-probe/host-hwnd/**/*.json | |
| ${{ runner.temp }}/webview-probe/device-hwnd/**/phases.jsonl | |
| ${{ runner.temp }}/webview-probe/device-hwnd/**/report.json | |
| desktop: | |
| name: Windows app measurements (${{ matrix.scenario }}, ${{ matrix.binding_mode }}, ${{ matrix.mode || inputs.mode || 'profile' }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| scenario: ${{ fromJSON(github.event_name == 'pull_request' && '["pdf-reader","pdf-book-view"]' || format('["{0}"]', inputs.scenario_set || 'all')) }} | |
| binding_mode: ${{ fromJSON(github.event_name == 'pull_request' && '["framework"]' || format('["{0}"]', inputs.binding_mode || 'integration')) }} | |
| include: ${{ fromJSON(github.event_name == 'pull_request' && '[{"scenario":"pdf-multi-window","binding_mode":"framework","mode":"profile"},{"scenario":"pdf-multi-window","binding_mode":"framework","mode":"release"}]' || '[]') }} | |
| needs: gate | |
| if: needs.gate.outputs.run == 'true' | |
| runs-on: windows-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: ./.github/actions/setup-flutter | |
| with: | |
| flutter-version: 3.47.9 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Resolve pinned dependencies | |
| shell: pwsh | |
| run: | | |
| git config --global core.longpaths true | |
| flutter pub get --enforce-lockfile | |
| - name: Install the existing patched release engine | |
| if: matrix.scenario == 'pdf-multi-window' && (matrix.mode || inputs.mode || 'profile') == 'release' | |
| uses: ./.github/actions/patched-flutter-engine | |
| with: | |
| arch: x64 | |
| - name: Run isolated measurements | |
| shell: pwsh | |
| env: | |
| PROBE_MODE: ${{ matrix.mode || inputs.mode || 'profile' }} | |
| PROBE_CACHE: ${{ matrix.scenario == 'pdf-multi-window' && 'cold' || inputs.cache_state || 'cold' }} | |
| PROBE_LAUNCHES: ${{ matrix.scenario == 'pdf-multi-window' && 1 || inputs.launches || 1 }} | |
| PROBE_REPETITIONS: ${{ matrix.scenario == 'pdf-multi-window' && 1 || inputs.repetitions || 1 }} | |
| PROBE_SCENARIOS: ${{ matrix.scenario }} | |
| PROBE_BINDING: ${{ matrix.binding_mode }} | |
| PROBE_WARMUP: ${{ matrix.scenario != 'pdf-multi-window' && github.event_name == 'workflow_dispatch' && 1 || 0 }} | |
| PROBE_PDF_PAGES: ${{ matrix.scenario == 'pdf-multi-window' && '10' || inputs.pdf_page_count || '600' }} | |
| run: | | |
| if ($env:PROBE_SCENARIOS -eq 'pdf-multi-window' -and ($env:PROBE_BINDING -ne 'framework' -or $env:PROBE_MODE -notin @('profile', 'release'))) { | |
| throw 'Native multi-window smoke requires framework binding and profile or release mode.' | |
| } | |
| $expectedEngine = '' | |
| if ($env:PROBE_SCENARIOS -eq 'pdf-multi-window' -and $env:PROBE_MODE -eq 'release') { | |
| if ($env:PATCHED_FLUTTER_DLL_SHA256 -notmatch '^[a-f0-9]{64}$') { throw 'The patched release action did not provide its verified DLL hash.' } | |
| $expectedEngine = $env:PATCHED_FLUTTER_DLL_SHA256 | |
| } | |
| $pdfCase = Join-Path $env:RUNNER_TEMP 'pdf-reader-case.json' | |
| @{ | |
| schemaVersion = 1 | |
| source = @{ kind = 'generated'; pageCount = [int]$env:PROBE_PDF_PAGES; mixedPageSizes = $true } | |
| } | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath $pdfCase -Encoding utf8 | |
| ./tool/perf_probe/run_perf_probe.ps1 -Mode $env:PROBE_MODE ` | |
| -CacheState $env:PROBE_CACHE -Launches ([int]$env:PROBE_LAUNCHES) ` | |
| -Repetitions ([int]$env:PROBE_REPETITIONS) ` | |
| -ScenarioSet $env:PROBE_SCENARIOS -BindingMode $env:PROBE_BINDING -Warmup ([int]$env:PROBE_WARMUP) ` | |
| -PdfCase $pdfCase -ExpectedEngineSha256 $expectedEngine ` | |
| -OutputDirectory (Join-Path $env:RUNNER_TEMP 'perf-results') ` | |
| -HardwareId "github-hosted-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT" | |
| - name: Require PDF budget and post-close observations from the actual app | |
| if: matrix.scenario != 'pdf-multi-window' | |
| shell: pwsh | |
| env: | |
| PROBE_SCENARIOS: ${{ matrix.scenario }} | |
| PROBE_BINDING: ${{ matrix.binding_mode }} | |
| run: | | |
| Set-StrictMode -Version Latest | |
| $ErrorActionPreference = 'Stop' | |
| $report = Get-Content -LiteralPath (Join-Path $env:RUNNER_TEMP 'perf-results/report.json') -Raw | ConvertFrom-Json | |
| if ($report.successful -ne $true) { throw 'The app measurement run did not pass.' } | |
| if ($report.metadata.settings.resourceObservationVersion -ne 1) { throw 'PDF resource observation version is missing.' } | |
| Import-Module ./tool/perf_probe/probe_binding.psm1 -Force | |
| Assert-PerfBindingIdentity $report.metadata.settings $env:PROBE_BINDING | |
| if ($report.metadata.bindingMode -ne $env:PROBE_BINDING) { throw 'The app ran under the wrong binding.' } | |
| if ($env:PROBE_BINDING -eq 'framework') { | |
| Assert-PerfFrameworkScheduler $report.notes $report.metadata.launchCount | |
| } | |
| if ($report.metadata.settings.scenarioSet -ne $env:PROBE_SCENARIOS) { throw 'The app ran the wrong PDF scenario set.' } | |
| $prefixes = switch ($env:PROBE_SCENARIOS) { | |
| 'pdf-reader' { @('pdf.reader') } | |
| 'pdf-book-view' { @('pdf.book_view') } | |
| 'all' { @('pdf.reader', 'pdf.book_view') } | |
| default { throw 'Unknown PDF scenario set.' } | |
| } | |
| foreach ($prefix in $prefixes) { | |
| $names = @("$prefix.open", "$prefix.close", "$prefix.idle_after_close") | |
| if ($prefix -eq 'pdf.book_view') { | |
| $names += @('pdf.book_view.thumbnails_first_image', 'pdf.book_view.jump_forward', 'pdf.book_view.jump_backward', 'pdf.book_view.prepare_reversals', 'pdf.book_view.rapid_reversals') | |
| } | |
| foreach ($name in $names) { | |
| $rows = @($report.scenarios | Where-Object name -eq $name) | |
| if ($rows.Count -ne 1 -or $rows[0].status -ne 'passed' -or $rows[0].measured -lt 1) { throw "Missing measured phase: $name" } | |
| foreach ($point in @('before', 'after')) { | |
| if ($rows[0].imageBudget.$point.complete -ne $true) { throw "Incomplete PDF budget coverage: $name / $point" } | |
| } | |
| } | |
| $idle = $report.scenarios | Where-Object name -eq "$prefix.idle_after_close" | |
| if ($idle.measurementKind -ne 'resource-observation' -or $idle.observationWindowMs -ne 3000 -or $null -ne $idle.latencyMs) { throw "PDF post-close window was not a fixed resource observation: $prefix" } | |
| } | |
| - name: Require actual native PDF windows and verified release engine | |
| if: matrix.scenario == 'pdf-multi-window' | |
| shell: pwsh | |
| env: | |
| PROBE_MODE: ${{ matrix.mode || inputs.mode || 'profile' }} | |
| run: | | |
| $arguments = @('tool/perf_probe/validate_pdf_multi_window.dart', '--root', (Join-Path $env:RUNNER_TEMP 'perf-results'), '--commit', $env:GITHUB_SHA, '--platform', 'windows', '--mode', $env:PROBE_MODE) | |
| if ($env:PROBE_MODE -eq 'release') { | |
| $arguments += @('--expected-engine-sha256', $env:PATCHED_FLUTTER_DLL_SHA256) | |
| } | |
| dart @arguments 2>&1 | Tee-Object -FilePath (Join-Path $env:RUNNER_TEMP 'perf-results/native-windows-verified.json') | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Upload observations, including partial failures | |
| if: always() | |
| uses: actions/upload-artifact@v7.0.2 | |
| with: | |
| name: perf-${{ matrix.mode || inputs.mode || 'profile' }}-${{ matrix.scenario == 'pdf-multi-window' && 'cold' || inputs.cache_state || 'cold' }}-${{ matrix.scenario }}-${{ matrix.binding_mode }} | |
| if-no-files-found: warn | |
| retention-days: 14 | |
| path: | | |
| ${{ runner.temp }}/perf-results/*.json | |
| ${{ runner.temp }}/perf-results/*.jsonl | |
| ${{ runner.temp }}/perf-results/*.csv | |
| ${{ runner.temp }}/perf-results/*.md | |
| ${{ runner.temp }}/perf-results/*.log | |
| ${{ runner.temp }}/perf-results/launch-*/*.json* | |
| ${{ runner.temp }}/perf-results/launch-*/*.log | |
| ${{ runner.temp }}/perf-results/launch-*/pdf-multi-window-*/*.json | |
| ${{ runner.temp }}/perf-results/launch-*/pdf-multi-window-*/*.pdf | |
| ${{ runner.temp }}/perf-results/launch-*/pdf-multi-window-*/*.png | |
| ${{ runner.temp }}/perf-results/prepare-*/*.json | |
| ${{ runner.temp }}/perf-results/prepare-*/*.log |