Commit Graph

182 Commits

Author SHA1 Message Date
35dbdffda7 driver: lay some scaffolding to allow us to optimize the stimulus in future 2022-08-18 22:19:50 -07:00
ffda00b796 stim: convert CurlStimulus to a CurlVectorField and use ModulatedVectorField
this opens the door to caching the vector field stuff.
2022-08-18 20:47:36 -07:00
9461cc7781 stim: introduce a VectorField trait which we'll use to build a more structured approach to Stimulus 2022-08-18 17:08:44 -07:00
cf2d21f975 Stimulus: change at method to accept feat_size: f32, loc: Index 2022-08-18 16:21:21 -07:00
6750feef8d stim: remove TimeVarying3
`TimeVarying`(1) is enough for what we want.
2022-08-18 15:51:54 -07:00
570f058ee1 rename AbstractStimulus -> Stimulus 2022-08-18 15:27:18 -07:00
60e44d6d4d rename Stimulus -> RegionGated 2022-08-18 15:22:28 -07:00
eb406ea46f UniformStimulus: use Fields internally 2022-08-18 15:19:22 -07:00
6e7ae48d86 stim: remove the extra norm call in CurlStimulus application
we call `with_mag` after, making it redundant.
2022-08-18 14:28:33 -07:00
454307325b stim: add a scale parameter to AbstractStimulus::eval_into
this boosts perf from 571fps -> 620-ish.
2022-08-18 04:33:00 -07:00
b9581b79b2 sim: add AbstractStimulus::eval_into for bulk evaluation 2022-08-18 04:11:04 -07:00
07fa4042a3 cross: list: add IntoVec trait 2022-08-18 04:00:41 -07:00
300c11f5ca stim: use a Visitor instead of a FoldOp for eval
boosts perf from 420 -> 530 fps
2022-08-18 02:52:57 -07:00
2a9c065cb0 cross: list: allow visit to be mutable 2022-08-18 02:45:15 -07:00
5cc1c310b5 AbstractStimulus: add bulk eval_into operation. 2022-08-18 01:45:09 -07:00
a247b861e1 cross: hide the iteration features behind a flag
they don't compile on spirv due to the inherent use of Options,
but they'll be useful in the CPU-side code.
2022-08-17 21:14:21 -07:00
ee98e1a060 stim: re-express the AbstractStimulus list op as a fold
this gives a big perf boost: 10.5 fps -> 446 fps.

still far lower from the 720 fps we got on an ordinary Vec<Box<dyn
AbstractRegion>>. i think we had achieved 730  using the old
ListVisitor.

it's probably not worth list-ifying the stimuli; at least not at this
level. at the least, we probably want only 5 stimuli: one per core.
if we did that, the stimuli could even have all the same typename,
and be put into a plain old array; no boxing.
2022-08-17 03:28:52 -07:00
4c5c978053 whitespace nits 2022-08-16 01:29:35 -07:00
fad70f45c1 stim: use Map + Sum for evaluating stimuli lists 2022-08-16 01:11:46 -07:00
e2728e0303 stim: impl Add for Fields to simplify some of this code 2022-08-16 00:17:23 -07:00
1a86fb5ca3 cross: list: fold MaybeMeta and Meta into one trait 2022-08-15 02:32:47 -07:00
19893157fa port: legacy sim accessors test to spirv 2022-08-14 19:16:09 -07:00
ee93c22f4a app: multi_core_inverter: perf: move the stimulus Gating to outside the CurlStimulus
the region.contains() logic is much more expensive than the time bounds
check.
this gets an easy 50% perf boost to the ENTIRE simulation
2022-08-13 15:00:56 -07:00
bbb8b2b9ae driver: better APIs around list-based stimuli 2022-08-13 03:51:01 -07:00
858e787c19 driver: allow preserving the Stimuli as a concrete List 2022-08-12 18:03:10 -07:00
40449c4165 stim: implement AbstractStimulus for any List of stimuli
note that this doesn't handle zero-length lists (yet).
2022-08-12 17:08:53 -07:00
a74e7fa9a0 Driver: parameterize over the Stimulus type 2022-08-12 14:47:45 -07:00
e141047bec Driver: simplify the StimuliAdapter
it was basically dead code.
2022-08-12 14:42:56 -07:00
658b8616d7 Torus: correct the cross_section_normal method -- again
i should add integration tests
2022-08-12 02:23:53 -07:00
084c5bc342 Region: remove Clone from the trait, and also parameterize everything
i didn't necessarily *want* to parameterize it all,
but it turned out to be easier to do that than to force all users to
workaround the lack of Clone.
2022-08-12 01:42:19 -07:00
d5fbb4e9b2 Region: remove the Serialization requirement 2022-08-12 00:57:01 -07:00
090b1ca09a BUGFIX: Torus: don't normalize the cross section normal
this would have led to incorrectly scaled current measurements
(but not incorrect current generation). we were likely severely
over-estimating the current.
2022-08-12 00:41:25 -07:00
ae1eb861be instrument the stimulus evaluation in our sim
... stimulus evaluation accounts for like 80% of the execution time 🤦
2022-08-11 22:57:43 -07:00
09bc7492ed expose diagnostics into the Sim, and capture stimuli evaluation
this isn't publicly exposed yet.
2022-08-11 22:43:07 -07:00
e7cc78a947 diagnostics: split into their own file 2022-08-11 22:31:05 -07:00
aa8f474f52 driver: Diagnostics: clean up the impl a bit 2022-08-11 19:04:12 -07:00
4a33912164 driver: abstract the render time measurements behind a Diagnostics api 2022-08-11 18:58:22 -07:00
f7b72a72be driver: abstract the step diagnostics measurements 2022-08-11 18:41:41 -07:00
a413a4d391 driver: move last_diag_time out of the Diagnostics object 2022-08-11 18:38:36 -07:00
0c9f04981a driver: relegate more diagnostics formatting to the Diagnostics impl 2022-08-11 18:36:35 -07:00
6f1e1557b3 driver: diagnostics: track the actual number of frames stepped
this allows fps-related diagnostics to be meaningful after
serialization / restarts.
2022-08-11 18:29:58 -07:00
e85d38d415 driver: split the Diagnostics out into their own object
more diagnostic refactoring to come
2022-08-11 18:27:30 -07:00
1928ad71cd serializer renderer: gracefully handle the case where we run out of disk space
we might still run out of space when writing CSVs and other outputs...
but that's at least less likely,
as long as we serialize the rendering.
2022-08-11 18:21:46 -07:00
4fe8be8951 when writing Measurements to a CSV, format them in a machine-readable manner
i haven't tested the ones which contains commas -- hopefully the CSV
encoder deals with these :-)
2022-08-10 01:34:37 -07:00
8a3a64face meas: correctly render SI prefixes for negative numbers
the previous implementation treated negative numbers as effectively
having unknown magnitude, rendering them without any adjustment.
2022-08-10 01:17:49 -07:00
e08c6dbaa3 stim: backfill tests for CurlStimulus 2022-08-09 22:54:21 -07:00
520e9d9f68 CurlStimulus: re-use the HasCrossSection trait code
i believe this inverts the sign, but it also looks more correct this way
so i'm not immediately correcting that in this patch.
will backfill tests to verify.
2022-08-09 22:14:38 -07:00
1771973c6d CurlStimulus: take axis and center directly from the Region
by taking more from the region, we'll be able to reuse common code
and also make this more testable
2022-08-09 22:10:16 -07:00
7d1ee0ad50 meas: backfill tests for CurrentLoop 2022-08-05 17:35:55 -07:00
06379ffd30 CurrentLoop: use a better justified measurement algorithm
'course the best way to justify it is with tests: hopefully those will
come shortly.
2022-08-01 06:12:16 -07:00