Section 1: Intro to Labs 0 + 1
CSE 452 Spring 2024
Announcements
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
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 with design docs [in hours]
(fairly rough) statistics from Winter 2023
Lab | Mean Total (Union) | Std. dev. Total (Union) | Median Total (Union) |
Lab 2 (Spring 2021) | 32.94 (28.09) | 15.98 (14.17) | 30 (25) |
Lab 2 (Winter 2023)
| 26.54
| 10.29
| 25
|
*Design docs were due a week before the lab submission.
Doing the design doc in advance of lab 2 saved on average ~6.5 hours of work! Qualitative feedback on design doc usefulness was also very positive.
This quarter, we streamlined the design docs to save student time and still provide the same benefit.
Lab Framework Introduction
Framework
Node
Idempotency and Determinism
Determinism: Outcome is only a function of state and message/timer handlers
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
Types of Nodes:
Client
Types of Nodes:
Server
Application
Message
Timer
Synchronize
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
Lab 0 Tour + Testing
Lab 0 Demo!
run-tests.py
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 --replay-traces [TRACE_NAME...]
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) |
Lab 1
Recommendations/General Notes
RPC - Remote Procedure Call
When a computer program causes �a procedure to execute in a different�address space (perhaps on another�computer)
RPC Semantics
Application vs. AMOApplication (Lab 1)
Wrapper around original Application
Makes sure requests executed At Most Once
Lab 1 suggestions
Lab 1 suggestions (continued)
Good Practice for Timers
…
set(t, RETRY_MILLIS);
}
Gentle Reminders
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)
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
Tour of the Visualization Tool
./run-tests.py --lab 0 --debug 1 1 "hi,bye"
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-24sp/dslabs/dslabs-handout.git
Do this to pull:
git fetch upstream�git merge upstream/main