Hi Robert,
I see the following potential causes:
In #findErrorLocationsDegree:coefficients:count:fieldSize:result: the return value in ambiguous. You make the primitive fail if not enough errors are found. But after the send, you don't check for failure but simply send #methodReturnReceiver. Instead, you should either check for primitive failure after the send or make #findErrorLocationsDegree:coefficients:count:fieldSize:result: return boolean value: the method was successful or not. E.g. when numErrors = 1, return true, in the other branch, return e = numErrors. (If slang doesn't support boolean types, just use 0 and 1). In the actual primitive method, check for the value returned by that method and fail the primitive when needed. Once the primitive has failed, you ought to return from it. I see the above pattern in other methods too (marking the primitive as failed in a not-top-level method without checking for failure outside). Those need to be fixed as well.
Another potential issue I see is that the validation of the arguments is not complete. E.g.: #stackIntegerValue: may have already set the primitive to failed if the argument was not an integer. So, before continuing, that has to be checked.
Another possible but unlikely problem is that you assume that both result and coefficients have at least one field. But that may not be true which can result in segfaults.
Levente
Thanks very much, Levente. I'll dig into your suggestions tomorrow. I made my first contact over ham radio tonight after another generous soul totally hooked me up with cables and power supplies and programmed my radio. I am so excited! Now on the air, KO4PYS.
--- Kindly, Robert
On 6/3/21 8:43 PM, Levente Uzonyi wrote:
Hi Robert,
I see the following potential causes:
In #findErrorLocationsDegree:coefficients:count:fieldSize:result: the return value in ambiguous. You make the primitive fail if not enough errors are found. But after the send, you don't check for failure but simply send #methodReturnReceiver. Instead, you should either check for primitive failure after the send or make #findErrorLocationsDegree:coefficients:count:fieldSize:result: return boolean value: the method was successful or not. E.g. when numErrors = 1, return true, in the other branch, return e = numErrors. (If slang doesn't support boolean types, just use 0 and 1). In the actual primitive method, check for the value returned by that method and fail the primitive when needed. Once the primitive has failed, you ought to return from it. I see the above pattern in other methods too (marking the primitive as failed in a not-top-level method without checking for failure outside). Those need to be fixed as well.
Another potential issue I see is that the validation of the arguments is not complete. E.g.: #stackIntegerValue: may have already set the primitive to failed if the argument was not an integer. So, before continuing, that has to be checked.
Another possible but unlikely problem is that you assume that both result and coefficients have at least one field. But that may not be true which can result in segfaults.
Levente
Alright, Levente! Thank you so very much! You are a generous soul & an angel! Your suggestions (the first two) worked like a charm and I have a running plugin to GF arithmetic, GFPoly arithmetic and RSDecoder arithmetic {#findErrorLocation: & #findErrorMagnitudes:errorLocations:} both plugganized. The cumulative speedup is 568% and all the hotspots changed again.
I tried to implement GFPoly>>#initializeField:coefficients: in a plugin function, but my image is crashing on startup, when standard GFs are created in GF class>>#startUp:, when each GF initializes it attempts to create a one and a zero polynomial. This would call the primitive for #initializePoly. This code can be seen in the package: CryptographyRSFECPluginsInitializeGFPoly. I am attempting to run:
(firstNonZero > coefficientsLength) ifTrue: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: 1] ifFalse: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (coefficientsLength - firstNonZero + 1).
The cumulative speedup is 568% and all the hotspots changed again. Here are the profiling results from just the RSFEC code alone, no RSErasure code is in the profiles. The new hotspots are, with RSFECPlugin, then without.
((128683
/ 22648) asFloat * 100) asInteger = 568%
The remaining potential plugganization relates to complex object instantiation inside the plugin functions. {#decode:twoS:, #runEuclideanAlgorithm: and #initializeField:coefficients:}. The best value for work return is to plugganize #initializeField:coefficients: at 3.3 seconds (14%)
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
And:
WITHOUT GF & GFPOLY PRIMITIVES - NO RSFEC PRIMITIVES
98352
tallies,
128683
msec.
**Leaves** GF arithmetic
23.4
% {
30126
ms} RSFECGenericGF>>
exp
:
13.4
% {
17229
ms} RSFECGenericGF>>addOrSubtract:by:
11.9
% {
15251
ms} RSFECGenericGF>>maskValue:
10.0
% {
12916
ms} RSFECGenericGF>>
log
:
8.6
% {
11059
ms} RSFECGenericGF>>normalizeIndex:
6.8
% {
8792
ms} RSFECGenericGF>>multiply:by: GFPoly arithmetic
2.7
% {
3529
ms} RSFECGenericGFPoly>>evaluateAt:
2.1
% {
2715
ms} RSFECGenericGFPoly>>addOrSubtractPoly:
2.0
% {
2578
ms} RSFECGenericGFPoly>>multiplyByMonomialDegree:coefficient:
--- Kindly, Robert
On 6/3/21 8:43 PM, Levente Uzonyi wrote:
Hi Robert,
I see the following potential causes:
In #findErrorLocationsDegree:coefficients:count:fieldSize:result: the return value in ambiguous. You make the primitive fail if not enough errors are found. But after the send, you don't check for failure but simply send #methodReturnReceiver. Instead, you should either check for primitive failure after the send or make #findErrorLocationsDegree:coefficients:count:fieldSize:result: return boolean value: the method was successful or not. E.g. when numErrors = 1, return true, in the other branch, return e = numErrors. (If slang doesn't support boolean types, just use 0 and 1). In the actual primitive method, check for the value returned by that method and fail the primitive when needed. Once the primitive has failed, you ought to return from it. I see the above pattern in other methods too (marking the primitive as failed in a not-top-level method without checking for failure outside). Those need to be fixed as well.
Another potential issue I see is that the validation of the arguments is not complete. E.g.: #stackIntegerValue: may have already set the primitive to failed if the argument was not an integer. So, before continuing, that has to be checked.
Another possible but unlikely problem is that you assume that both result and coefficients have at least one field. But that may not be true which can result in segfaults.
Levente
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
--- Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Nope, this wasn't it.
--- Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
--- Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Hi Levente,
I hope you are having a great day! Are you in Budapest? That must be awesome! A very old city.
I thought I would post the Squeak code for this instantiatePoly primitive. My image still blows up on startUp:. I am grateful you have guided me through this!
primitiveInitializePolyFieldSizeCoefficients
<export: true> <var: 'coefficients' type: 'unsigned char*' >
| coefficients count coefficientsOop fieldSize result | interpreterProxy methodArgumentCount = 2 ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadNumArgs ]. fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. (interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. count := interpreterProxy stSizeOf: coefficientsOop. coefficients := interpreterProxy firstIndexableField: coefficientsOop.
(count = 0) ifTrue: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
result := self initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: count.
^ interpreterProxy failed ifTrue: [interpreterProxy primitiveFail] ifFalse: [interpreterProxy methodReturnValue: result].
Which is calling:
initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: coefficientsCount
<var: 'coefficients' type: #'unsigned char*'>
| coefficientsLength firstNonZero mutableCoefficients | mutableCoefficients := coefficients. coefficientsLength := coefficientsCount. ((coefficientsLength > 1) & ((coefficients at: 1) = 0)) ifTrue: [ firstNonZero := 2. [(firstNonZero <= coefficientsLength) and: [(mutableCoefficients at: firstNonZero) = 0]] whileTrue: [firstNonZero := firstNonZero + 1]. (firstNonZero > coefficientsLength) ifTrue: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: 1] ifFalse: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (coefficientsLength - firstNonZero + 1). 0 to: (coefficientsLength - 1) do: [:index | coefficients at: index put: (mutableCoefficients at: index)]]]. ^ mutableCoefficients.
--- Köszönöm, Robert
On 6/4/21 1:38 PM, Robert Withers wrote:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
>
>newField:coefficients:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
1.4% {317ms} RSFECGenericGFWithPlugin>>log:
I consolidated the RS Plugins into 1 RSPlugin class. Here is the new load script:
Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'; install: 'ProCryptoTests-1-1-1'; install: 'CryptographyRSPlugin'.
--- Kindly, Robert
On 6/4/21 2:51 PM, Robert Withers wrote:
Hi Levente,
I hope you are having a great day! Are you in Budapest? That must be awesome! A very old city.
I thought I would post the Squeak code for this instantiatePoly primitive. My image still blows up on startUp:. I am grateful you have guided me through this!
primitiveInitializePolyFieldSizeCoefficients
<export: true> <var: 'coefficients' type: 'unsigned char*' >
| coefficients count coefficientsOop fieldSize result | interpreterProxy methodArgumentCount = 2 ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadNumArgs ]. fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. (interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. count := interpreterProxy stSizeOf: coefficientsOop. coefficients := interpreterProxy firstIndexableField: coefficientsOop.
(count = 0) ifTrue: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
result := self initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: count.
^ interpreterProxy failed ifTrue: [interpreterProxy primitiveFail] ifFalse: [interpreterProxy methodReturnValue: result].
Which is calling:
initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: coefficientsCount
<var: 'coefficients' type: #'unsigned char*'>
| coefficientsLength firstNonZero mutableCoefficients | mutableCoefficients := coefficients. coefficientsLength := coefficientsCount. ((coefficientsLength > 1) & ((coefficients at: 1) = 0)) ifTrue: [ firstNonZero := 2. [(firstNonZero <= coefficientsLength) and: [(mutableCoefficients at: firstNonZero) = 0]] whileTrue: [firstNonZero := firstNonZero + 1]. (firstNonZero > coefficientsLength) ifTrue: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: 1] ifFalse: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (coefficientsLength - firstNonZero + 1). 0 to: (coefficientsLength - 1) do: [:index | coefficients at: index put: (mutableCoefficients at: index)]]]. ^ mutableCoefficients.
Köszönöm, Robert
On 6/4/21 1:38 PM, Robert Withers wrote:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
WITH GF & GFPOLY PRIMITIVES AND DECODER
PRIMITIVES
(
3
asterix
for
in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1%
{
6586
ms} RSFECDecoderWithPlugin>>decode:twoS:
14.7
% {
3329
ms} RSFECGenericGFPoly
class
>
>newField:coefficients:
1.0
% {
237
ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
7.3
% {
1646
ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize:
2.9
% {
654
ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations:
1.4
% {
317
ms} RSFECGenericGFWithPlugin>>
log
:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
> WITH GF & GFPOLY PRIMITIVES AND DECODER > > PRIMITIVES > > ( > > 3 > > asterix > > for > > in-progress plugganization) > > - 22194 tallies, 22648 msec. > > **Leaves** > 29.1% > > { > > 6586 > > ms} RSFECDecoderWithPlugin>>decode:twoS: > > 14.7 > > % { > > 3329 > > ms} RSFECGenericGFPoly > > class > >> > >>newField:coefficients: > > 7.3 > > % { > > 1646 > > ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: > > 2.9 > > % { > > 654 > > ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: > > 1.0 > > % { > > 237 > > ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods:
> 1.4% {317ms} RSFECGenericGFWithPlugin>>log:
A bit more detail on my refactoring. I combined the Plugins to 1 RSPlugin.
I updated the package: CryptographyRSPluginExtending to include all problematic primitives and their send sites. This includes GFPolyWithPlugin>>#initializeField:coefficients: and the ErasureOutputByteInputCodingLoopWithPlugin methods. To load this extension (which blows up the image by the way) run this compound script:
Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'; install: 'ProCryptoTests-1-1-1'; install: 'CryptographyRSPlugin'.
Installer ss project: 'Cryptography'; install: 'CryptographyRSPluginExtending'.
To unload and restore prior functionality, run this compound script:
Installer ss project: 'Cryptography'; unload: 'CryptographyRSPluginExtending'.
Installer ss project: 'Cryptography'; install: 'CryptographyRSErasure'; install: 'CryptographyRSFEC'; install: 'CryptographyRSPlugin'.
That is all.
--- Kindly, Robert
On 6/5/21 8:34 AM, Robert Withers wrote:
I consolidated the RS Plugins into 1 RSPlugin class. Here is the new load script:
Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'; install: 'ProCryptoTests-1-1-1'; install: 'CryptographyRSPlugin'.
Kindly, Robert
On 6/4/21 2:51 PM, Robert Withers wrote:
Hi Levente,
I hope you are having a great day! Are you in Budapest? That must be awesome! A very old city.
I thought I would post the Squeak code for this instantiatePoly primitive. My image still blows up on startUp:. I am grateful you have guided me through this!
primitiveInitializePolyFieldSizeCoefficients
<export: true> <var: 'coefficients' type: 'unsigned char*' >
| coefficients count coefficientsOop fieldSize result | interpreterProxy methodArgumentCount = 2 ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadNumArgs ]. fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. (interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. count := interpreterProxy stSizeOf: coefficientsOop. coefficients := interpreterProxy firstIndexableField: coefficientsOop.
(count = 0) ifTrue: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
result := self initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: count.
^ interpreterProxy failed ifTrue: [interpreterProxy primitiveFail] ifFalse: [interpreterProxy methodReturnValue: result].
Which is calling:
initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: coefficientsCount
<var: 'coefficients' type: #'unsigned char*'>
| coefficientsLength firstNonZero mutableCoefficients | mutableCoefficients := coefficients. coefficientsLength := coefficientsCount. ((coefficientsLength > 1) & ((coefficients at: 1) = 0)) ifTrue: [ firstNonZero := 2. [(firstNonZero <= coefficientsLength) and: [(mutableCoefficients at: firstNonZero) = 0]] whileTrue: [firstNonZero := firstNonZero + 1]. (firstNonZero > coefficientsLength) ifTrue: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: 1] ifFalse: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (coefficientsLength - firstNonZero + 1). 0 to: (coefficientsLength - 1) do: [:index | coefficients at: index put: (mutableCoefficients at: index)]]]. ^ mutableCoefficients.
Köszönöm, Robert
On 6/4/21 1:38 PM, Robert Withers wrote:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
>
Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it.
> WITH GF & GFPOLY PRIMITIVES AND DECODER > > PRIMITIVES > > ( > > 3 > > asterix > > for > > in-progress plugganization) > > - 22194 tallies, 22648 msec. > > **Leaves** > 29.1% > > { > > 6586 > > ms} RSFECDecoderWithPlugin>>decode:twoS: > > 14.7 > > % { > > 3329 > > ms} RSFECGenericGFPoly > > class > >> > >>newField:coefficients: > > 1.0 > > % { > > 237 > > ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees:
Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible:
> 7.3 > > % { > > 1646 > > ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: > > 2.9 > > % { > > 654 > > ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: > > 1.4 > > % { > > 317 > > ms} RSFECGenericGFWithPlugin>> > > log > > :
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
>> WITH GF & GFPOLY PRIMITIVES AND DECODER >> >> PRIMITIVES >> >> ( >> >> 3 >> >> asterix >> >> for >> >> in-progress plugganization) >> >> - 22194 tallies, 22648 msec. >> >> **Leaves** >> 29.1% >> >> { >> >> 6586 >> >> ms} RSFECDecoderWithPlugin>>decode:twoS: >> >> 14.7 >> >> % { >> >> 3329 >> >> ms} RSFECGenericGFPoly >> >> class >> >>> >> >>>newField:coefficients: >> >> 7.3 >> >> % { >> >> 1646 >> >> ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: >> >> 2.9 >> >> % { >> >> 654 >> >> ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: >> >> 1.0 >> >> % { >> >> 237 >> >> ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees: > > Calls to plugganized GF/GFPoly methods: > >> 1.4% {317ms} RSFECGenericGFWithPlugin>>log:
CryptographyRSPluginExtending-rww.7.mcz now has all 7 missing primitives, for the FECDecoder, the GFPoly and the GaloisCodingLoop. Here is a list.
- GaloisCodingLoopOutputByteInputExpCodingLoopWithPlugin>>#primCheckSomeShardsMatrixRows: matrixRows inputs: inputs toCheck: toCheck offset: offset byteCount: byteCount - GaloisCodingLoopOutputByteInputExpCodingLoopWithPlugin>>#primCodeSomeShardsMatrixRows: matrixRows inputs: inputs outputs: outputs offset: offset byteCount: byteCount - GaloisCodingLoopOutputByteInputExpCodingLoopWithPlugin>>#primComputeValueMatrixRow: matrixRow inputs: inputs inputIndex: inputIndex byteIndex: byteIndex value: value - FECGFPolyWithPlugin>>#primInitializePolyFieldSize: fieldSize coefficients: localCoefficients - FECGFPolyWithPlugin>>#primDividePolySelfCoefficients: coefficients otherCoefficients: otherCoefficients fieldSize: fieldSize - FECDecoderWithPlugin>>#primDecode: decoded twoS: twoS generatorBase: generatorBase - FECDecoderWithPlugin>>#primRunEuclideanAlgorithmPolyA: polyA polyB: polyB degrees: fieldSize
--- Kindly, Robert
On 6/5/21 9:50 AM, Robert Withers wrote:
A bit more detail on my refactoring. I combined the Plugins to 1 RSPlugin.
I updated the package: CryptographyRSPluginExtending to include all problematic primitives and their send sites. This includes GFPolyWithPlugin>>#initializeField:coefficients: and the ErasureOutputByteInputCodingLoopWithPlugin methods. To load this extension (which blows up the image by the way) run this compound script:
Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'; install: 'ProCryptoTests-1-1-1'; install: 'CryptographyRSPlugin'.
Installer ss project: 'Cryptography'; install: 'CryptographyRSPluginExtending'.
To unload and restore prior functionality, run this compound script:
Installer ss project: 'Cryptography'; unload: 'CryptographyRSPluginExtending'.
Installer ss project: 'Cryptography'; install: 'CryptographyRSErasure'; install: 'CryptographyRSFEC'; install: 'CryptographyRSPlugin'.
That is all.
Kindly, Robert
On 6/5/21 8:34 AM, Robert Withers wrote:
I consolidated the RS Plugins into 1 RSPlugin class. Here is the new load script:
Installer ss project: 'Cryptography'; install: 'ProCrypto-1-1-1'; install: 'ProCryptoTests-1-1-1'; install: 'CryptographyRSPlugin'.
Kindly, Robert
On 6/4/21 2:51 PM, Robert Withers wrote:
Hi Levente,
I hope you are having a great day! Are you in Budapest? That must be awesome! A very old city.
I thought I would post the Squeak code for this instantiatePoly primitive. My image still blows up on startUp:. I am grateful you have guided me through this!
primitiveInitializePolyFieldSizeCoefficients
<export: true> <var: 'coefficients' type: 'unsigned char*' >
| coefficients count coefficientsOop fieldSize result | interpreterProxy methodArgumentCount = 2 ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadNumArgs ]. fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. (interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. count := interpreterProxy stSizeOf: coefficientsOop. coefficients := interpreterProxy firstIndexableField: coefficientsOop.
(count = 0) ifTrue: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
result := self initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: count.
^ interpreterProxy failed ifTrue: [interpreterProxy primitiveFail] ifFalse: [interpreterProxy methodReturnValue: result].
Which is calling:
initializePolyFieldSize: fieldSize coefficients: coefficients coefficientsCount: coefficientsCount
<var: 'coefficients' type: #'unsigned char*'>
| coefficientsLength firstNonZero mutableCoefficients | mutableCoefficients := coefficients. coefficientsLength := coefficientsCount. ((coefficientsLength > 1) & ((coefficients at: 1) = 0)) ifTrue: [ firstNonZero := 2. [(firstNonZero <= coefficientsLength) and: [(mutableCoefficients at: firstNonZero) = 0]] whileTrue: [firstNonZero := firstNonZero + 1]. (firstNonZero > coefficientsLength) ifTrue: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: 1] ifFalse: [ mutableCoefficients := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (coefficientsLength - firstNonZero + 1). 0 to: (coefficientsLength - 1) do: [:index | coefficients at: index put: (mutableCoefficients at: index)]]]. ^ mutableCoefficients.
Köszönöm, Robert
On 6/4/21 1:38 PM, Robert Withers wrote:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote:
>> > > Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it. > >> WITH GF & GFPOLY PRIMITIVES AND DECODER >> >> PRIMITIVES >> >> ( >> >> 3 >> >> asterix >> >> for >> >> in-progress plugganization) >> >> - 22194 tallies, 22648 msec. >> >> **Leaves** >> 29.1% >> >> { >> >> 6586 >> >> ms} RSFECDecoderWithPlugin>>decode:twoS: >> >> 14.7 >> >> % { >> >> 3329 >> >> ms} RSFECGenericGFPoly >> >> class >> >>> >> >>>newField:coefficients: >> >> 1.0 >> >> % { >> >> 237 >> >> ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees: > > Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible: > >> 7.3 >> >> % { >> >> 1646 >> >> ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: >> >> 2.9 >> >> % { >> >> 654 >> >> ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: >> >> 1.4 >> >> % { >> >> 317 >> >> ms} RSFECGenericGFWithPlugin>> >> >> log >> >> : > > --- > Kindly, > Robert > > On 6/4/21 12:02 PM, Robert Withers wrote: > >>> WITH GF & GFPOLY PRIMITIVES AND DECODER >>> >>> PRIMITIVES >>> >>> ( >>> >>> 3 >>> >>> asterix >>> >>> for >>> >>> in-progress plugganization) >>> >>> - 22194 tallies, 22648 msec. >>> >>> **Leaves** >>> 29.1% >>> >>> { >>> >>> 6586 >>> >>> ms} RSFECDecoderWithPlugin>>decode:twoS: >>> >>> 14.7 >>> >>> % { >>> >>> 3329 >>> >>> ms} RSFECGenericGFPoly >>> >>> class >>> >>>> >>> >>>>newField:coefficients: >>> >>> 7.3 >>> >>> % { >>> >>> 1646 >>> >>> ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: >>> >>> 2.9 >>> >>> % { >>> >>> 654 >>> >>> ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: >>> >>> 1.0 >>> >>> % { >>> >>> 237 >>> >>> ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees: >> >> Calls to plugganized GF/GFPoly methods: >> >>> 1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Hi Robert,
_,,,^..^,,,_ (phone)
On Jun 4, 2021, at 11:52 AM, Robert Withers robert.withers@pm.me wrote:
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
Since you check for isBytes: below you can use stackValue:. isBytes: can safely be passed any object, including immediates. So the stackObjectValue: call implies a redundant validation.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
This is implicit. stackIntegerValue: fails if the object is not a SmallInteger (retiring zero) and otherwise answers its integerValue. So you should check if stackIntegerValue: fails since its return value will always answer true to isIntegerValue:
(interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
I would write
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
(interpreterProxy failed not and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
or
fieldSizeOop := interpreterProxy stackValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
((interpreterProxy isIntegerObject: fieldSizeOop) and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
fieldSize := interpreterProxy integerValueOf: fieldSizeOop.
Hi Eliot, I hope all is well with you!
I will try to make these changes, both in my working primitives and in my 7 broken primitives. See if that might help.
Grazie Mille!
Kindly, Robert . .. ... ‘...^,^
On Sat, Jun 5, 2021 at 19:39, Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Robert,
_,,,^..^,,,_ (phone)
On Jun 4, 2021, at 11:52 AM, Robert Withers robert.withers@pm.me wrote:
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
Since you check for isBytes: below you can use stackValue:. isBytes: can safely be passed any object, including immediates. So the stackObjectValue: call implies a redundant validation.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
This is implicit. stackIntegerValue: fails if the object is not a SmallInteger (retiring zero) and otherwise answers its integerValue. So you should check if stackIntegerValue: fails since its return value will always answer true to isIntegerValue:
(interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
I would write
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
(interpreterProxy failed not and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
or
fieldSizeOop := interpreterProxy stackValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
((interpreterProxy isIntegerObject: fieldSizeOop) and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
fieldSize := interpreterProxy integerValueOf: fieldSizeOop.
Alright, Eliot! I finally got the changes made. You know that time when you have 2 images and you do the work in one and forget, then delete that one and have to recode all those changes? Exactly.
Nonetheless, I got the changes made and did a test of creating a ByteArray in a primitive/computation method:
#fecAddOrSubtractPolySelfCoefficients:selfCount:otherCoefficients:otherCount:.
In my case, I decided to create the result ByteArray in the computation method and return the resultOop to the primitive for #methodReturnValue:. Here is the primitive, followed by the computation method. This seems to work as I compiled and tested it. One consideration is that if we are in a primitive and call another, like happens in the decode methods, then I must remember to #interpreterProxy firstIndexableField: resultOop to access the array again (pass as argument to yet another compute method, for instance). Is this the best approach?
resultOop := self fecAddOrSubtractPolySelfCoefficients: selfCoefficients selfCount: selfCount otherCoefficients: otherCoefficients otherCount: otherCount.
^ interpreterProxy failed ifTrue: [interpreterProxy primitiveFail] ifFalse: [interpreterProxy methodReturnValue: resultOop].
And the computation method
resultOop := interpreterProxy instantiateClass: interpreterProxy classByteArray indexableSize: (selfCount max: otherCount). result := interpreterProxy firstIndexableField: resultOop.
^ resultOop
--- Kindly, Robert
On 6/5/21 7:39 PM, Eliot Miranda wrote:
Hi Robert,
_,,,^..^,,,_ (phone)
On Jun 4, 2021, at 11:52 AM, Robert Withers [robert.withers@pm.me](mailto:robert.withers@pm.me) wrote:
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.
Since you check for isBytes: below you can use stackValue:. isBytes: can safely be passed any object, including immediates. So the stackObjectValue: call implies a redundant validation.
(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
This is implicit. stackIntegerValue: fails if the object is not a SmallInteger (retiring zero) and otherwise answers its integerValue. So you should check if stackIntegerValue: fails since its return value will always answer true to isIntegerValue:
(interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
I would write
fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
(interpreterProxy failed not and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].
or
fieldSizeOop := interpreterProxy stackValue: 1. coefficientsOop := interpreterProxy stackValue: 0.
((interpreterProxy isIntegerObject: fieldSizeOop) and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. fieldSize := interpreterProxy integerValueOf: fieldSizeOop.
Hi Robert,
On Jun 4, 2021, at 10:38 AM, Robert Withers robert.withers@pm.me wrote:
I am getting this warning when cross compiling the Squeak plugin to C code.
warning, signature of InterpreterProxy>>instantiateClass:indexableSize: does not match reference implementation.
Alas this is difficult to fix. But it is safe to ignore this warningz
Kindly, Robert
On 6/4/21 1:21 PM, Robert Withers wrote:
Nope, this wasn't it.
Kindly, Robert
On 6/4/21 12:36 PM, Robert wrote:
Oh! Heading for a coffee with my nurse. I realized I may be passing the field into the primitive instead of the field size. I’ll check it when I get back home!
Kindly, Robert . .. ... ‘...^,^
On Fri, Jun 4, 2021 at 12:12, Robert Withers robert.withers@pm.me wrote: Oh! I forgot to relocate leaves that have already been plugganized. This leaves (heh) 3 possible plugganizations that all instantiate ByteArrays. Here, I fixed it. WITH GF & GFPOLY PRIMITIVES AND DECODER PRIMITIVES (3 asterix for in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1% {6586ms} RSFECDecoderWithPlugin>>decode:twoS: 14.7% {3329ms} RSFECGenericGFPoly class>>newField:coefficients: 1.0% {237ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees: Calls to plugganized GF/GFPoly methods, so I think these are as optimized as possible: 7.3% {1646ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: 2.9% {654ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: 1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Kindly, Robert
On 6/4/21 12:02 PM, Robert Withers wrote:
WITH GF & GFPOLY PRIMITIVES AND DECODER PRIMITIVES (3 asterix for in-progress plugganization)
- 22194 tallies, 22648 msec.
**Leaves** 29.1% {6586ms} RSFECDecoderWithPlugin>>decode:twoS: 14.7% {3329ms} RSFECGenericGFPoly class>>newField:coefficients: 7.3% {1646ms} RSFECDecoderWithPlugin>>primFindErrorLocationsDegree:coefficients:result:fieldSize: 2.9% {654ms} RSFECDecoderWithPlugin>>findErrorMagnitudes:errorLocations: 1.0% {237ms} RSFECDecoderWithPlugin>>runEuclideanAlgorithmPoly:poly:rDegrees: Calls to plugganized GF/GFPoly methods: 1.4% {317ms} RSFECGenericGFWithPlugin>>log:
Eliot _,,,^..^,,,_ (phone)
vm-dev@lists.squeakfoundation.org