Skip to content
Merged
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
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 no capability yet: no scenario measures runtime performance, and
crediting it as `winui.build` would let it pass unrelated build and crash scenarios. Loading it
earns no routing credit, and `winapp perf` commands are recorded but count toward no capability.
- 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
99 changes: 98 additions & 1 deletion benchmarks/agents/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,56 @@
"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": [],
"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 +350,54 @@
{
"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": [],
"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
19 changes: 19 additions & 0 deletions benchmarks/agents/tests/Capabilities.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,25 @@ Describe 'Test-ScenarioExpectations' {
(Test-ScenarioExpectations -Expect $e -LoadedSkills @() -InstalledSkills $installed -WinappCommands $null -Map $map).CommandHit | Should -BeNullOrEmpty
}

It 'gives winapp-performance and perf commands no routing credit, in every map that has the skill' {
# No scenario measures runtime performance yet, so loading the skill must score like loading nothing.
$real = Read-CapabilityMap -Path (Join-Path $PSScriptRoot '..\capabilities.json')
$winui = @(Get-PluginSkillNames -PluginPath (Join-Path $repoRoot 'plugins\winui\agent-plugin'))
$commands = @(Get-WinappCommands -Text 'Run winapp perf analyze .\trace --json')
$scenarios = @(Get-ScenarioDefinitions -ScenariosRoot (Join-Path $PSScriptRoot '..\scenarios') | Where-Object { $_.Variant -eq 'base' -and $_.Expect.Capabilities.Primary.Count })
$maps = @($real.Maps | Where-Object { $_.Skills.ContainsKey('winapp-performance') })
$maps.Count | Should -BeGreaterThan 0
foreach ($m in $maps) {
$installed = @(@($m.Skills.Keys) + $winui)
foreach ($s in $scenarios) {
$none = Test-ScenarioExpectations -Expect $s.Expect -LoadedSkills @() -InstalledSkills $installed -Map $real
$r = Test-ScenarioExpectations -Expect $s.Expect -LoadedSkills 'winapp-performance' -InstalledSkills $installed -WinappCommands $commands -Map $real
$r.Status | Should -Be $none.Status -Because "$($s.Id) [$($m.Id)]"
$r.CommandHit | Should -Not -BeTrue -Because "$($s.Id) [$($m.Id)]"
}
}
}

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