![arch](https://private-user-images.githubusercontent.com/40686366/332797033-0e600853-c2d2-44dc-83cb-4a6904f63019.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODczNDEsIm5iZiI6MTcyNTg4NzA0MSwicGF0aCI6Ii80MDY4NjM2Ni8zMzI3OTcwMzMtMGU2MDA4NTMtYzJkMi00NGRjLTgzY2ItNGE2OTA0ZjYzMDE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDEzMDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUxMzM3NWIzOWU3MzliMDBiNThjMTMxYzJlZmUyN2Y3ODYxYjljOGVhMTE1ZjhkZWY3YmRlZTUxNWJiZTRjYjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nyJnSsFVh9cYwUJ3ynSeFyapPkWbkFWeeMOUvHqrgpc)
wamrc --opt-level=3 --threshold-bits=16 --disable-aux-stack-check --enable-counter-loop-checkpoint -o bc.aot bench/bc.aot
./MVVM_checkpoint -t bench/bc.aot -a -g20,-n1000
./MVVM_restore -t bench/bc.aot
Policy for wamrc
- counter loop checkpoint
--enable-counter-loop-checkpoint
- loop threshold for 1 << x per checkpoint
- loop checkpoint
--enable-loop-checkpoint
, meaning without the counter to checkpoint - loop dirty checkpoint
--enable-loop-dirty-checkpoint
, meaning use the dirty bit to checkpoint --enable-checkpoint
, enable function level checkpoint
First comment out the following in checkpoint.cpp
wamr->get_int3_addr();
wamr->replace_int3_with_nop();
wamr->replace_mfence_with_nop();
Then
python3 ../artifact/common_util.py # return $recv is 193
SPDLOG_LEVEL=debug ./MVVM_checkpoint -t test/tcp_client.aot -f 193 -c 0 -x 10 -a "10" -e OMP_NUM_THREADS=1 -i
SPDLOG_LEVEL=debug ./MVVM_restore -t test/tcp_client.aot # All the wasi env will be restored
- -t Target: The path to the WASM interpreter or AOT executable
- -i Debug Mode: Switch on for debugging
- -f Function: The function to stop and checkpoint
- -x Function Counter: The WASM function counter to stop and checkpoint
- -c Counter: The WASM instruction counter to stop and checkpoint(Conflict with -f and -x)
- -a Arguments: The arguments to the function
- -e Environment: The environment variables to the function
![image](https://private-user-images.githubusercontent.com/40686366/332798338-e10dba2b-51f2-4373-a119-0b53f7622407.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODczNDEsIm5iZiI6MTcyNTg4NzA0MSwicGF0aCI6Ii80MDY4NjM2Ni8zMzI3OTgzMzgtZTEwZGJhMmItNTFmMi00MzczLWExMTktMGI1M2Y3NjIyNDA3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDEzMDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjNDM3NjdiNDZhOWI5MDIwYmFmNjgwMTFlYTkwYjQxOTRiMDhjMWE4MzBhZmJkY2I5ZDUzYzkxYjEyN2QyYmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zWIYvXnDK89oC3aIqB-rhxcZ3ngXrzJZ3MQcxd-CT98)
- All the pointers will be stored as offset to the linear memory.
- Go forward and never go back, all the calling into WASI land will row back to the call on recovery.
- Use AOT compiler convention with a stable point to achieve cross-platform.
![image](https://private-user-images.githubusercontent.com/40686366/332797296-ab5fb538-82e7-4a62-9516-d29052670c38.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODczNDEsIm5iZiI6MTcyNTg4NzA0MSwicGF0aCI6Ii80MDY4NjM2Ni8zMzI3OTcyOTYtYWI1ZmI1MzgtODJlNy00YTYyLTk1MTYtZDI5MDUyNjcwYzM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDEzMDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU0ZWM4MThjZDA0ZjE5NWYwOTNjZGI1Y2ZiMmEyNDViZDJhMGQ4MWY4Y2ZlYTJiOWMwZjc4MjAwOGIxYTEwZGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zy1kiv8Fck5QJEyQFaWNh8mVYr4Idla1xCi98Xz9S6w)
![image](https://private-user-images.githubusercontent.com/40686366/332797382-1f3dc51d-75ee-44cb-ae89-288157d8f498.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODczNDEsIm5iZiI6MTcyNTg4NzA0MSwicGF0aCI6Ii80MDY4NjM2Ni8zMzI3OTczODItMWYzZGM1MWQtNzVlZS00NGNiLWFlODktMjg4MTU3ZDhmNDk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDEzMDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYzMjNkOWUzNTBkMTY2NGRjZTdiOGUyN2M0MjQxYmIzYTFkZWZmNGQyYWViZjQ3ZGE0NDk2NmM2ZTY5OTYzZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YIynzmhZs15oliqsjqwNkrwgv994PQzs-vt8WQtYMe0)
- Cloud Edge integration
- Optimistic Computing
- FAASM Warm start
![image](https://private-user-images.githubusercontent.com/40686366/332798599-aa9a9291-cf2c-4703-ab73-be2934a613fd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU4ODczNDEsIm5iZiI6MTcyNTg4NzA0MSwicGF0aCI6Ii80MDY4NjM2Ni8zMzI3OTg1OTktYWE5YTkyOTEtY2YyYy00NzAzLWFiNzMtYmUyOTM0YTYxM2ZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA5VDEzMDQwMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA3NzQwNGFkODFmNWNlY2ZkNjY4YzkxNzFmOGUyZDFlNjA0MThlNjFiYWY2MDFmMmQxY2EyNzdlN2RmNjA3NmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qqhEFOIyhmS9SePlplqAXlaJ-p7UHqwEFRrV4Ww-LGU)