How to Run a Reference Execution
Run applications on Signaloid's C0 Reference cores and trace the distribution behind individual variables in your program.
Signaloid C0 Reference cores perform distribution arithmetic with results on-par
with a brute-force Monte Carlo simulation, without you writing the sampling and
post-processing yourself. Their defining setting is the Reference Quality
Level, the number of times the platform re-executes your code. The default
C0Pro-Reference core uses a level of 32. For the
microarchitecture details, see the
Cores reference.
This page covers how to run applications on a C0 Reference core and how to tell
the platform which variables to trace. The mechanics of starting a run are the
same as for any other Signaloid core,
such as C0Pro-S, C0Pro-S+, or C0Pro-Bypass. Pick the Reference core from the core
selector, set command-line arguments and data sources as you would for any other
core, then run.
To produce distributional output across the re-executions, the platform
accumulates particle values for each variable across runs. You tell it which
variables to trace by name, file, and line number of the declaration, since
the same variable name can appear in multiple scopes. The traced variables must
be of double or float base type, including typedef aliases that resolve to
those types. The
Variable Viewer,
available both in the Code Playground and on each repository's detail page,
lists every traced and traceable variable in your source.
Reference runs in the Code Playground
Click Toggle variable viewer () on the editor toolbar to open the Variable Viewer for a Code Playground run. In the panel, click Discover () to populate the list. Each row shows the source file and line number of the declaration. Tick a row to trace that variable on the next reference-core run.
On a core without the Reference microarchitecture, the Variable Viewer offers to switch you to a compatible core in one click. Reset marked variables () clears every selected trace. After you change the source code, the panel surfaces a Code updated banner. Click it to re-run discovery against the new code.
For every selected variable, the platform shows a distributional plot wherever the program prints the value. Figure 1 walks through the basic tracing flow on the default C0Pro-Reference core.
R and P from main, and watching the traced values appear underlined in stdout, each linking to its distribution. V was not ticked, so its printed output shows only the particle value.The platform builds the output distribution from the expressions your program
actually prints. Print the variable you want to trace, not an expression that
uses it. Take double seconds printed with
printf("Milliseconds = %lf\n", seconds * 1000): the platform will not produce
a distribution for seconds * 1000, even if seconds is traced. Define and
print double milliseconds = seconds * 1000 and trace milliseconds instead.
Custom variable traces
Reference runs can also trace individual array elements and the float or
double fields of structs. Add Custom Trace opens the Add Custom
Variable Trace dialog, where you enter the element expression along with the
file and line of its declaration. See
Custom trace expressions
for the expression syntax, including array ranges and the accepted forms. To
stop tracing a custom expression, untick its row. Figure 2 walks through adding
a custom trace and running the program with it active.
array[1:2] as the Variable Name with main.c and the declaration line of the double array[3] base variable, then running. The stdout underlines array[1] and array[2]. array[0] was not in the range, so its printed output shows only the particle value.Reference runs for repositories
Before running a repository on a C0 Reference core, pick the variables to trace.
On the connected repository's card, click Discover Variables
() to open the dedicated Variable Viewer page for that
repository (/repositories/detail). The page works the same way as the Code
Playground panel. Click Discover () to populate the list,
then pick rows to trace or add custom traces.
a and c from main, and running on the default C0Pro-Reference core. stdout underlines a and c. b was not ticked, so its printed output shows only the particle value.Traced variables in signaloid.yaml
For repository runs, you can declare traces in a signaloid.yaml file at the
top level of your repository instead of clicking through the UI, using a
TraceVariables list. See
The "signaloid.yaml" File
for the schema and examples.