feat(scheduler-sim-decision-trace): hook resource-requirement branching

Task 3.2: single requirements, top-level compounds, alternatives and
members push their path level and record one begin and one end; member
failures record the members not tried, merge failures and skipped
alternatives are separate entries, the chosen alternative or all-failed
is recorded, and each compound attempt's reasons are captured before the
job's stored reason is replaced. Scheduling results are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 11:23:16 +00:00
parent ed7b889bb7
commit 542c6e602a
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 680 additions and 3 deletions

View file

@ -2654,3 +2654,29 @@ sched_trace_hooks_alloc_loop_test = executable(
test('scheduler trace hooks alloc loop test',
sched_trace_hooks_alloc_loop_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# scheduler-sim-decision-trace task 3.2: the resource-requirement branching
# trace hooks (design.md "TraceHooks", PRIMARY / COMPOUND / ALTER / member
# rows; Requirements 3.1-3.6) on the real sched_make_allocation() chain over
# a bare simulation core. Real-scheduler_srcs link technique; libxce's
# merge_job_alloc() is wrapped for the merge failure.
sched_trace_hooks_resreq_test_srcs = ['test_trace_hooks_resreq.c']
foreach f : scheduler_srcs
if f != 'src/main.c'
sched_trace_hooks_resreq_test_srcs += ['../' + f]
endif
endforeach
sched_trace_hooks_resreq_test = executable(
'sched_trace_hooks_resreq_test',
sched_trace_hooks_resreq_test_srcs,
include_directories:[incdir],
dependencies: [scheduler_deps, unity_dep],
link_args: ['-Wl,--wrap=xcecli_start',
'-Wl,--wrap=xcecli_join',
'-Wl,--wrap=merge_job_alloc'],
install: false)
test('scheduler trace hooks resreq test',
sched_trace_hooks_resreq_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])