Monday, 2021-10-25

lkclprogrammerjake, star10:51
lkclkylel: yes.  very last state.  because, logical-induction, think about it:10:52
lkcl1) the very last state is what is tested against expected state10:52
lkcl2) if we add an expected state, we want that test to pass10:52
lkcl3) therefore, printing out that very last state, is, obviously, what is needed *such that*10:53
lkcl4) when inserted back into the unit test, it causes the test *against* that expected state to succeed10:53
lkcli mean, we don't want to put in an expected state that's going to fail, do we? :)10:53
lkclit's backwards-logical-induction (like in Functional Programming)10:54
lkclyou start from the results that you want to see, and work backwards through the chain to deduce the actions required for that success to occur10:55
lkclprogrammerjake, i'm going to start putting (to-be-correctly-named-at-some-point) ElwidPartType in as actually functional10:55
lkcland create some mini-example using SimdScope to get it operational10:56
lkcltoshywoshy, openpowerbot needs pinging again, stalled around friday on mattermost13:34
kylellkcl, the expected state code creator works as expected (haha)13:47
lkclkylel, :)14:08
lkclallriiiight14:09
lkclkylel, does it include subtests?14:09
lkclalso can i suggest making a subdirectory14:09
lkcluse os.makedirs (which i think will create sub-paths and not bomb out if they don't exist)14:10
lkclotherwise /tmp is going to be littered with hundreds of small files14:10
lkcl+            for i in range(32):14:10
lkcluse this:14:10
lkclfor i, reg in enumerate(intregs)14:11
lkclbecause some of the SVP64 tests are 128 regs14:11
lkclalso, sigh, i am not a huge fan of "format"14:11
lkclit's hugely verbose.14:11
lkcldo try to use the standard c-library printf convention. %d for integer, %s for string, %x for hex14:12
lkclanother trick: if the line has to wrap like this14:13
lkcl+                    sout.write("{0}e.intregs[{1}] = 0x{2:x}\n".format(14:13
lkcl+                               lindent,14:13
lkcl+                               i,14:13
lkcl+                               state.intregs[i]))14:13
lkclthen you can do:14:13
lkclmsg = "%se.intregs[%d] = 0x%x"14:13
lkclsout.write(msg % (lindent, i, state.intregs[i]))14:13
lkclwhich is 2 lines, not 4.14:13
lkcland is a hell of a lot shorter.14:14
lkclc's printf format was created when space mattered. d=decimal, s=string x=hexadecimal, f=float14:15
lkclit's pretty obvious, and the man pages have been around for 30+ years.14:15
kylelnp.  any ideas on how to grab the name of what the test cases is (such as alu?)14:18
lkclmmm... the only way to do that would be to pass it in to the TestAPI14:19
* lkcl thinks14:19
lkcluse the class name?14:19
lkclwhich you can get with self.__class__.__name__ (usually)14:20
kylelok, will poke around on that.14:20
lkclshould be easy to propagate / obtain in self.add_case()14:21
lkclha! SimdScope works!14:29
lkclprogrammerjake: ElwidPartType works!14:29
lkclthat's a huge relief.  i'm kinda amazed that the unit test actually worked with very little adaptation14:45
lkclas in... hmmm... it shouldn't have worked14:48
lkclfound out why: the same bug is in 2 places.  same functions used16:00
lkclprogrammerjake, i'm just adapting PartType to a new form which returns ranges(start,end) per elwid per element-in-a-group17:40
lkcli'll be trying to do that by adding new functions rather than altering the old ones17:40
lkclwhich means that the existing code and unit tests keep working17:40
lkcland the existing code can be morphed one sub-module at a time to the new function17:41
lkclthen ElwidPartType can be done as well17:41
lkclin a second phase17:41
lkclha! converting PartitionedCat worked18:59
lkclso that's still stable, all partsig unit tests still work18:59
lkclthe ElwidPartType mini-test however should now be thoroughly broken :)18:59
*** henriok <henriok!~henriok@81-229-9-109-no92.tbcn.telia.com> has left #libre-soc20:33

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!