Skip to content

Conversation

@qimcis
Copy link
Collaborator

@qimcis qimcis commented Jan 18, 2026

Description

Add CS350 Spring 2013 Midterm exam assets and metadata to the course exam benchmark.

Changes

  • Added exam directory /home/qi/system-intelligence-benchmark/benchmarks/courseexam_bench/data/raw/cs350_spring_2013_midterm
  • Added solutions file S13-midterm-sol.pdf to the exam directory
  • Registered exam ID cs350_spring_2013_midterm and updated repository metadata

Testing

Prepared the dataset and validated ingestion by running: python3 courseexam/prepare.py

Checklist

  • Tests pass locally
  • Code follows project style guidelines
  • Documentation updated (if needed)

Copy link
Collaborator

@777lefty 777lefty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another concern: the exam seems to be dependent on OS/161, do we need to provide link to its codebase as supporting materials?


(d) Give one advantage and one disadvantage of having a software design with high lock granularity (many locks).

(e) Briefly explain what this line of code is doing and why: tf->tf_v0 = retval; in a MIPS syscall handler context.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better?

VPAGE bits 44-63
PFRAME bits 12-31
DIRTY bit 10
VALID bit 9
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better

flag[tid] = 1;
while (turn != tid && flag[1 - tid]) { }
/* critical section */
flag[tid] = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code block here better


(a) [4 Marks] Give a proof as to why resource ordering can prevent deadlocks. It can be informal, but it should be sound. You are not required to reference the deadlock detection algorithm, but you may reference it if you choose.

(b) [4 Marks] Here is Peterson’s algorithm as presented in class. Your friend has implemented Peterson’s algorithm for OS/161 as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peterson's algorithm is not provided?


## Question 4 [7 point(s)]

(a) [2 Marks] Concisely explain how in your A1 cat/mouse solution the decision was made to switch from allowing one animal to eat (i.e., cats) to the other animal eating (i.e., mice). If you did not complete assignment 1, describe the naïve solution discussed in class.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this problem is assignment-dependent, can we add it or not?


(a) [2 Marks] Concisely explain how in your A1 cat/mouse solution the decision was made to switch from allowing one animal to eat (i.e., cats) to the other animal eating (i.e., mice). If you did not complete assignment 1, describe the naïve solution discussed in class.

(b) [1 Mark] Given the above specifications and that (c >> b) and (m >> b), describe any circumstances under which your solution described in (a) would achieve its maximum efficiency, and then calculate that efficiency as a formula using the variables c, m, b and t as necessary.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specifications above is not provided

"answer": "(a) The decision was based on a policy that allows a bounded number of consecutive eaters of one species before switching to the other to prevent starvation and improve throughput; the naive solution would let one species eat indefinitely, which can starve the other. (b) Maximum efficiency occurs when bowl turnover and scheduling produce no idle time between eaters; with c >> b and m >> b and negligible switching overhead, efficiency approaches 1 (i.e., bowls almost always in use). The precise formula depends on how many bowls are used in parallel and the switching overhead; in the ideal alternating steady state efficiency = useful eating time / total time. (c) For each scenario compute efficiency and max wait times based on k, b, t, c, m and the scheduling described. (Full numeric answers depend on following the outlined calculation for each scenario.)",
"llm_judge_instructions": "(a) 2 pts: award 1 pt for describing the switching decision mechanism and 1 pt for justification (preventing starvation/improving throughput). (b) 1 pt: award for identifying circumstances and deriving a correct formula or clear expression. (c) 4 pts total: 1 point per scenario. For each scenario, award the 1 point if the student provides the correct efficiency and both correct maximum wait times; award 0.5 if some but not all of those three values are correct with clear reasoning. Provide brief annotations for partial credit. Total = 7 points."
}
``` No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more feasible problems skipped?

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