Configuration¶
DASA's behavior can be tuned through various parameters in the optimization process.
Optimization Parameters¶
These parameters are set in test.py:run_optimization():
Iterations¶
More iterations allow finding harder-to-reach targets but increase runtime.
Learning Rate¶
- Higher values: Faster convergence but may overshoot
- Lower values: More stable but slower
Sigmoid Annealing¶
Controls how "soft" control flow decisions are during optimization:
- Early iterations: Soft decisions allow gradient flow through all branches
- Later iterations: Sharp decisions commit to specific paths
Temperature Annealing (Strings)¶
For Gumbel-Softmax string generation:
- High temperature: Smooth probability distribution
- Low temperature: Near-deterministic character selection
Early Stopping¶
Optimization stops early when loss plateaus.
Docker Configuration¶
Environment Variables¶
| Variable | Default | Description |
|---|---|---|
TARGET |
Main |
Main class name to analyze |
Volume Mounts¶
docker run --rm \
-v "/path/to/java/files:/SUT" \ # Java source files
-v "/path/to/verifier:/svHelpers" \ # Verifier.java location
dasa-graph-extractor
Test Execution Parameters¶
When calling test.main():
| Parameter | Type | Description |
|---|---|---|
target_file |
str |
Path to JSON graph file |
start_nodes |
list |
Input nodes (or None for auto) |
end_nodes |
list |
Target nodes (or None for auto) |
auto_detect_start_end |
bool |
Auto-detect input/target nodes |
test_dir |
str |
Directory with .class files |
test_class |
str |
Main class name |
use_sv_helpers |
bool |
Include svHelpers in classpath |
return_successfull_output |
bool |
Return stdout on success |
num_iterations |
int |
Optimization attempts per target |
verbose |
bool |
Print iteration progress |
Initial Value Strategies¶
DASA uses smart initialization for different types:
Integers¶
# 70% chance: 2-14 bit values (common range)
# 30% chance: 15-31 bit values (edge cases)
# 5% chance: special values (0, -1, 1, MIN, MAX)
Floats¶
Similar to integers but includes floating-point ranges.
Booleans¶
Characters¶
Strings¶
Timeout Configuration¶
In test.py:
# 10-minute global timeout per analysis
if datetime.now() - start_time >= timedelta(minutes=10):
break
GraalVM Options¶
In scripts/entrypoint.sh:
native-image -ea \
-H:Dump=:1 \ # Dump compiler graphs
-H:MaximumInliningSize=0 \ # Disable inlining
-H:+UnlockExperimentalVMOptions \
$TARGET
If graph generation fails, it retries with -O0 (no optimization).
Customizing Node Behavior¶
To modify how specific nodes behave, edit files in nodes/:
nodes/
├── calc/ # Math operations
├── java/ # Java-specific operations
├── types/ # Complex types (String, Array)
├── custom/ # Custom operations (Sigmoid)
└── BaseNode.py # Base class for all nodes
Each node can define:
exec(): Computation logicnode_penalty: Additional loss termcontrolFlowMultiplicative: Path reachability score