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
35 changes: 35 additions & 0 deletions .github/scripts/test_frozen_scope_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,41 @@ def execute(command, **kwargs):
protocol = json.loads((root / 'output/protocol.json').read_text())
self.assertEqual(protocol['tieredCompilation'], setting)

def test_tiering_off_code_capture_keeps_both_controls_and_excludes_timings(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
environments = []

def execute(command, **kwargs):
environment = kwargs['env']
environments.append(environment)
kwargs['stdout'].write(COMPLETE)
Path(environment['DOTNET_JitStdOutFile']).write_text(
'; Assembly listing for method Example:ScopeOnly()\n')

parent = {'DOTNET_TieredCompilation': '1'}
with patch('sys.argv', ['control', directory, str(root / 'output'),
'--tiered-compilation', 'off', '--jit-disassembly']), \
patch('frozen_scope_control.os.environ', parent), \
patch('frozen_scope_control.verify', return_value='commit') as verify, \
patch('frozen_scope_control.executable', side_effect=lambda path, scoped: (path / 'runner.dll', '4')), \
patch('frozen_scope_control.subprocess.run', side_effect=execute):
main()
self.assertEqual(verify.call_count, 6)
self.assertEqual(len(environments), 8)
self.assertTrue(all(env['DOTNET_TieredCompilation'] == '0' for env in environments))
self.assertTrue(all(env['DOTNET_JitDisasm'] == '*' for env in environments))
self.assertEqual(parent, {'DOTNET_TieredCompilation': '1'})
outcomes = json.loads((root / 'output/outcomes.json').read_text())
self.assertEqual([item['side'] for item in outcomes], ['baseline', 'candidate', 'candidate', 'baseline'] * 2)
self.assertTrue(all(item['runtimeEnvironment'] == {'DOTNET_TieredCompilation': '0'} for item in outcomes))
self.assertTrue(all('disassembly' in item and 'error' not in item for item in outcomes))
self.assertTrue(all('meanNs' not in item and 'bytesPerOperation' not in item for item in outcomes))
self.assertTrue(all('WorkloadResult' in path.read_text() for path in (root / 'output').glob('*.log')))
protocol = json.loads((root / 'output/protocol.json').read_text())
self.assertEqual(protocol['tieredCompilation'], 'off')
self.assertTrue(protocol['jitDisassembly'])

def test_invalid_archive_never_launches(self):
with tempfile.TemporaryDirectory() as directory, \
patch('sys.argv', ['control', directory, str(Path(directory) / 'output')]), \
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/frozen-scope-control.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
gh run download 42772012652 --name performance-42772012652-1 --dir inputs
# Same hosted job and original images; no cross-host comparison or gate retry.
- name: Observe default-tiering ABBA before runtime control
# Timing controls are retained in run 42779203851. Inspect native code in
# the unfavorable tiering-off condition; diagnostic timings are excluded.
- name: Capture native code with tiered compilation disabled
if: success() || failure()
run: python3 .github/scripts/frozen_scope_control.py inputs results/default-before
- name: Observe ABBA with native tiered compilation disabled
if: success() || failure()
run: python3 .github/scripts/frozen_scope_control.py inputs results/tiering-off --tiered-compilation off
- name: Observe default-tiering ABBA after runtime control
if: success() || failure()
run: python3 .github/scripts/frozen_scope_control.py inputs results/default-after
run: python3 .github/scripts/frozen_scope_control.py inputs results/tiering-off-code --tiered-compilation off --jit-disassembly
- name: Retain all outcomes and executable inputs
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down
Loading