Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack use improvements (towards nanox execution) #23

Merged
merged 2 commits into from
Mar 22, 2023
Merged

Conversation

ryankurte
Copy link
Contributor

@ryankurte ryankurte commented Mar 13, 2023

attempting to fix the app execution on the nanox (no luck so far)

further improvements to stack frame sizes in the hope that the less efficient ISA caused a recurrence of the 8kb of stack issue, blocking inlining of large functions in the same stack frame and swapping to per-field init of large objects. this doesn't appear to have helped.

testing targets for nanosplus/nanox devices to try and isolate the error from the ISA

  • build for nanox with thumbv7m-none-eabi target (adds DIV and MOD instructions), this runs correctly in simulator, @yhql tested this still appears to fail on device
  • tested compiling for nanosplus with thumbv7m-none-eabi and thumbv6m-none-eabi targets, both run fine on the physical nanosplus and simulator, suggesting the issue is specific to the nanox OS / hardware

stack frames before:

 ADDR        SIZE   STACK  NAME                                                          
 0xc0df9a89  132    3488   Function::clear                                               
 0xc0df6559  420    3264   <impl Mul<&RistrettoPoint> for &Scalar>::mul                  
 0xc0de60ad  16436  3192   sample_main                                                   
 0xc0de00d9  4428   3160   Engine<DRV,RNG>::ring_update                                  
 0xc0de14a1  5172   2344   Engine<DRV,RNG>::tx_summary_update                            
 0xc0de3df5  492    2168   Engine<DRV,RNG>::ring_init                                    
 0xc0de2935  5312   1608   Engine<DRV,RNG>::update                                       
 0xc0dfb8f9  904    1176   mc_transaction_types::masked_amount::v2::get_blinding_factors 
 0xc0dfa2a9  768    1176   Hkdf<H,I>::new    

stack frames after:

 0xc0deebe5  348   3264   <impl Mul<&RistrettoPoint> for &Scalar>::mul                  
 0xc0df30a5  1140  1944   RingSigner::ring_update                                       
 0xc0de1c31  2320  1448   Summarizer<_>::add_output_unblinding                          
 0xc0de0419  4120  1416   Engine<DRV,RNG>::update                                       
 0xc0de18c1  612   1328   RingSigner::ring_init                                         
 0xc0df51ed  700   1152   mc_transaction_types::masked_amount::v2::get_blinding_factors 
 0xc0df3c49  588   1152   Hkdf<H,I>::new                                                
 0xc0de2541  712   1152   Summarizer<_>::finalize                                       
 0xc0df17b5  4464  1112   Event::parse                                                  
 0xc0de1431  464   1112   Engine<DRV,RNG>::memo_sign 

@ryankurte
Copy link
Contributor Author

ryankurte commented Mar 13, 2023

Base automatically changed from chore/update-mob-branch to main March 15, 2023 20:03
@ryankurte ryankurte self-assigned this Mar 15, 2023
@ryankurte ryankurte marked this pull request as ready for review March 21, 2023 20:26
@ryankurte ryankurte requested a review from a team as a code owner March 21, 2023 20:26
@ryankurte
Copy link
Contributor Author

ryankurte commented Mar 21, 2023

not working on the nanox yet but tested on the nanosplus / may as well land these improvements to stack allocation to avoid slip against main

@ryankurte ryankurte changed the title WIP: fixes for nanox execution stack use improvements (towards nanox execution) Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants