codeneedle benchmark results

#33
by akierum - opened

ziskind code needle results:

qwen3.8bench

K:\codeneedle\codeneedle>venv\Scripts\activate.bat

(venv) K:\codeneedle\codeneedle>python bench.py run --corpus http_server --model Qwen3.8-27B-noMTP-Q8 --base-url http://localhost:8080
(no model config 'Qwen3.8-27B-noMTP-Q8' found; using as raw model identifier with defaults)
Source: http_server.py (49,924 chars, 1,354 lines, 1 file(s))
Extracted 11 named functions with β‰₯20 body lines
Selected 11 target function(s):

  • _url_collapse_path line 924 body_lines=44 (http_server.py)
  • parse_request line 273 body_lines=115 (http_server.py)
  • handle_one_request line 408 body_lines=35 (http_server.py)
  • send_error line 453 body_lines=51 (http_server.py)
  • log_message line 588 body_lines=24 (http_server.py)
  • send_head line 702 body_lines=86 (http_server.py)
  • list_directory line 790 body_lines=58 (http_server.py)
  • translate_path line 850 body_lines=28 (http_server.py)
  • guess_type line 896 body_lines=23 (http_server.py)
  • is_cgi line 1039 body_lines=23 (http_server.py)
  • run_cgi line 1076 body_lines=195 (http_server.py)

Pre-flight: probing context fit with a 50,553-char prompt (max_tokens=1)...
Pre-flight OK.

[1/11] _url_collapse_path β€” prompt 50,553 chars, waiting on model...
response: 771 chars in 21.4s

=== _url_collapse_path [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """←[0m
←[37m Given a URL path, remove extra '/'s and '.' path elements and collapse←[0m
←[37m any '..' references and returns a collapsed path.←[0m
←[37m←[0m
←[37m Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.←[0m
←[37m The utility of this function is limited to is_cgi method and helps←[0m
←[37m preventing some security attacks.←[0m
←[37m←[0m
←[37m Returns: The reconstituted URL, which will always start with a '/'.←[0m
←[37m←[0m
←[37m Raises: IndexError if too many '..' occur within the path.←[0m
←[37m←[0m
←[37m """←[0m
←[37m # Query component should not be involved.←[0m
←[37m path, _, query = path.partition('?')←[0m
←[37m path = urllib.parse.unquote(path)←[0m
←[37m←[0m
←[37m # Similar to os.path.split(os.path.normpath(path)) but specific to URL←[0m
←[37m # path semantics rather than local operating system semantics.←[0m
←[37m path_parts = path.split('/')←[0m

[2/11] parse_request β€” prompt 50,538 chars, waiting on model...
response: 786 chars in 41.9s

=== parse_request [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Parse a request (internal).←[0m
←[37m←[0m
←[37m The request should be stored in self.raw_requestline; the results←[0m
←[37m are in self.command, self.path, self.request_version and←[0m
←[37m self.headers.←[0m
←[37m←[0m
←[37m Return True for success, False for failure; on failure, any relevant←[0m
←[37m error response has already been sent back.←[0m
←[37m←[0m
←[37m """←[0m
←[37m is_http_0_9 = False←[0m
←[37m self.command = None # set in case of error on the first line←[0m
←[37m self.request_version = version = self.default_request_version←[0m
←[37m self.close_connection = True←[0m
←[37m requestline = str(self.raw_requestline, 'iso-8859-1')←[0m
←[37m requestline = requestline.rstrip('\r\n')←[0m
←[37m self.requestline = requestline←[0m
←[37m words = requestline.split()←[0m
←[37m if len(words) == 0:←[0m
←[37m return False←[0m

[3/11] handle_one_request β€” prompt 50,553 chars, waiting on model...
response: 768 chars in 31.4s

=== handle_one_request [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Handle a single HTTP request.←[0m
←[37m←[0m
←[37m You normally don't need to override this method; see the class←[0m
←[37m doc string for information on how to handle specific HTTP←[0m
←[37m commands such as GET and POST.←[0m
←[37m←[0m
←[37m """←[0m
←[37m try:←[0m
←[37m self.raw_requestline = self.rfile.readline(65537)←[0m
←[37m if len(self.raw_requestline) > 65536:←[0m
←[37m self.requestline = ''←[0m
←[37m self.request_version = ''←[0m
←[37m self.command = ''←[0m
←[37m self.send_error(HTTPStatus.REQUEST_URI_TOO_LONG)←[0m
←[37m return←[0m
←[37m if not self.raw_requestline:←[0m
←[37m self.close_connection = True←[0m
←[37m return←[0m
←[37m if not self.parse_request():←[0m
←[37m # An error code has been sent, just exit←[0m

[4/11] send_error β€” prompt 50,529 chars, waiting on model...
response: 725 chars in 55.8s

=== send_error [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Send and log an error reply.←[0m
←[37m←[0m
←[37m Arguments are←[0m
←[37m * code: an HTTP error code←[0m
←[37m 3 digits←[0m
←[37m * message: a simple optional 1 line reason phrase.←[0m
←[37m *( HTAB / SP / VCHAR / %x80-FF )←[0m
←[37m defaults to short entry matching the response code←[0m
←[37m * explain: a detailed message defaults to the long entry←[0m
←[37m matching the response code.←[0m
←[37m←[0m
←[37m This sends an error response (so it must be called before any←[0m
←[37m output has been generated), logs the error, and finally sends←[0m
←[37m a piece of HTML explaining the error to the user.←[0m
←[37m←[0m
←[37m """←[0m
←[37m←[0m
←[37m try:←[0m
←[37m shortmsg, longmsg = self.responses[code]←[0m
←[37m except KeyError:←[0m

[5/11] log_message β€” prompt 50,532 chars, waiting on model...
response: 649 chars in 18.5s

=== log_message [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Log an arbitrary message.←[0m
←[37m←[0m
←[37m This is used by all other logging functions. Override←[0m
←[37m it if you have specific logging wishes.←[0m
←[37m←[0m
←[37m The first argument, FORMAT, is a format string for the←[0m
←[37m message to be logged. If the format string contains←[0m
←[37m any % escapes requiring parameters, they should be←[0m
←[37m specified as subsequent arguments (it's just like←[0m
←[37m printf!).←[0m
←[37m←[0m
←[37m The client ip and current date/time are prefixed to←[0m
←[37m every message.←[0m
←[37m←[0m
←[37m Unicode control characters are replaced with escaped hex←[0m
←[37m before writing the output to stderr.←[0m
←[37m←[0m
←[37m """←[0m
←[37m←[0m
←[37m message = format % args←[0m

[6/11] send_head β€” prompt 50,526 chars, waiting on model...
response: 905 chars in 77.5s

=== send_head [←[32mPASS←[0m] matched=19/20 hallucinated=0 bonus=1 ===
-- model output --
←[37m """Common code for GET and HEAD commands.←[0m
←[37m←[0m
←[37m This sends the response code and MIME headers.←[0m
←[37m←[0m
←[37m Return value is either a file object (which has to be copied←[0m
←[37m to the outputfile by the caller unless the command was HEAD,←[0m
←[37m and must be closed by the caller under all circumstances), or←[0m
←[37m None, in which case the caller has nothing further to do.←[0m
←[37m←[0m
←[37m """←[0m
←[37m path = self.translate_path(self.path)←[0m
←[37m f = None←[0m
←[37m if os.path.isdir(path):←[0m
←[37m parts = urllib.parse.urlsplit(self.path)←[0m
←[37m if not parts.path.endswith(('/', '%2f', '%2F')):←[0m
←[37m # redirect browser - doing basically what apache does←[0m
←[37m self.send_response(HTTPStatus.MOVED_PERMANENTLY)←[0m
←[37m new_parts = (parts[0], parts[1], parts[2] + '/',←[0m
←[37m parts[3], parts[4])←[0m
←[36m self.send_header("Location", new_url)←[0m
-- missing expected lines --
←[38;5;208m new_url = urllib.parse.urlunsplit(new_parts)←[0m

[7/11] list_directory β€” prompt 50,541 chars, waiting on model...
response: 685 chars in 29.1s

=== list_directory [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Helper to produce a directory listing (absent index.html).←[0m
←[37m←[0m
←[37m Return value is either a file object, or None (indicating an←[0m
←[37m error). In either case, the headers are sent, making the←[0m
←[37m interface the same as for send_head().←[0m
←[37m←[0m
←[37m """←[0m
←[37m try:←[0m
←[37m list = os.listdir(path)←[0m
←[37m except OSError:←[0m
←[37m self.send_error(←[0m
←[37m HTTPStatus.NOT_FOUND,←[0m
←[37m "No permission to list directory")←[0m
←[37m return None←[0m
←[37m list.sort(key=lambda a: a.lower())←[0m
←[37m r = []←[0m
←[37m displaypath = self.path←[0m
←[37m displaypath = displaypath.split('#', 1)[0]←[0m
←[37m displaypath = displaypath.split('?', 1)[0]←[0m
←[37m try:←[0m

[8/11] translate_path β€” prompt 50,541 chars, waiting on model...
response: 778 chars in 27.0s

=== translate_path [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Translate a /-separated PATH to the local filename syntax.←[0m
←[37m←[0m
←[37m Components that mean special things to the local file system←[0m
←[37m (e.g. drive or directory names) are ignored. (XXX They should←[0m
←[37m probably be diagnosed.)←[0m
←[37m←[0m
←[37m """←[0m
←[37m # abandon query parameters←[0m
←[37m path = path.split('#', 1)[0]←[0m
←[37m path = path.split('?', 1)[0]←[0m
←[37m # Don't forget explicit trailing slash when normalizing. Issue17324←[0m
←[37m try:←[0m
←[37m path = urllib.parse.unquote(path, errors='surrogatepass')←[0m
←[37m except UnicodeDecodeError:←[0m
←[37m path = urllib.parse.unquote(path)←[0m
←[37m trailing_slash = path.endswith('/')←[0m
←[37m path = posixpath.normpath(path)←[0m
←[37m words = path.split('/')←[0m
←[37m words = filter(None, words)←[0m
←[37m path = self.directory←[0m
-- missing expected lines --
←[38;5;208m """Translate a /-separated PATH to the local filename syntax.←[0m

[9/11] guess_type β€” prompt 50,529 chars, waiting on model...
response: 745 chars in 28.5s

=== guess_type [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Guess the type of a file.←[0m
←[37m←[0m
←[37m Argument is a PATH (a filename).←[0m
←[37m←[0m
←[37m Return value is a string of the form type/subtype,←[0m
←[37m usable for a MIME Content-type header.←[0m
←[37m←[0m
←[37m The default implementation looks the file's extension←[0m
←[37m up in the table self.extensions_map, using application/octet-stream←[0m
←[37m as a default; however it would be permissible (if←[0m
←[37m slow) to look inside the data to make a better guess.←[0m
←[37m←[0m
←[37m """←[0m
←[37m base, ext = posixpath.splitext(path)←[0m
←[37m if ext in self.extensions_map:←[0m
←[37m return self.extensions_map[ext]←[0m
←[37m ext = ext.lower()←[0m
←[37m if ext in self.extensions_map:←[0m
←[37m return self.extensions_map[ext]←[0m
←[37m guess, _ = mimetypes.guess_file_type(path)←[0m

[10/11] is_cgi β€” prompt 50,517 chars, waiting on model...
response: 922 chars in 44.5s

=== is_cgi [←[32mPASS←[0m] matched=20/20 hallucinated=0 bonus=0 ===
-- model output --
←[37m """Test whether self.path corresponds to a CGI script.←[0m
←[37m←[0m
←[37m Returns True and updates the cgi_info attribute to the tuple←[0m
←[37m (dir, rest) if self.path requires running a CGI script.←[0m
←[37m Returns False otherwise.←[0m
←[37m←[0m
←[37m If any exception is raised, the caller should assume that←[0m
←[37m self.path was rejected as invalid and act accordingly.←[0m
←[37m←[0m
←[37m The default implementation tests whether the normalized url←[0m
←[37m path begins with one of the strings in self.cgi_directories←[0m
←[37m (and the next character is a '/' or the end of the string).←[0m
←[37m←[0m
←[37m """←[0m
←[37m collapsed_path = _url_collapse_path(self.path)←[0m
←[37m dir_sep = collapsed_path.find('/', 1)←[0m
←[37m while dir_sep > 0 and not collapsed_path[:dir_sep] in self.cgi_directories:←[0m
←[37m dir_sep = collapsed_path.find('/', dir_sep+1)←[0m
←[37m if dir_sep > 0:←[0m
←[37m head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:]←[0m

[11/11] run_cgi β€” prompt 50,520 chars, waiting on model...
response: 685 chars in 31.8s

=== run_cgi [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Execute a CGI script."""←[0m
←[37m dir, rest = self.cgi_info←[0m
←[37m path = dir + '/' + rest←[0m
←[37m i = path.find('/', len(dir)+1)←[0m
←[37m while i >= 0:←[0m
←[37m nextdir = path[:i]←[0m
←[37m nextrest = path[i+1:]←[0m
←[37m←[0m
←[37m scriptdir = self.translate_path(nextdir)←[0m
←[37m if os.path.isdir(scriptdir):←[0m
←[37m dir, rest = nextdir, nextrest←[0m
←[37m i = path.find('/', len(dir)+1)←[0m
←[37m else:←[0m
←[37m break←[0m
←[37m←[0m
←[37m # find an explicit query string, if present.←[0m
←[37m rest, _, query = rest.partition('?')←[0m
←[37m←[0m
←[37m # dissect the part after the directory name into a script name &←[0m
←[37m # a possible additional path, to be stored in PATH_INFO.←[0m
-- missing expected lines --
←[38;5;208m """Execute a CGI script."""←[0m

←[1m=== SUMMARY ===←[0m
Pass: 11/11
Primary lines matched: 217/220
Hallucinated lines: 2
Bonus (extra correct): 1

per-function:
←[32mβœ“β†[0m _url_collapse_path matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m parse_request matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m handle_one_request matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m send_error matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m log_message matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m send_head matched=19/20 halluc= 0 bonus= 1
←[32mβœ“β†[0m list_directory matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m translate_path matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m guess_type matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m is_cgi matched=20/20 halluc= 0 bonus= 0
←[32mβœ“β†[0m run_cgi matched=19/20 halluc= 1 bonus= 0

Results dumped to K:\codeneedle\codeneedle\results\http_server__Qwen3.8-27B-noMTP-Q8.json

(venv) K:\codeneedle\codeneedle>python bench.py run --corpus http_server --model Qwen3.8-27B-noMTP-Q8_XL --base-url http://localhost:8080
(no model config 'Qwen3.8-27B-noMTP-Q8_XL' found; using as raw model identifier with defaults)
Source: http_server.py (49,924 chars, 1,354 lines, 1 file(s))
Extracted 11 named functions with β‰₯20 body lines
Selected 11 target function(s):

  • _url_collapse_path line 924 body_lines=44 (http_server.py)
  • parse_request line 273 body_lines=115 (http_server.py)
  • handle_one_request line 408 body_lines=35 (http_server.py)
  • send_error line 453 body_lines=51 (http_server.py)
  • log_message line 588 body_lines=24 (http_server.py)
  • send_head line 702 body_lines=86 (http_server.py)
  • list_directory line 790 body_lines=58 (http_server.py)
  • translate_path line 850 body_lines=28 (http_server.py)
  • guess_type line 896 body_lines=23 (http_server.py)
  • is_cgi line 1039 body_lines=23 (http_server.py)
  • run_cgi line 1076 body_lines=195 (http_server.py)

Pre-flight: probing context fit with a 50,553-char prompt (max_tokens=1)...
Pre-flight OK.

[1/11] _url_collapse_path β€” prompt 50,553 chars, waiting on model...
response: 767 chars in 57.5s

=== _url_collapse_path [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""←[0m
←[37m Given a URL path, remove extra '/'s and '.' path elements and collapse←[0m
←[37m any '..' references and returns a collapsed path.←[0m
←[37m←[0m
←[37m Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.←[0m
←[37m The utility of this function is limited to is_cgi method and helps←[0m
←[37m preventing some security attacks.←[0m
←[37m←[0m
←[37m Returns: The reconstituted URL, which will always start with a '/'.←[0m
←[37m←[0m
←[37m Raises: IndexError if too many '..' occur within the path.←[0m
←[37m←[0m
←[37m """←[0m
←[37m # Query component should not be involved.←[0m
←[37m path, _, query = path.partition('?')←[0m
←[37m path = urllib.parse.unquote(path)←[0m
←[37m←[0m
←[37m # Similar to os.path.split(os.path.normpath(path)) but specific to URL←[0m
←[37m # path semantics rather than local operating system semantics.←[0m
←[37m path_parts = path.split('/')←[0m
-- missing expected lines --
←[38;5;208m """←[0m

[2/11] parse_request β€” prompt 50,538 chars, waiting on model...
response: 778 chars in 59.3s

=== parse_request [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Parse a request (internal).←[0m
←[37m←[0m
←[37m The request should be stored in self.raw_requestline; the results←[0m
←[37m are in self.command, self.path, self.request_version and←[0m
←[37m self.headers.←[0m
←[37m←[0m
←[37m Return True for success, False for failure; on failure, any relevant←[0m
←[37m error response has already been sent back.←[0m
←[37m←[0m
←[37m """←[0m
←[37m is_http_0_9 = False←[0m
←[37m self.command = None # set in case of error on the first line←[0m
←[37m self.request_version = version = self.default_request_version←[0m
←[37m self.close_connection = True←[0m
←[37m requestline = str(self.raw_requestline, 'iso-8859-1')←[0m
←[37m requestline = requestline.rstrip('\r\n')←[0m
←[37m self.requestline = requestline←[0m
←[37m words = requestline.split()←[0m
←[37m if len(words) == 0:←[0m
←[37m return False←[0m
-- missing expected lines --
←[38;5;208m """Parse a request (internal).←[0m

[3/11] handle_one_request β€” prompt 50,553 chars, waiting on model...
response: 760 chars in 38.8s

=== handle_one_request [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Handle a single HTTP request.←[0m
←[37m←[0m
←[37m You normally don't need to override this method; see the class←[0m
←[37m doc string for information on how to handle specific HTTP←[0m
←[37m commands such as GET and POST.←[0m
←[37m←[0m
←[37m """←[0m
←[37m try:←[0m
←[37m self.raw_requestline = self.rfile.readline(65537)←[0m
←[37m if len(self.raw_requestline) > 65536:←[0m
←[37m self.requestline = ''←[0m
←[37m self.request_version = ''←[0m
←[37m self.command = ''←[0m
←[37m self.send_error(HTTPStatus.REQUEST_URI_TOO_LONG)←[0m
←[37m return←[0m
←[37m if not self.raw_requestline:←[0m
←[37m self.close_connection = True←[0m
←[37m return←[0m
←[37m if not self.parse_request():←[0m
←[37m # An error code has been sent, just exit←[0m
-- missing expected lines --
←[38;5;208m """Handle a single HTTP request.←[0m

[4/11] send_error β€” prompt 50,529 chars, waiting on model...
response: 717 chars in 97.9s

=== send_error [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Send and log an error reply.←[0m
←[37m←[0m
←[37m Arguments are←[0m
←[37m * code: an HTTP error code←[0m
←[37m 3 digits←[0m
←[37m * message: a simple optional 1 line reason phrase.←[0m
←[37m *( HTAB / SP / VCHAR / %x80-FF )←[0m
←[37m defaults to short entry matching the response code←[0m
←[37m * explain: a detailed message defaults to the long entry←[0m
←[37m matching the response code.←[0m
←[37m←[0m
←[37m This sends an error response (so it must be called before any←[0m
←[37m output has been generated), logs the error, and finally sends←[0m
←[37m a piece of HTML explaining the error to the user.←[0m
←[37m←[0m
←[37m """←[0m
←[37m←[0m
←[37m try:←[0m
←[37m shortmsg, longmsg = self.responses[code]←[0m
←[37m except KeyError:←[0m
-- missing expected lines --
←[38;5;208m """Send and log an error reply.←[0m

[5/11] log_message β€” prompt 50,532 chars, waiting on model...
response: 641 chars in 39.9s

=== log_message [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Log an arbitrary message.←[0m
←[37m←[0m
←[37m This is used by all other logging functions. Override←[0m
←[37m it if you have specific logging wishes.←[0m
←[37m←[0m
←[37m The first argument, FORMAT, is a format string for the←[0m
←[37m message to be logged. If the format string contains←[0m
←[37m any % escapes requiring parameters, they should be←[0m
←[37m specified as subsequent arguments (it's just like←[0m
←[37m printf!).←[0m
←[37m←[0m
←[37m The client ip and current date/time are prefixed to←[0m
←[37m every message.←[0m
←[37m←[0m
←[37m Unicode control characters are replaced with escaped hex←[0m
←[37m before writing the output to stderr.←[0m
←[37m←[0m
←[37m """←[0m
←[37m←[0m
←[37m message = format % args←[0m
-- missing expected lines --
←[38;5;208m """Log an arbitrary message.←[0m

[6/11] send_head β€” prompt 50,526 chars, waiting on model...
response: 904 chars in 109.2s

=== send_head [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Common code for GET and HEAD commands.←[0m
←[37m←[0m
←[37m This sends the response code and MIME headers.←[0m
←[37m←[0m
←[37m Return value is either a file object (which has to be copied←[0m
←[37m to the outputfile by the caller unless the command was HEAD,←[0m
←[37m and must be closed by the caller under all circumstances), or←[0m
←[37m None, in which case the caller has nothing further to do.←[0m
←[37m←[0m
←[37m """←[0m
←[37m path = self.translate_path(self.path)←[0m
←[37m f = None←[0m
←[37m if os.path.isdir(path):←[0m
←[37m parts = urllib.parse.urlsplit(self.path)←[0m
←[37m if not parts.path.endswith(('/', '%2f', '%2F')):←[0m
←[37m # redirect browser - doing basically what apache does←[0m
←[37m self.send_response(HTTPStatus.MOVED_PERMANENTLY)←[0m
←[37m new_parts = (parts[0], parts[1], parts[2] + '/',←[0m
←[37m parts[3], parts[4])←[0m
←[37m new_url = urllib.parse.urlunsplit(new_parts)←[0m
-- missing expected lines --
←[38;5;208m """Common code for GET and HEAD commands.←[0m

[7/11] list_directory β€” prompt 50,541 chars, waiting on model...
response: 677 chars in 40.8s

=== list_directory [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Helper to produce a directory listing (absent index.html).←[0m
←[37m←[0m
←[37m Return value is either a file object, or None (indicating an←[0m
←[37m error). In either case, the headers are sent, making the←[0m
←[37m interface the same as for send_head().←[0m
←[37m←[0m
←[37m """←[0m
←[37m try:←[0m
←[37m list = os.listdir(path)←[0m
←[37m except OSError:←[0m
←[37m self.send_error(←[0m
←[37m HTTPStatus.NOT_FOUND,←[0m
←[37m "No permission to list directory")←[0m
←[37m return None←[0m
←[37m list.sort(key=lambda a: a.lower())←[0m
←[37m r = []←[0m
←[37m displaypath = self.path←[0m
←[37m displaypath = displaypath.split('#', 1)[0]←[0m
←[37m displaypath = displaypath.split('?', 1)[0]←[0m
←[37m try:←[0m
-- missing expected lines --
←[38;5;208m """Helper to produce a directory listing (absent index.html).←[0m

[8/11] translate_path β€” prompt 50,541 chars, waiting on model...
response: 778 chars in 57.7s

=== translate_path [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Translate a /-separated PATH to the local filename syntax.←[0m
←[37m←[0m
←[37m Components that mean special things to the local file system←[0m
←[37m (e.g. drive or directory names) are ignored. (XXX They should←[0m
←[37m probably be diagnosed.)←[0m
←[37m←[0m
←[37m """←[0m
←[37m # abandon query parameters←[0m
←[37m path = path.split('#', 1)[0]←[0m
←[37m path = path.split('?', 1)[0]←[0m
←[37m # Don't forget explicit trailing slash when normalizing. Issue17324←[0m
←[37m try:←[0m
←[37m path = urllib.parse.unquote(path, errors='surrogatepass')←[0m
←[37m except UnicodeDecodeError:←[0m
←[37m path = urllib.parse.unquote(path)←[0m
←[37m trailing_slash = path.endswith('/')←[0m
←[37m path = posixpath.normpath(path)←[0m
←[37m words = path.split('/')←[0m
←[37m words = filter(None, words)←[0m
←[37m path = self.directory←[0m
-- missing expected lines --
←[38;5;208m """Translate a /-separated PATH to the local filename syntax.←[0m

[9/11] guess_type β€” prompt 50,529 chars, waiting on model...
response: 737 chars in 57.2s

=== guess_type [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Guess the type of a file.←[0m
←[37m←[0m
←[37m Argument is a PATH (a filename).←[0m
←[37m←[0m
←[37m Return value is a string of the form type/subtype,←[0m
←[37m usable for a MIME Content-type header.←[0m
←[37m←[0m
←[37m The default implementation looks the file's extension←[0m
←[37m up in the table self.extensions_map, using application/octet-stream←[0m
←[37m as a default; however it would be permissible (if←[0m
←[37m slow) to look inside the data to make a better guess.←[0m
←[37m←[0m
←[37m """←[0m
←[37m base, ext = posixpath.splitext(path)←[0m
←[37m if ext in self.extensions_map:←[0m
←[37m return self.extensions_map[ext]←[0m
←[37m ext = ext.lower()←[0m
←[37m if ext in self.extensions_map:←[0m
←[37m return self.extensions_map[ext]←[0m
←[37m guess, _ = mimetypes.guess_file_type(path)←[0m
-- missing expected lines --
←[38;5;208m """Guess the type of a file.←[0m

[10/11] is_cgi β€” prompt 50,517 chars, waiting on model...
response: 914 chars in 84.8s

=== is_cgi [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Test whether self.path corresponds to a CGI script.←[0m
←[37m←[0m
←[37m Returns True and updates the cgi_info attribute to the tuple←[0m
←[37m (dir, rest) if self.path requires running a CGI script.←[0m
←[37m Returns False otherwise.←[0m
←[37m←[0m
←[37m If any exception is raised, the caller should assume that←[0m
←[37m self.path was rejected as invalid and act accordingly.←[0m
←[37m←[0m
←[37m The default implementation tests whether the normalized url←[0m
←[37m path begins with one of the strings in self.cgi_directories←[0m
←[37m (and the next character is a '/' or the end of the string).←[0m
←[37m←[0m
←[37m """←[0m
←[37m collapsed_path = _url_collapse_path(self.path)←[0m
←[37m dir_sep = collapsed_path.find('/', 1)←[0m
←[37m while dir_sep > 0 and not collapsed_path[:dir_sep] in self.cgi_directories:←[0m
←[37m dir_sep = collapsed_path.find('/', dir_sep+1)←[0m
←[37m if dir_sep > 0:←[0m
←[37m head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:]←[0m
-- missing expected lines --
←[38;5;208m """Test whether self.path corresponds to a CGI script.←[0m

[11/11] run_cgi β€” prompt 50,520 chars, waiting on model...
response: 685 chars in 63.5s

=== run_cgi [←[32mPASS←[0m] matched=19/20 hallucinated=1 bonus=0 ===
-- model output --
←[33m"""Execute a CGI script."""←[0m
←[37m dir, rest = self.cgi_info←[0m
←[37m path = dir + '/' + rest←[0m
←[37m i = path.find('/', len(dir)+1)←[0m
←[37m while i >= 0:←[0m
←[37m nextdir = path[:i]←[0m
←[37m nextrest = path[i+1:]←[0m
←[37m←[0m
←[37m scriptdir = self.translate_path(nextdir)←[0m
←[37m if os.path.isdir(scriptdir):←[0m
←[37m dir, rest = nextdir, nextrest←[0m
←[37m i = path.find('/', len(dir)+1)←[0m
←[37m else:←[0m
←[37m break←[0m
←[37m←[0m
←[37m # find an explicit query string, if present.←[0m
←[37m rest, _, query = rest.partition('?')←[0m
←[37m←[0m
←[37m # dissect the part after the directory name into a script name &←[0m
←[37m # a possible additional path, to be stored in PATH_INFO.←[0m
-- missing expected lines --
←[38;5;208m """Execute a CGI script."""←[0m

←[1m=== SUMMARY ===←[0m
Pass: 11/11
Primary lines matched: 209/220
Hallucinated lines: 11
Bonus (extra correct): 0

per-function:
←[32mβœ“β†[0m _url_collapse_path matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m parse_request matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m handle_one_request matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m send_error matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m log_message matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m send_head matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m list_directory matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m translate_path matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m guess_type matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m is_cgi matched=19/20 halluc= 1 bonus= 0
←[32mβœ“β†[0m run_cgi matched=19/20 halluc= 1 bonus= 0

halluc= 1 for XL version are false as this simply wrong indentation, still strange as Q8 version had less of this problem. Seems it still can be optimized.

could you please bench https://huggingface.co/endless-frontier/BigBang-v1 as well?

Sign up or log in to comment