Skip to content

Commit bd684b2

Browse files
authored
Merge pull request #443 from StoneCypher/CleanupStuff
Cleanup stuff
2 parents b5389e3 + c346541 commit bd684b2

14 files changed

+52
-58
lines changed

benchmark/results/general.chart.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</head>
2929
<body>
3030
<div class="container">
31-
<canvas id="chart1651624732492" width="16" height="9"></canvas>
31+
<canvas id="chart1651636100388" width="16" height="9"></canvas>
3232
</div>
3333
<script>
3434
const format = (num) => {
@@ -51,18 +51,18 @@
5151
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
5252
)
5353
}
54-
const ctx1651624732492 = document
55-
.getElementById('chart1651624732492')
54+
const ctx1651636100388 = document
55+
.getElementById('chart1651636100388')
5656
.getContext('2d')
57-
const chart1651624732492 = new Chart(ctx1651624732492, {
57+
const chart1651636100388 = new Chart(ctx1651636100388, {
5858
type: 'bar',
5959
data: {
6060
labels: ["Blind cycle a traffic light 500 times by transition","Blind cycle a hooked traffic light 500 times by transition","Blind cycle a traffic light 500 times by action","Blind cycle a hooked traffic light 500 times by action"],
6161
datasets: [
6262
{
63-
data: [20799,1784,15032,1486],
64-
backgroundColor: ["hsl(120, 85%, 55%)","hsl(10.296, 85%, 55%)","hsl(86.724, 85%, 55%)","hsl(8.568000000000001, 85%, 55%)"],
65-
borderColor: ["hsl(120, 85%, 55%)","hsl(10.296, 85%, 55%)","hsl(86.724, 85%, 55%)","hsl(8.568000000000001, 85%, 55%)"],
63+
data: [20924,1805,14638,1565],
64+
backgroundColor: ["hsl(120, 85%, 55%)","hsl(10.355999999999995, 85%, 55%)","hsl(83.95200000000001, 85%, 55%)","hsl(8.976000000000004, 85%, 55%)"],
65+
borderColor: ["hsl(120, 85%, 55%)","hsl(10.355999999999995, 85%, 55%)","hsl(83.95200000000001, 85%, 55%)","hsl(8.976000000000004, 85%, 55%)"],
6666
borderWidth: 2,
6767
},
6868
],

benchmark/results/general.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
22
"name": "General performance suite",
3-
"date": "2022-05-04T00:38:52.492Z",
4-
"version": "1.0.0",
3+
"date": "2022-05-04T03:48:20.388Z",
4+
"version": "1.1.0",
55
"results": [
66
{
77
"name": "Blind cycle a traffic light 500 times by transition",
8-
"ops": 20799,
9-
"margin": 4.1,
8+
"ops": 20924,
9+
"margin": 2.51,
1010
"percentSlower": 0
1111
},
1212
{
1313
"name": "Blind cycle a hooked traffic light 500 times by transition",
14-
"ops": 1784,
15-
"margin": 0.65,
16-
"percentSlower": 91.42
14+
"ops": 1805,
15+
"margin": 0.7,
16+
"percentSlower": 91.37
1717
},
1818
{
1919
"name": "Blind cycle a traffic light 500 times by action",
20-
"ops": 15032,
21-
"margin": 0.94,
22-
"percentSlower": 27.73
20+
"ops": 14638,
21+
"margin": 2.41,
22+
"percentSlower": 30.04
2323
},
2424
{
2525
"name": "Blind cycle a hooked traffic light 500 times by action",
26-
"ops": 1486,
27-
"margin": 3.43,
28-
"percentSlower": 92.86
26+
"ops": 1565,
27+
"margin": 0.72,
28+
"percentSlower": 92.52
2929
}
3030
],
3131
"fastest": {

dist/es6/jssm.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { reduce as reduce_to_639 } from 'reduce-to-639-1';
33
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, hook_name, named_hook_name } from './jssm_util';
44
import { parse } from './jssm-dot'; // TODO FIXME WHARGARBL this could be post-typed
5-
import { version } from './version'; // replaced from package.js in build // TODO FIXME currently broken
5+
import { version } from './version'; // replaced from package.js in build
66
/* eslint-disable complexity */
77
function arrow_direction(arrow) {
88
switch (String(arrow)) {
@@ -404,7 +404,7 @@ class Machine {
404404
// set up the action mapping, so that actions can be looked up by origin
405405
if (tr.action) {
406406
// forward mapping first by action name
407-
let actionMap = this._actions.get(tr.action); // TODO FIXME ?Map equiv
407+
let actionMap = this._actions.get(tr.action);
408408
if (!(actionMap)) {
409409
actionMap = new Map();
410410
this._actions.set(tr.action, actionMap);
@@ -416,7 +416,7 @@ class Machine {
416416
actionMap.set(tr.from, thisEdgeId);
417417
}
418418
// reverse mapping first by state origin name
419-
let rActionMap = this._reverse_actions.get(tr.from); // TODO FIXME ?Map equiv
419+
let rActionMap = this._reverse_actions.get(tr.from);
420420
if (!(rActionMap)) {
421421
rActionMap = new Map();
422422
this._reverse_actions.set(tr.from, rActionMap);
@@ -832,13 +832,11 @@ class Machine {
832832
return this._edges[idx];
833833
}
834834
valid_action(action, _newData) {
835-
// todo whargarbl implement hooks
836835
// todo whargarbl implement data stuff
837836
// todo major incomplete whargarbl comeback
838837
return this.current_action_for(action) !== undefined;
839838
}
840839
valid_transition(newState, _newData) {
841-
// todo whargarbl implement hooks
842840
// todo whargarbl implement data stuff
843841
// todo major incomplete whargarbl comeback
844842
const transition_for = this.lookup_transition_for(this.state(), newState);
@@ -851,7 +849,6 @@ class Machine {
851849
return true;
852850
}
853851
valid_force_transition(newState, _newData) {
854-
// todo whargarbl implement hooks
855852
// todo whargarbl implement data stuff
856853
// todo major incomplete whargarbl comeback
857854
return (this.lookup_transition_for(this.state(), newState) !== undefined);

dist/es6/version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const version = "5.45.0";
1+
const version = "5.45.2";
22
export { version };

dist/jssm.es5.cjs.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jssm.es5.cjs.nonmin.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -15887,7 +15887,7 @@ function peg$parse(input, options) {
1588715887
}
1588815888
}
1588915889

15890-
const version = "5.45.0";
15890+
const version = "5.45.2";
1589115891

1589215892
// whargarbl lots of these return arrays could/should be sets
1589315893
/* eslint-disable complexity */
@@ -16291,7 +16291,7 @@ class Machine {
1629116291
// set up the action mapping, so that actions can be looked up by origin
1629216292
if (tr.action) {
1629316293
// forward mapping first by action name
16294-
let actionMap = this._actions.get(tr.action); // TODO FIXME ?Map equiv
16294+
let actionMap = this._actions.get(tr.action);
1629516295
if (!(actionMap)) {
1629616296
actionMap = new Map();
1629716297
this._actions.set(tr.action, actionMap);
@@ -16303,7 +16303,7 @@ class Machine {
1630316303
actionMap.set(tr.from, thisEdgeId);
1630416304
}
1630516305
// reverse mapping first by state origin name
16306-
let rActionMap = this._reverse_actions.get(tr.from); // TODO FIXME ?Map equiv
16306+
let rActionMap = this._reverse_actions.get(tr.from);
1630716307
if (!(rActionMap)) {
1630816308
rActionMap = new Map();
1630916309
this._reverse_actions.set(tr.from, rActionMap);
@@ -16719,13 +16719,11 @@ class Machine {
1671916719
return this._edges[idx];
1672016720
}
1672116721
valid_action(action, _newData) {
16722-
// todo whargarbl implement hooks
1672316722
// todo whargarbl implement data stuff
1672416723
// todo major incomplete whargarbl comeback
1672516724
return this.current_action_for(action) !== undefined;
1672616725
}
1672716726
valid_transition(newState, _newData) {
16728-
// todo whargarbl implement hooks
1672916727
// todo whargarbl implement data stuff
1673016728
// todo major incomplete whargarbl comeback
1673116729
const transition_for = this.lookup_transition_for(this.state(), newState);
@@ -16738,7 +16736,6 @@ class Machine {
1673816736
return true;
1673916737
}
1674016738
valid_force_transition(newState, _newData) {
16741-
// todo whargarbl implement hooks
1674216739
// todo whargarbl implement data stuff
1674316740
// todo major incomplete whargarbl comeback
1674416741
return (this.lookup_transition_for(this.state(), newState) !== undefined);

dist/jssm.es5.iife.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jssm.es5.iife.nonmin.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -15886,7 +15886,7 @@ var jssm = (function (exports) {
1588615886
}
1588715887
}
1588815888

15889-
const version = "5.45.0";
15889+
const version = "5.45.2";
1589015890

1589115891
// whargarbl lots of these return arrays could/should be sets
1589215892
/* eslint-disable complexity */
@@ -16290,7 +16290,7 @@ var jssm = (function (exports) {
1629016290
// set up the action mapping, so that actions can be looked up by origin
1629116291
if (tr.action) {
1629216292
// forward mapping first by action name
16293-
let actionMap = this._actions.get(tr.action); // TODO FIXME ?Map equiv
16293+
let actionMap = this._actions.get(tr.action);
1629416294
if (!(actionMap)) {
1629516295
actionMap = new Map();
1629616296
this._actions.set(tr.action, actionMap);
@@ -16302,7 +16302,7 @@ var jssm = (function (exports) {
1630216302
actionMap.set(tr.from, thisEdgeId);
1630316303
}
1630416304
// reverse mapping first by state origin name
16305-
let rActionMap = this._reverse_actions.get(tr.from); // TODO FIXME ?Map equiv
16305+
let rActionMap = this._reverse_actions.get(tr.from);
1630616306
if (!(rActionMap)) {
1630716307
rActionMap = new Map();
1630816308
this._reverse_actions.set(tr.from, rActionMap);
@@ -16718,13 +16718,11 @@ var jssm = (function (exports) {
1671816718
return this._edges[idx];
1671916719
}
1672016720
valid_action(action, _newData) {
16721-
// todo whargarbl implement hooks
1672216721
// todo whargarbl implement data stuff
1672316722
// todo major incomplete whargarbl comeback
1672416723
return this.current_action_for(action) !== undefined;
1672516724
}
1672616725
valid_transition(newState, _newData) {
16727-
// todo whargarbl implement hooks
1672816726
// todo whargarbl implement data stuff
1672916727
// todo major incomplete whargarbl comeback
1673016728
const transition_for = this.lookup_transition_for(this.state(), newState);
@@ -16737,7 +16735,6 @@ var jssm = (function (exports) {
1673716735
return true;
1673816736
}
1673916737
valid_force_transition(newState, _newData) {
16740-
// todo whargarbl implement hooks
1674116738
// todo whargarbl implement data stuff
1674216739
// todo major incomplete whargarbl comeback
1674316740
return (this.lookup_transition_for(this.state(), newState) !== undefined);

docs/docs/classes/Machine.html

+1-1
Large diffs are not rendered by default.

docs/docs/modules.html

+1-1
Large diffs are not rendered by default.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jssm",
3-
"version": "5.45.0",
3+
"version": "5.45.2",
44
"engines": {
55
"node": ">=10.0.0"
66
},
@@ -116,8 +116,7 @@
116116
"text_audit": "^0.9.3",
117117
"ts-jest": "^27.0.7",
118118
"typedoc": "^0.22.15",
119-
"typescript": "^4.1.3",
120-
"viz.js": "^1.7.1"
119+
"typescript": "^4.1.3"
121120
},
122121
"dependencies": {
123122
"reduce-to-639-1": "^1.0.4"

src/buildjs/benchmark.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ b.suite('General performance suite',
8484
b.cycle(),
8585
b.complete(),
8686

87-
b.save({ file: 'general', version: '1.0.0' }),
87+
b.save({ file: 'general', version: '1.1.0' }),
8888
b.save({ file: 'general', format: 'chart.html' }),
8989

9090
);

src/ts/jssm.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939

4040
import { parse } from './jssm-dot'; // TODO FIXME WHARGARBL this could be post-typed
4141

42-
import { version } from './version'; // replaced from package.js in build // TODO FIXME currently broken
42+
import { version } from './version'; // replaced from package.js in build
4343

4444

4545

@@ -230,7 +230,7 @@ function compile_rule_transition_step<mDT>(
230230
to : string,
231231
this_se : JssmCompileSe,
232232
next_se : JssmCompileSe
233-
) : Array< JssmTransition<mDT> > { // todo flow describe the parser representation of a transition step extension
233+
) : Array< JssmTransition<mDT> > { // todo typescript describe the parser representation of a transition step extension
234234

235235
const edges : Array< JssmTransition<mDT> > = [];
236236

@@ -261,13 +261,13 @@ function compile_rule_transition_step<mDT>(
261261

262262

263263

264-
function compile_rule_handle_transition(rule: JssmCompileSeStart<StateType>): any { // TODO FIXME no any // todo flow describe the parser representation of a transition
264+
function compile_rule_handle_transition(rule: JssmCompileSeStart<StateType>): any { // TODO FIXME no any // todo typescript describe the parser representation of a transition
265265
return compile_rule_transition_step([], rule.from, rule.se.to, rule.se, rule.se.se);
266266
}
267267

268268

269269

270-
function compile_rule_handler(rule: JssmCompileSeStart<StateType>): JssmCompileRule { // todo flow describe the output of the parser
270+
function compile_rule_handler(rule: JssmCompileSeStart<StateType>): JssmCompileRule {
271271

272272
if (rule.key === 'transition') {
273273
return { agg_as: 'transition', val: compile_rule_handle_transition(rule) };
@@ -306,7 +306,7 @@ function compile_rule_handler(rule: JssmCompileSeStart<StateType>): JssmCompileR
306306

307307

308308

309-
function compile<mDT>(tree: JssmParseTree): JssmGenericConfig<mDT> { // todo flow describe the output of the parser
309+
function compile<mDT>(tree: JssmParseTree): JssmGenericConfig<mDT> {
310310

311311
const results : {
312312
graph_layout : Array< JssmLayout >,
@@ -610,7 +610,7 @@ class Machine<mDT> {
610610

611611

612612
// forward mapping first by action name
613-
let actionMap: Map<StateType, number> = this._actions.get(tr.action); // TODO FIXME ?Map equiv
613+
let actionMap: Map<StateType, number> = this._actions.get(tr.action);
614614
if (!(actionMap)) {
615615
actionMap = new Map();
616616
this._actions.set(tr.action, actionMap);
@@ -624,7 +624,7 @@ class Machine<mDT> {
624624

625625

626626
// reverse mapping first by state origin name
627-
let rActionMap: Map<StateType, number> = this._reverse_actions.get(tr.from); // TODO FIXME ?Map equiv
627+
let rActionMap: Map<StateType, number> = this._reverse_actions.get(tr.from);
628628
if (!(rActionMap)) {
629629
rActionMap = new Map();
630630
this._reverse_actions.set(tr.from, rActionMap);
@@ -1056,7 +1056,10 @@ class Machine<mDT> {
10561056
}
10571057
}
10581058

1059+
1060+
10591061
transition(newState: StateType, newData?: mDT): boolean {
1062+
10601063
// todo whargarbl implement hooks
10611064
// todo whargarbl implement data stuff
10621065
// todo major incomplete whargarbl comeback
@@ -1092,8 +1095,12 @@ class Machine<mDT> {
10921095

10931096
}
10941097

1098+
1099+
10951100
// can leave machine in inconsistent state. generally do not use
1101+
10961102
force_transition(newState: StateType, newData?: mDT): boolean {
1103+
10971104
// todo whargarbl implement hooks
10981105
// todo whargarbl implement data stuff
10991106
// todo major incomplete whargarbl comeback
@@ -1145,14 +1152,12 @@ class Machine<mDT> {
11451152
}
11461153

11471154
valid_action(action: StateType, _newData?: mDT): boolean { // todo comeback unignore newData
1148-
// todo whargarbl implement hooks
11491155
// todo whargarbl implement data stuff
11501156
// todo major incomplete whargarbl comeback
11511157
return this.current_action_for(action) !== undefined;
11521158
}
11531159

11541160
valid_transition(newState: StateType, _newData?: mDT): boolean { // todo comeback unignore newData
1155-
// todo whargarbl implement hooks
11561161
// todo whargarbl implement data stuff
11571162
// todo major incomplete whargarbl comeback
11581163
const transition_for: JssmTransition<mDT> = this.lookup_transition_for(this.state(), newState);
@@ -1165,7 +1170,6 @@ class Machine<mDT> {
11651170
}
11661171

11671172
valid_force_transition(newState: StateType, _newData?: mDT): boolean { // todo comeback unignore newData
1168-
// todo whargarbl implement hooks
11691173
// todo whargarbl implement data stuff
11701174
// todo major incomplete whargarbl comeback
11711175
return (this.lookup_transition_for(this.state(), newState) !== undefined);

src/ts/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
const version: string = "5.45.0";
2+
const version: string = "5.45.2";
33
export { version };

0 commit comments

Comments
 (0)