Skip to content

Commit fb14668

Browse files
committed
Added comments for the ze_validator
1 parent e5676ee commit fb14668

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

‎backends/ze/ze_validator_entry_exit_helpers.rb‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@
2121
# _exit. An exit-time check that needs an input calls
2222
# state.find_param instead.
2323
#
24-
# THREE RULES THAT EXPLAIN MOST OF THE CODE BELOW
24+
# TWO RULES THAT EXPLAIN MOST OF THE CODE BELOW
2525
# -----------------------------------------------
26-
# 1. NEVER REPORT ON WHAT YOU DID NOT SEE. Tracing may start after the program
27-
# is already running, so a handle or pointer the model has no record of is
28-
# SKIPPED, never flagged. Nearly every check begins with a `return unless`
29-
# guard for exactly this reason: a false positive is far more damaging to
30-
# the tool's usefulness than a missed report.
3126
#
32-
# 2. REPORT ONCE. GPU code loops; the same defect recurs constantly. Checks
27+
# 1. REPORT ONCE. GPU code loops; the same defect recurs constantly. Checks
3328
# build a key naming the specific violation and consult
3429
# state.print_tracker[key] before printing. The pattern is always
3530
# `return unless state.print_tracker[key] == 0` followed by setting it to 1.
3631
#
37-
# 3. CHECK AT THE RIGHT MOMENT. Three timings appear throughout:
32+
# 2. CHECK AT THE RIGHT MOMENT. Three timings appear throughout:
3833
# at _entry - when the call itself might crash the process (no _exit
3934
# would then be traced) or when pre-call state is needed
4035
# at _exit - when the check needs the call to have succeeded

‎backends/ze/ze_validator_state_object.rb‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# -> print_deprecation_warning
3737
# -> on_entry / on_exit
3838
# - lock/unlock shared objects for the thread-safety check
39-
# - run the API's callback from the dispatch tables
39+
# - run the API's callback
4040
# - push/pop the thread's call stack
4141
# -> pump_deferred (a signal may have unblocked pending GPU work)
4242
# ...and once the trace is exhausted, ze_validator.in calls #check_issues.
@@ -106,9 +106,7 @@ def initialize(**opts)
106106
@unlock_shared_object_on_exit = Hash.new { |h, k| h[k] = [] }
107107
@init_called = Hash.new { |h, k| h[k] = false } #pid : init called status
108108
@memory_in_transit = Hash.new {|h,k| h[k] = []} #pid : [[mem, (src|dst)]] list of memories being transferred
109-
# @openend_command_lists = Hash.new {|h,k| h[k] = []} #command_list_handle : command_list_class
110109
@printed_init_error = false
111-
# ADDED: deferred command-list executions awaiting event completion.
112110
# zeCommandQueueExecuteCommandLists is asynchronous, so we do not check a
113111
# list's memory copies at execute time (the destination may only be allocated
114112
# later by another unit that then signals a wait-event). Instead each

0 commit comments

Comments
 (0)