Browse Source

Rust bug in Rust stepping function

Joeri Exelmans 4 years ago
parent
commit
6890368eee

+ 8 - 0
src/sccd/statechart/codegen/code_generation.txt

@@ -136,6 +136,8 @@ Insights
   - e.g. An unexecutable transition is detected as an unreachable statement
   - e.g. An unused event is detected as an unused variable or never-constructed enum variant.
 
+- Rust's product ("struct") and sum ("enum") types map perfectly onto And- and Or-states
+
 
 Performance over time
 ---------------------
@@ -143,6 +145,12 @@ Performance over time
 for test semantics/big_step_maximality/test_ortho_takemany.xml
 
 
+commit 39fc866428c595c7ed909569d998981d1d350059 - Dec 22, 2020 - various fixes, support INSTATE
+
+binary size, opt-level=3:                       422200 bytes
+instruction count (perf stat) (opt-level=3):    570.776 instructions:u
+
+
 commit ec39dd73ea42a9ccee6f1edc8863b36625e0721a - Dec 20, 2020 - put reusable stuff in library
 
 binary size, opt-level=3:                       422192 bytes

+ 5 - 1
src/sccd/statechart/codegen/rust.py

@@ -710,6 +710,8 @@ class StatechartRustGenerator(ActionLangRustGenerator):
 
         self.w.dedent()
 
+        if DEBUG:
+            self.w.writeln("  eprintln!(\"completed fair_step\");")
         self.w.writeln("  fired")
         self.w.writeln("}")
 
@@ -733,7 +735,7 @@ class StatechartRustGenerator(ActionLangRustGenerator):
                 self.w.writeln("    }")
                 self.w.writeln("    ctr += 1;")
                 self.w.writeln("    assert_ne!(ctr, %d, \"too many steps (limit reached)\");" % LIMIT)
-                self.w.writeln("    fired |= just_fired & !ARENA_UNSTABLE; // only record stable arenas")
+                self.w.writeln("    fired |= just_fired;")
                 if cycle_input:
                     self.w.writeln("    // Input Event Lifeline: %s" % sc.semantics.input_event_lifeline)
                     self.w.writeln("    e = None;")
@@ -741,6 +743,8 @@ class StatechartRustGenerator(ActionLangRustGenerator):
                     self.w.writeln("    // Internal Event Lifeline: %s" % sc.semantics.internal_event_lifeline)
                     self.w.writeln("    internal.cycle();")
                 self.w.writeln("  }")
+                if DEBUG:
+                    self.w.writeln("  eprintln!(\"completed %s\");" % name)
                 self.w.writeln("  fired")
             self.w.writeln("}")