Section 1: Intro to Labs 0 + 1
CSE 452 Winter 2023
Acknowledgements
These dslab slides were developed as a collaborative effort among the TA’s for UW CSE 452/552 over a period of several years. We thank all who contributed.
Adnan Ahmad, Nick Anderson, Anirban (Anir) Biswas, Anirudh Canumalla, Riley Chang, Tianyi Cui, Colin Evans, Yael Goldin, Divye Jain, Kushal Jhunjhunwalla, Justin Johnson, Sarang Joshi, Lukas Joswiak, Arthur Liang, Jiuru Li, Boyan Li, CJ Lin, Wei Lin, Travis McGaha, Ellis Michael, Samantha Miller, David Porter, Raden (Roy) Pradana, Guramrit Singh, Luxi Wang, Andrew Wei, Zachariah Wolfe, Doug Woos, Lanhao Wu, Yuchong (Yvonna) Xiang, Shibin (Jack) Xu, Paul Yau, Dao Yi, Michael Yu, Sarah Yu, Aileen Zeng, Kaiyuan Zhang, Leiyi Zhang, Eddy Zhou
Announcements
Time for labs [in hours]
(fairly rough) statistics from Spring 2021
Lab | Mean Total (Union) | Std. dev. Total (Union) | Median Total (Union) |
Lab 1 | 7.438 | 3.336 | 7.0 |
Lab 2 | 32.94 (28.09) | 15.98 (14.17) | 30 (25) |
Lab 3 | 53.57 (37.96) | 30.48 (24.76) | 49 (32) |
Lab 4* | 37.24 (30.62) | 21.78 (18.54) | 30 (27) |
Please report times as a single number (float or int) after the colon. Stats are self-reported, math is hard sometimes and people flipped unions and totals or had unions greater than their total time?
*= some people only did up to part 2
Time for labs [in hours]�(very rough) statistics from Winter 2021
Lab | Mean | Std. dev. | Median |
Lab 1 | 8.90 | 4.35 | 8 |
Lab 2 | 32.29 | 18.29 | 30 |
Lab 3 | 66.19 | 40.47 | 60 |
Lab 4* | 46.59 | 29.76 | 40 |
Note: Putting a single number at the end of the WRITEUP.txt makes it easier to collect accurate statistics. It’s hard to have accurate statistics if people aren’t consistent with reporting them. Just put a combined time at the end if possible (a union of the time spent would be ideal).
Most people combined the time that they spent working together or people listed their times separately even though they spent the time working together, so the lows and highs are generally /2 or *2 approximations.
(group)
(group)
(group)
Conclusion: This class takes time. Most of it goes into debugging, so write code precisely and carefully. Time for labs vary depending on which bugs you run into.
Also take breaks as necessary to avoid burnout.
Labs (in terms of difficulty from what students have told us in the past)
Difficulty
Lab 1
Lab 2
Lab 3
Lab 4 p1
Lab 4 p2
Lab 4 p3
Recommendations/General Notes
Framework
Node
Read the documentation!
Client/Server
Application
Message
Timer
Synchronize
public synchronized Result getResult();
Wait & Notify
while (!checkCondition()) wait();
Lombok
If you use Intellij, install the Lombok Plugin: https://projectlombok.org/setup/intellij
It’s really just for Boilerplate
run-tests.py
Submitting Solutions
Submit design document separately in gradescope (one per group)
For later labs, design doc due week before lab, but ok to update
Do make submit.tar.gz and submit the tar file to Gradescope (one per group)
Keep an eye out for the partner form next week!
To run the visualizer remotely on attu or CSE lab computer
Linux has a XWindow client installed, then you need a X11 server to get what the client says. (contributor: Michael W. 🦊):
MacOS: https://www.macworld.com/article/1134207/leopardx11.html
Linux: https://www.addictivetips.com/ubuntu-linux-tips/set-up-x11-forwarding-on-linux/
Once X11 server is set up and you are running the search tests with the visualizer on the lab computer, you can ssh into the lab computer and run with �$ google-chrome &�To open up a browser and you should be able to connect to localhost:3000 or something
PuTTy settings if you choose to use PuTTy
It’s kinda slow though. Usually better to run it on your own computer or in person in the lab
Type of Tests
Regular (Run)
Search
Common run commands
Running a single test
Running multiple tests
Common run commands
Running with Logging [prints out message receives/timer handles]
Running with Logging [prints out message sends & receives/timer sets and handles]
Running with Logging and writing to a file (Don’t do this for search tests)
Common run commands -- [SEARCH] tests
Open up the visualizer on a non-search test with a custom workload
Open up the visualizer on a failed search test �[ONLY STARTS VISUALIZER FOR FAILED SEARCH] �(You’ll want to click “Debug system with trace”)
Equals and Hashcode/Idempotency checks (really stupid reasons for failing search tests)
Note: --checks doesn’t work on run tests.
Saving SEARCH test traces
./run-tests.py -l LAB_NUM -n SEARCH_TEST_NUM --save-trace
./run-tests.py --check-trace
Tour of the Visualization Tool
./run-tests.py --lab 0 --debug 1 1 "hi,bye"
RPC - Remote Procedure Call
When a computer program causes �a procedure to execute in a different�address space (perhaps on another�computer)
RPC Semantics
Idempotency and Determinism
Idempotent: When a unique message comes, the actions (e.g. changing state or creating timers) taken by it are only applied once and won’t be applied again for duplicate messages
Determinism: Outcome is only a function of state and message/timer handlers
Pulling Updates
Updates will be distributed via git (do it now plz).
Do this once at the start of the quarter:
git remote add upstream git@gitlab.cs.washington.edu:cse452-23wi/dslabs/dslabs-handout.git
Do this to pull:
git fetch upstream�git merge upstream/main
Lab 1 help/hints
Lab 1 more help/hints
General Lab Debugging
| Run | Search |
Invariant Violations | -g FINER &> log.txt → might need to print out multiple runs if issue does not appear every time | Visual Debugger → retrace steps that led to the invariant violation |
Liveness Violation or Timeout | -g FINER &> log.txt → look for patterns in log file | Visual Debugger → try to drive system towards goal (under the constraints of the test) |