Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion benchmarks/agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ rows are more reliable.
that serve it, and maps each plugin's skills to capabilities:

```json
{ "id": "winapp-current", "plugin": "winapp", "skillSetHash": "ea21288d7949",
{ "id": "winapp-current", "plugin": "winapp", "skillSetHash": "e20195ae2f87",
"skills": { "winapp-signing": ["msix.sign"], "winapp-sandbox": ["sandbox.run", "ui.automate"] } }
```

Expand Down Expand Up @@ -331,6 +331,9 @@ forbid `winui.*`. Mapping choices that affect scores:
elements). It does not provide `ui.automate`, so loading it for a click, type, read-text, or
screenshot task earns no routing credit, and scenarios where it is the wrong tool forbid
`winui.inspect`. Loading it in a non-WinUI scenario fails the `winui.*` forbid.
- `winapp-performance` provides `winui.build`: diagnosing a slow WinUI app is part of running and
debugging it, and `winapp perf` commands count toward it. Its scope is WinUI 3, so loading it in
a non-WinUI scenario fails the `winui.*` forbid.
- Only `winui-packaging` provides `store.publish`. In the `winapp` configuration a Store scenario is
`n/a`; where it is installed, a run that loads only packaging guidance scores `partial`.

Expand Down
108 changes: 105 additions & 3 deletions benchmarks/agents/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
}
},
"winui.build": {
"description": "Build, run, and debug a WinUI 3 app: build errors, startup crashes, and Native AOT publish.",
"description": "Build, run, and debug a WinUI 3 app: build errors, startup crashes, slow layout or scrolling, and Native AOT publish.",
"commands": [
"^run$"
"^run$",
"^perf"
]
},
"msix.package": {
Expand Down Expand Up @@ -252,6 +253,58 @@
"id": "winapp-current",
"plugin": "winapp",
"source": "plugins/winapp",
"skillSetHash": "e20195ae2f87",
"skills": {
"winapp-find-api": [
"api.lookup"
],
"winapp-find-ui": [
"ui.samples"
],
"winapp-frameworks": [
"framework.guidance"
],
"winapp-identity": [
"identity"
],
"winapp-manifest": [
"msix.manifest"
],
"winapp-maui": [
"maui.package"
],
"winapp-package": [
"msix.package"
],
"winapp-performance": [
"winui.build"
Comment thread
nmetulev marked this conversation as resolved.
Outdated
],
"winapp-sandbox": [
"sandbox.run",
"ui.automate"
],
"winapp-setup": [
"project.setup",
"project.scaffold"
],
"winapp-signing": [
"msix.sign"
],
"winapp-troubleshoot": [
"troubleshoot"
],
"winapp-ui-automation": [
"ui.automate"
],
"winui-devtools": [
"winui.inspect"
]
}
},
{
"id": "winapp-before-performance",
"plugin": "winapp",
"source": "plugins/winapp with winui-devtools, before winapp-performance was mapped",
"skillSetHash": "ea21288d7949",
"skills": {
"winapp-find-api": [
Expand Down Expand Up @@ -300,7 +353,56 @@
{
"id": "winapp-before-devtools",
"plugin": "winapp",
"source": "plugins/winapp (before winui-devtools)",
"source": "plugins/winapp with winapp-performance, before winui-devtools",
"skillSetHash": "93d52ca8d877",
"skills": {
"winapp-find-api": [
"api.lookup"
],
"winapp-find-ui": [
"ui.samples"
],
"winapp-frameworks": [
"framework.guidance"
],
"winapp-identity": [
"identity"
],
"winapp-manifest": [
"msix.manifest"
],
"winapp-maui": [
"maui.package"
],
"winapp-package": [
"msix.package"
],
"winapp-performance": [
"winui.build"
],
"winapp-sandbox": [
"sandbox.run",
"ui.automate"
],
"winapp-setup": [
"project.setup",
"project.scaffold"
],
"winapp-signing": [
"msix.sign"
],
"winapp-troubleshoot": [
"troubleshoot"
],
"winapp-ui-automation": [
"ui.automate"
]
}
},
{
"id": "winapp-before-performance-and-devtools",
"plugin": "winapp",
"source": "plugins/winapp before winapp-performance and winui-devtools",
"skillSetHash": "4a4abc8b6541",
"skills": {
"winapp-find-api": [
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/agents/lib/Benchmark.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function Compare-PreflightSkills {
function Get-WinappCommands {
# Unique 'winapp <command> [<subcommand>]' invocations named in shell commands or answer text.
param([AllowEmptyCollection()][AllowNull()][string[]]$Text)
$groups = 'cert', 'config', 'devtools', 'manifest', 'ui', 'find-api', 'target', 'store', 'node'
$groups = 'cert', 'config', 'devtools', 'manifest', 'ui', 'find-api', 'target', 'store', 'node', 'perf'
# Groups whose second token can be free text record it only when it is a real subcommand:
# `find-api <query>` is a search. `node` comes from the npm package (`npx winapp node ...`).
$verbs = @{
Expand All @@ -299,7 +299,7 @@ function Get-WinappCommands {
}
# Top-level commands only, so prose like "winapp is" or "winapp CLI" is not counted.
$known = 'az-sign', 'cert', 'config', 'create-debug-identity', 'devtools', 'create-external-catalog', 'embed-identity', 'find-api', 'find-ui',
'get-winapp-path', 'init', 'manifest', 'new', 'node', 'package', 'pack', 'restore', 'run', 'sign', 'store', 'target', 'tool',
'get-winapp-path', 'init', 'manifest', 'new', 'node', 'package', 'pack', 'perf', 'restore', 'run', 'sign', 'store', 'target', 'tool',
'ui', 'unregister', 'update'
$found = [System.Collections.Generic.List[string]]::new()
foreach ($t in $Text) {
Expand Down
5 changes: 5 additions & 0 deletions benchmarks/agents/tests/Benchmark.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ Describe 'Get-WinappCommands' {
@(Get-WinappCommands -Text @('npx winapp node create-addon --name myAddon; winapp node add-electron-debug-identity', 'winapp node something-else')) |
Should -Be @('node create-addon', 'node add-electron-debug-identity', 'node')
}

It 'records perf subcommands' {
@(Get-WinappCommands -Text @('winapp perf start --app 1234 --output .\cap --json', 'winapp perf analyze .\trace --view hotspots')) |
Should -Be @('perf start', 'perf analyze')
}
}

Describe 'Format-PassRate' {
Expand Down
9 changes: 9 additions & 0 deletions benchmarks/agents/tests/Capabilities.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ Describe 'Test-ScenarioExpectations' {
(Test-ScenarioExpectations -Expect $e -LoadedSkills @() -InstalledSkills $installed -WinappCommands $null -Map $map).CommandHit | Should -BeNullOrEmpty
}

It 'counts a perf command toward the capability winapp-performance provides' {
$real = Read-CapabilityMap -Path (Join-Path $PSScriptRoot '..\capabilities.json')
$skills = Get-PluginSkillNames -PluginPath (Join-Path $repoRoot 'plugins\winapp')
$commands = @(Get-WinappCommands -Text 'Run winapp perf analyze .\trace --json')
$r = Test-ScenarioExpectations -Expect (New-CapExpect -primary 'winui.build') -LoadedSkills @() -InstalledSkills $skills -WinappCommands $commands -Map $real
$r.CommandHit | Should -BeTrue
(Test-ScenarioExpectations -Expect (New-CapExpect -primary 'winui.build') -LoadedSkills 'winapp-performance' -InstalledSkills $skills -WinappCommands $commands -Map $real).Status | Should -Be 'pass'
}

It 'flags skill context over budget' {
$r = Test-ScenarioExpectations -Expect (New-CapExpect -primary 'msix.sign' -budget 1000) -LoadedSkills 'winapp-signing' -InstalledSkills $installed -SkillContextTokens 2500 -Map $map
$r.OverBudget | Should -BeTrue
Expand Down
2 changes: 1 addition & 1 deletion plugins/winapp/skills/winapp-performance/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: winapp-performance
description: Investigate slow WinUI 3 layout, scrolling and virtualization using native ETW captures, timed operation trees and managed GC suspension context. Use bounded queries for runtime performance questions, not crash dumps or UI correctness.
description: Investigate slow WinUI 3 layout, scrolling and virtualization using native ETW captures, timed operation trees and managed GC suspension context. Use bounded queries for runtime performance questions, not crash analysis or UI correctness.
---

## Workflow
Expand Down
Loading